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

html,
body {
    background-color: #222;
    overflow: hidden;
}

html,
body,
canvas {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.4);

}

#homeBackground {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

.connect-wallet-container {
    display: flex;
    justify-content: center;
}

.connect-wallet-btn {
    margin: 1rem 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.connect-wallet-btn:hover {
    background: linear-gradient(90deg, #0056b3, #007bff);
    transform: translateY(-2px);
    box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.15);
}

.connect-wallet-btn:active {
    transform: translateY(0);
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.connect-wallet-btn span {
    margin-left: 8px;
    /* Space between the icon and text */
}

.connect-wallet-btn div {
    width: 18px;
    /* Adjust icon size */
}

.connect-wallet-btn.connected {
    background: linear-gradient(90deg, #28a745, #218838);
    /* Green for connected */
}

#split {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 100px;
    height: 100px;
    padding: 5px;
    border: none;
}

#feed {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 100px;
    height: 100px;
    padding: 5px;
    border: none;
}

#status {
    position: absolute;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    color: #FFF;
    font-size: 16.1px;
    top: 70px;
    right: 10px;
    font-weight: bold;
    text-align: center;
}

#status .title {
    font-size: 25px;
}

#status .me {
    color: #FF8888;
    font-size: 16.1px;
}

.chatbox {
    position: absolute;
    width: 300px;
    height: 320px;
    background: rgba(22, 22, 22, 0.7);
    bottom: 5px;
    left: 5px;
    border-radius: 5px;
    pointer-events: all;
}

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

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

.chatbox .chat-list li.me b {
    color: #ea6153;
}

.chatbox .chat-list li.me {
    color: white;
}

.chatbox .chat-list li.friend b {
    color: #2ecc71;
}

.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 #DDD;
    outline: none;
    color: white;
}

.chatbox.minimized {
    height: 30px !important;
    overflow: hidden;
}

.chatbox.minimized #chatList,
.chatbox.minimized #chatInput {
    display: none;
}

#minimizeChat {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.startMenu {
    position: relative;
    margin: 50px 0 0 250px;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

.startMenu p {
    padding: 0;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.playerNameInput {
    width: 100%;
    text-align: center;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    box-sizing: border-box;
    outline: none;

}

.playerNameInput:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}



#startButton,
#spectateButton {
    display: block;
    width: 100%;
    height: 44px;
    margin: 10px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#startButton {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

#startButton:hover,
#startButton:active {
    background: linear-gradient(135deg, #55d88b, #28be68);
    transform: translateY(1px);
    box-shadow: none;
}

#spectateButton {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

#spectateButton:hover,
#spectateButton:active {
    background: linear-gradient(135deg, #5dade2, #2e86c1);
    transform: translateY(1px);
    box-shadow: none;
}


#startMenuWrapper {
    transition: max-height 0.5s ease;
    overflow: hidden;
}

.startMenu h3 {
    padding-bottom: 0;
    margin-bottom: 0;
}

.startMenu ul {
    margin: 10px;
    padding: 10px;
    margin-top: 0;
}


#startMenuWrapper {
    z-index: 2;
}

#gameAreaWrapper {
    position: absolute !important;
    top: 0;
    left: 0;
    opacity: 0;
}

#notificationBanner {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);

    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

#notificationBanner.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#notificationBanner.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-50px);
}

.success {
    background-color: rgba(0, 128, 0, 1);
    /* Green */
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 128, 0, 0.5);
}

.info {
    background-color: #007bff;
    /* Green */
    color: #fff;
    box-shadow: 0 4px 8px rgba(11, 66, 161, 0.5);
}

.error {
    background-color: rgba(255, 0, 0, 1);
    /* Red */
    color: #fff;
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.5);
}

.bet-quick-select {
    display: flex;
    justify-content: flex-start;
    gap: 1.3rem;
    margin-bottom: 1rem;

}

.quick-bet-btn {
    background-color: #8999a4;
    color: white;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.quick-bet-btn:hover {
    background-color: #008ecc;
}

.quick-bet-btn:focus {
    background-color: #333;
}

.bet-input {
    display: flex;
    flex-direction: column;
}

.bet-input-container {
    display: flex;
    align-items: baseline;
    border-radius: 5px;
    padding: 0 .8rem 0 0;
    background-color: #333;
}

.bet-input-container input {
    padding: 12px 14px;
    border: none;
    border-radius: 5px;
    background-color: transparent;
    color: #fff;
    font-size: 1rem;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    outline: none;
}

.betGroup {
    display: flex;
    gap: 1rem;
    align-items: baseline;
    width: max-content;
}


.bet-input-container input::placeholder {
    color: #aaa;
}

.bet-unit {
    color: #ffffff;
    font-style: italic;
    font-size: 0.9rem;
}

#gameMenu {
    position: relative;
    margin: 100px auto 0;
    display: none;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

#leaderboardList {
    list-style: none;
    padding: 0;
}

#leaderboardList li {
    margin: 10px 0;
}

#playAgainButton {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 18px;
    background-color: #1e90ff;
    color: white;
    border: none;
    cursor: pointer;
}

#playAgainButton:hover {
    background-color: #4682b4;
}

@media only screen and (min-width : 1224px) {
    #mobile {
        display: none;
    }
}

@media only screen and (max-width : 1224px) {
    #chatbox {
        display: none;
    }
}

input [type="image"]:focus {
    border: none;
    outline: 1px solid transparent;
    border-style: none;
}

*:focus {
    outline: 1px solid transparent;
    border-style: none;
}

.play-button-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-rug {
    position: relative;
    display: inline-block;
    padding: 16px 36px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #f600ff, #3a47d5);
    border: none;
    border-radius: 12px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

.play-rug::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 10%, transparent 10.01%);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.5s ease;
    pointer-events: none;
}

.play-rug:hover::before {
    transform: translate(-50%, -50%) scale(4);
}

.play-rug:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 210, 255, 0.6);
}

.play-rug:active {
    transform: scale(0.95);
    box-shadow: 0 4px 10px rgba(0, 210, 255, 0.3);
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
}

.glass-button {
    padding: 12px 24px;
    background: rgba(124, 124, 124, 0.95);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    width: 200px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.button-with-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 10px;
    position: relative;
    /* spacing between stacked buttons */
}

.content-box {
    display: none;
    font-size: 1.2rem;
    width: 500px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease forwards;
}

.content-box.expanded {
    display: block;
}

.how-to-play {
    background: linear-gradient(145deg, rgba(40, 40, 40, 0.4), rgba(80, 80, 80, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.2);
    transition: all 0.3s ease;
}

.how-to-play h3 {
    font-size: 1.6rem;
    color: #ffffff;
    margin-bottom: 14px;
    text-shadow: 0 0 4px #00ffcc;
}

.how-to-play h3 span {
    font-size: 0.9rem;
    color: #aaa;
    font-weight: normal;
}

.how-to-play ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.how-to-play li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
    font-size: 1.05rem;
    line-height: 1.5;
    position: relative;
    animation: bounceIn 0.4s ease;
}

.how-to-play li span {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.green-highlight {
    color: #00ff95;
    font-weight: bold;
    text-shadow: 0 0 4px #00ff95;
}

.how-to-play a {
    color: #66cfff;
    font-weight: bold;
    transition: color 0.2s ease;
    text-decoration: none;
}

.how-to-play a:hover {
    color: #ffffff;
    text-shadow: 0 0 6px #66cfff;
}

.how-to-win {
    background: linear-gradient(145deg, rgba(80, 20, 20, 0.4), rgba(120, 40, 40, 0.4));
    border: 1px solid rgba(255, 100, 100, 0.2);
    border-radius: 16px;
    padding: 20px;
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 0 10px rgba(255, 80, 80, 0.2);
    transition: all 0.3s ease;
}

.how-to-win h3 {
    font-size: 1.6rem;
    color: #ffaaaa;
    margin-bottom: 14px;
    text-shadow: 0 0 4px #ff5c5c;
}

.how-to-win h3 span {
    font-size: 0.9rem;
    color: #f5bfbf;
    font-weight: normal;
}

.how-to-win ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.how-to-win li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
    font-size: 1.05rem;
    line-height: 1.5;
    position: relative;
    animation: bounceIn 0.4s ease;
}

.how-to-win li span {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.how-to-win a {
    color: #ff8080;
    font-weight: bold;
    transition: color 0.2s ease;
    text-decoration: none;
}

.how-to-win a:hover {
    color: #ffffff;
    text-shadow: 0 0 6px #ff8c8c;
}

.power-ups {
    background: linear-gradient(145deg, rgba(60, 20, 80, 0.4), rgba(100, 40, 120, 0.4));
    border: 1px solid rgba(180, 100, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    color: #f5eaff;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 0 12px rgba(200, 100, 255, 0.25);
    transition: all 0.3s ease;
}

.power-ups h3 {
    font-size: 1.6rem;
    color: #e2c7ff;
    margin-bottom: 14px;
    text-shadow: 0 0 6px #c678ff;
}

.power-ups h3 span {
    font-size: 0.9rem;
    color: #bfa8e5;
    font-weight: normal;
}

.power-ups ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.power-ups li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
    font-size: 1.05rem;
    line-height: 1.5;
    position: relative;
    animation: floatIn 0.4s ease;
}

.power-ups li span {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.power-ups li strong {
    color: #d5a6ff;
    text-shadow: 0 0 3px #ffbaff;
}

.env-effects {
    background: linear-gradient(145deg, rgba(10, 15, 40, 0.6), rgba(40, 20, 60, 0.5));
    border: 1px solid rgba(120, 180, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    color: #dcecff;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 0 14px rgba(100, 200, 255, 0.25);
    transition: all 0.3s ease;
}

.env-effects h3 {
    font-size: 1.6rem;
    color: #ade4ff;
    margin-bottom: 14px;
    text-shadow: 0 0 6px #78d0ff;
}

.env-effects h3 span {
    font-size: 0.9rem;
    color: #a0cbe8;
    font-weight: normal;
}

.env-effects ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.env-effects li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
    font-size: 1.05rem;
    line-height: 1.5;
    position: relative;
    animation: floatIn 0.4s ease;
}

.env-effects li strong {
    color: #a6e1ff;
    text-shadow: 0 0 3px #d0f0ff;
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#money-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 10px 15px;
    display: flex;
    align-items: baseline;
    gap: 15px;
    font-family: sans-serif;
    z-index: 1000;
}

.money-section {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
}

.actions-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

#withdraw-icon,
#leave-button {
    cursor: pointer;
    font-size: 18px;
    background: none;
    border: none;
    outline: none;
    transition: transform 0.2s;
}

#withdraw-icon:hover,
#leave-button:hover {
    transform: scale(1.2);
}

.settings-box h3 {
    font-size: 1.6rem;
    color: #1f2937;
    /* Dark gray-blue for contrast */
    margin-bottom: 16px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    /* soft top-glow */
    letter-spacing: 0.5px;
    margin: 0 0 1rem 0;
}

.settings-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-box li {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
}

.settings-box label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.settings-box input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    cursor: pointer;
    border-radius: 6px;
    background: #2d3748;
    border: 2px solid #64748b;
    transition: all 0.2s ease;
    position: relative;
}

.settings-box input[type="checkbox"]:checked {
    background-color: #4ade80;
    border-color: #86efac;
}

.settings-box input[type="checkbox"]::before {
    content: "✓";
    color: #fff;
    font-size: 14px;
    position: absolute;
    top: 0px;
    left: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.settings-box input[type="checkbox"]:checked::before {
    opacity: 1;
}

#fps-counter {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: lime;
    font-family: monospace;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 9999;
    pointer-events: none;
}

/* Skin selector styles */
.select-skin-btn {
    margin: 8px 0;
    padding: 8px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(90deg, #6ee7b7 0%, #34d399 50%, #10b981 100%);
    color: #04201a;
    border: none;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.18), inset 0 -2px 0 rgba(0, 0, 0, 0.06);
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.select-skin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(16, 185, 129, 0.22), inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}

.select-skin-btn:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.select-skin-btn:focus,
.select-skin-btn:focus-visible {
    outline: 3px solid rgba(16, 185, 129, 0.22);
    outline-offset: 3px;
}

.skin-preview.small {
    width: 32px;
    height: 32px;
}

.skin-preview {
    display: inline-block;
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-left: 8px;
    vertical-align: middle;
}

/* Modal */
#skinModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#skinModal.open {
    display: flex;
}

#skinModal .modal-content {
    background: #121212;
    padding: 16px;
    border-radius: 8px;
    max-width: 720px;
    width: 90%;
    max-height: 80%;
    overflow: auto;
}

#skinModal .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
}

#skinModal .grid img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
}

#skinModal .grid img.selected {
    border-color: #4ADE80;
}

#skinModal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

#skinModal .close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}