


body, button, div, p, h1, h2, h3, h4, h5, h6, input, textarea, select, option {
    font-family: "Comic Sans MS", "Comic Sans", "Balsamiq Sans", "Patrick Hand", "Architects Daughter", "Chalkboard SE", "Comic Neue", cursive !important;
    font-size: 101% !important;
}

/* Fixed header styles */
header {
    background: linear-gradient(135deg, #2196f3, #64b5f6);
    color: white;
    padding: 10px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}



.button-tray {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 5px;
    min-width: min-content;
    width: max-content;
    margin: 0 auto;
    flex-wrap: wrap;
}

.button-tray button {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 0.9rem;
    background-color: white;
    color: #2196f3;
    border: 2px solid #2196f3;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
}

.button-tray button:hover {
    background-color: #2196f3;
    color: white;
}



body.theme-light .button-tray #shop-button,
body.theme-light .button-tray #broke-button,
body.theme-light .button-tray #music-shop-btn {
    font-family: 'Comic Sans Fallback', "Comic Sans MS", "Comic Sans", cursive !important;
    font-size: 0.9rem !important;
}



#broke-button {
    background-color: #ff9800;
    color: white;
    border: 2px solid #ff9800;
}

#broke-button:hover {
    background-color: #e65100;
    border-color: #e65100;
}

/* Themed warning variant for the Broke button (overrides global) */
body.theme-light #broke-button {
    background: #ffffff;
    color: #e65100;
    border: 1px solid #e65100;
    border-bottom-color: #c24a00;
    border-radius: 6px;
    box-shadow: 0 2px 0 rgba(0,0,0,0.04);
}
body.theme-light #broke-button:hover {
    background: #ffefe3;
    border-color: #ff9800;
}
body.theme-light #broke-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}



body.theme-light #shop-button,
body.theme-light #broke-button,
body.theme-light #music-shop-btn {
	/* base */
	background: #ffffff !important;
	color: #1b2838 !important;
	padding: 8px 16px;
	font-size: 0.9rem;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	

	border: 1px solid var(--border-light) !important;
	border-bottom-color: var(--border-strong) !important;
	border-radius: 6px !important;
	box-shadow: 0 2px 0 #c9d6e8 !important;
	transition: background-color 0.2s, border-color 0.2s, transform 0.05s;
}

body.theme-light #shop-button:hover,
body.theme-light #broke-button:hover,
body.theme-light #music-shop-btn:hover {
	background: #eef5ff !important;
	border-color: #b3ccf8 !important;
}

body.theme-light #shop-button:active,
body.theme-light #broke-button:active,
body.theme-light #music-shop-btn:active {
	transform: translateY(1px);
	box-shadow: 0 1px 0 #c9d6e8 !important;
}



.theme-light .button-group.wallet {
    align-items: center;
    padding-top: 10px; 

}
.theme-light .button-group.wallet .balance {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-bottom-color: var(--border-strong);
    border-radius: 6px;
    box-shadow: 0 2px 0 #c9d6e8;
    line-height: 1;
}
.theme-light .button-group.wallet .coin-icon { width: 20px; height: 20px; }
.theme-light .button-group.wallet #coin-count { font-weight: 700; color: #1b2838; }
.theme-light .button-group.wallet .coin-label { color: #5b6b7f; font-size: 0.95em; }

@media (max-width: 480px) {
    .theme-light .button-group.wallet { margin-top: 8px; display:flex; flex-direction: column; align-items: center; }
    .theme-light .button-group.wallet .balance { padding: 8px 12px; gap: 8px; min-height: 32px; line-height: 1; }
    .theme-light .button-group.wallet .balance span { line-height: 1; display: inline-block; }
    .theme-light .button-group.wallet .balance::before { content: 'Balance'; display: block; text-align: center; color: #5b6b7f; font-size: 12px; margin-bottom: 2px; }
}



.broke-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

#broke-text {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    resize: none;
}

#confirm-broke {
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

#confirm-broke:hover {
    background-color: #388E3C;
}

.error-message {
    color: #d32f2f;
    font-size: 14px;
    margin-top: 0;
    min-height: 20px;
}

/* Shop modal styles */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
}

.modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(180deg,
        var(--panel-bg-start) 0%,
        var(--panel-bg-mid) 50%,
        var(--panel-bg-end) 100%);
    color: var(--ink);
    border: 2px solid var(--panel-border);
    padding: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.close-button {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close-button:hover {
    color: #000;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.shop-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.shop-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.shop-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

.item-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.item-description {
    color: #666;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
}

.item-price {
    color: #4CAF50;
    font-weight: bold;
    margin-bottom: 10px;
}

.buy-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.buy-button:hover {
    background-color: #388E3C;
}

.buy-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}



.games-container {
    max-width: 1200px;
    margin: 120px auto 0;
    padding: 20px;
    position: relative;
    background: radial-gradient(circle at 18% 16%, var(--panel-accent-a) 0, transparent 28%),
                radial-gradient(circle at 82% 10%, var(--panel-accent-b) 0, transparent 26%),
                linear-gradient(135deg, var(--panel-bg-start) 0%, var(--panel-bg-mid) 50%, var(--panel-bg-end) 100%);
    border: 2px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 18px 36px var(--panel-shadow), inset 0 1px 0 var(--panel-inset);
    overflow: hidden;
}

@media (max-width: 768px) {
    .games-container {
        margin-top: 96px;
        padding: 16px;
    }
}



.bet-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 18px auto 0 auto;
    max-width: 220px;
    background: #fff;
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 8px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 1.1em;
}

.coin-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}

#coin-count,
#coin-value {
    font-weight: bold;
    color: #222;
    font-size: 1.1em;
}

.coin-label {
    margin-left: 6px;
    color: #888;
    font-size: 1em;
}

/* Games container */
.games-container {
    max-width: 1200px;
    margin: 120px auto 0;
    padding: 20px;
    position: relative;
    background: radial-gradient(circle at 18% 16%, var(--panel-accent-a) 0, transparent 28%),
                radial-gradient(circle at 82% 10%, var(--panel-accent-b) 0, transparent 26%),
                linear-gradient(135deg, var(--panel-bg-start) 0%, var(--panel-bg-mid) 50%, var(--panel-bg-end) 100%);
    border: 2px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 18px 36px var(--panel-shadow), inset 0 1px 0 var(--panel-inset);
    overflow: hidden;
}

/* Game notification styles */
.game-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    transition: opacity 0.5s ease;
}

/* Coin counter (top card) */
.bet-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 18px auto 0 auto;
    max-width: 220px;
    background: #fff;
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 8px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 1.1em;
}

.coin-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}

#coin-count,
#coin-value {
    font-weight: bold;
    color: #222;
    font-size: 1.1em;
}

.coin-label {
    margin-left: 6px;
    color: #888;
    font-size: 1em;
}

.game-windows {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 26px;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

.game-window {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #e7f0ff 45%, #fff0ff 100%);
    border-radius: 16px;
    border: 2px solid rgba(146, 192, 255, 0.8);
    box-shadow: 0 14px 32px rgba(33, 150, 243, 0.18), 0 0 0 2px rgba(255,255,255,0.9) inset, 0 0 30px rgba(255, 153, 255, 0.22);
    overflow: hidden;
    width: 340px;
    margin: 0 auto;
    transition: transform 0.28s ease, box-shadow 0.28s ease, filter 0.28s ease;
    backdrop-filter: blur(2px);
}

.game-window::before,
.game-window::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    pointer-events: none;
}

.game-window::before {
    background: linear-gradient(120deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 38%);
    opacity: 0.9;
}

.game-window::after {
    background: radial-gradient(circle at 80% 20%, rgba(255, 204, 255, 0.16), transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(120, 195, 255, 0.18), transparent 50%);
    mix-blend-mode: screen;
}

.game-window:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 18px 40px rgba(33, 150, 243, 0.25), 0 0 42px rgba(255, 170, 255, 0.3);
    filter: saturate(1.05);
}

.game-img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #dff0ff 0%, #ffe9ff 100%);
    border-bottom: 2px solid rgba(146, 192, 255, 0.5);
}

.game-img-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.08));
    mix-blend-mode: soft-light;
    pointer-events: none;
}

.game-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 0.4s ease;
}

.game-window:hover .game-img {
    transform: scale(1.06);
}

.game-info {
    padding: 20px 20px 24px;
    text-align: center;
}

.game-info h2 {
    margin-bottom: 8px;
    font-size: 22px;
    color: #0b2a4f;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #ff7de9 0%, #5ac8ff 50%, #ffdf6b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-info p {
    color: #1b2838;
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.45;
    background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.95));
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(146, 192, 255, 0.35);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.play-button {
    position: relative;
    background: linear-gradient(135deg, #6dffb5 0%, #4ed2ff 45%, #9f7dff 100%);
    color: #0b1b33;
    border: 2px solid rgba(11, 27, 51, 0.2);
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    box-shadow: 0 10px 16px rgba(79, 191, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.9);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.play-button::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0));
    pointer-events: none;
}

.play-button:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 14px 24px rgba(79, 191, 255, 0.45), inset 0 1px 0 rgba(255,255,255,0.95);
    filter: saturate(1.05);
}

.play-button:active {
    transform: translateY(1px) scale(0.995);
    box-shadow: 0 8px 14px rgba(79, 191, 255, 0.35);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .games-container {
        padding: 15px;
    }
    
    .game-window {
        width: 100%;
        max-width: 350px;
    }
    
    .game-img-container {
        height: 180px;
    }
    
    .coin-counter {
        padding: 8px 15px;
    }
    
    #coin-value {
        font-size: 1.2rem;
    }
    
    .coin-icon {
        width: 24px;
        height: 24px;
    }
}

/* Override global fixed main for games pages */
html, body { height: auto; overflow-y: auto; }
main { position: relative; inset: auto; width: 100%; height: auto; min-height: auto; overflow: visible; z-index: auto; }
