* {
    font-family: sans-serif;
    font-size: 14px;
}

html, body {
    background-color: #f2f2f2;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

#solanaBalance {
    position: absolute;
    top: 45px;
    right: 5px;
    padding: 6px;
    margin: 0;
    background: rgba(0, 0, 0, 0.4);
    color: #FFF;
    font-size: 15px;
    cursor: default;
    text-align: center;
    border-radius: 4px;
    z-index: 10;
}

.input-error {
    color: red;
    opacity: 0;
    font-size: 12px;
}

#status {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 200px;
    height: 35px;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    color: white;
    font-size: 15px;
    text-align: center;
    z-index: 10;
}

#status .title {
    font-size: 18px;
    font-weight: bold;
}

#status .me {
    color: #FF8888;
    font-weight: bold;
}

.chatbox {
    position: absolute;
    width: 600px;
    height: 180px;
    background: rgba(255, 255, 255, 0.5);
    bottom: 5px;
    left: 5px;
    border-radius: 5px;
    pointer-events: none;
    z-index: 10;
}

.chatbox .chat-list {
    padding: 5px;
    margin: 0;
    list-style: none;
    box-sizing: border-box;
    height: 150px;
    overflow: hidden;
}

.chatbox .chat-list li {
    padding: 2px;
    margin: 3px;
}

.chatbox .chat-list li.me {
    color: #1d6fc3;
    font-weight: bold;
}

.chatbox .chat-list li.friend {
    color: #ea6153;
    font-weight: bold;
}

.chatbox .chat-list li.system {
    color: #9b59b6;
    font-style: italic;
}

.chatbox .chat-list li.system:before {
    content: "» ";
}

.chatbox .chat-input {
    pointer-events: all;
    box-sizing: border-box;
    width: 100%;
    padding: 8px;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    outline: none;
}

#startMenu {
    position: relative;
    margin: 10px auto 0;
    width: 350px;
    padding: 20px;
    border-radius: 5px;
    background-color: white;
    box-sizing: border-box;
    z-index: 2;
}

#startMenu p {
    padding: 0;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
}

#playerNameInput {
    width: 100%;
    text-align: center;
    padding: 10px;
    border: solid 1px #dcdcdc;
    transition: box-shadow 0.3s, border 0.3s;
    box-sizing: border-box;
    border-radius: 5px;
    margin-bottom: 10px;
    outline: none;
}

#playerNameInput:focus, #playerNameInput.focus {
    border: solid 1px #CCCCCC;
    box-shadow: 0 0 3px 1px #DDDDDD;
}

#startMenu button {
    position: relative;
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    font-size: 16px;
    color: white;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    background: #9945FF;
    border: 0;
    border-bottom: 2px solid #7D3AC1;
    cursor: pointer;
    -webkit-box-shadow: inset 0 -2px #7D3AC1;
    box-shadow: inset 0 -2px #7D3AC1;
    border-radius: 5px;
    margin: 10px 0;
}

#startMenu button:disabled {
    background: #CCC;
    border-bottom: 2px solid #999;
    -webkit-box-shadow: inset 0 -2px #999;
    box-shadow: inset 0 -2px #999;
}

#startMenu button:active, #startMenu button:hover {
    outline: none;
    background: #8135FF;
}

#gameAreaWrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
}

#startMenuWrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    max-height: 100%;
    transition: max-height 1s;
}

#mobile {
    position: absolute;
    bottom: 50px;
    right: 20px;
    z-index: 12;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input.split {
    display: none;
    width: 70px;
    height: 70px;
    cursor: pointer;
    opacity: 0.8;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background-color: rgba(66, 66, 66, 0.6);
    transition: opacity 0.3s;
}

input.feed {
    display: none;
    width: 70px;
    height: 70px;
    cursor: pointer;
    opacity: 0.8;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background-color: rgba(66, 66, 66, 0.6);
    transition: opacity 0.3s;
}

input.split:active, input.feed:active {
    opacity: 1;
    transform: scale(0.95);
}

#mobile img {
    width: 40px;
    height: 40px;
    display: none;
    margin: auto;
}

#mobile:after {
    content: "";
    display: table;
    clear: both;
}

#settings {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

#settings h3 {
    margin: 10px 0 5px;
    text-align: center;
    color: #4a4a4a;
}

#settings ul {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

#settings label {
    display: block;
    margin: 5px 0;
}

#settings input[type="checkbox"] {
    margin-right: 10px;
}

#instructions {
    margin-top: 15px;
}

#instructions h3 {
    margin: 10px 0 5px;
    text-align: center;
    color: #4a4a4a;
}

#instructions ul {
    margin: 0;
    padding: 0 0 0 20px;
    list-style-type: disc;
    text-align: left;
}

#instructions li {
    margin: 5px 0;
}

/* Mobile controls */
@media only screen and (max-width: 767px) {
    .chatbox {
        display: none;
    }
    
    #mobile img {
        display: inline;
    }
    
    input.split, input.feed {
        display: inline;
    }
}

/* Exit button */
#exitButton {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 8px 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    z-index: 15;
}

#exitButton:hover {
    background-color: #c0392b;
}

/* Wallet styles */
#walletContainer {
    position: relative;
    margin-top: 15px;
    text-align: center;
}

#walletStatus {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

.wallet-connected {
    color: #27ae60;
}

.wallet-error {
    color: #e74c3c;
}

/* Notification style */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 5px;
    color: white;
    max-width: 350px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.success {
    background-color: #27ae60;
}

.notification.error {
    background-color: #e74c3c;
}

.notification.info {
    background-color: #3498db;
}

/* CSS for Solana transaction verification button */
.solana-verify-btn {
    position: fixed;
    left: 50%;
    bottom: 10%;
    transform: translateX(-50%);
    background-color: #9945FF;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    z-index: 9999;
    transition: background-color 0.3s;
}

.solana-verify-btn:hover {
    background-color: #7D3AC1;
}
