* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Performance optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU acceleration for animations */
.dice.rolling,
.bet-square:hover,
.chip:hover,
button:hover {
    transform: translateZ(0);
    will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .dice.rolling {
        animation: none;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 60, 114, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #ffd700;
    font-weight: bold;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 20px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 2px;
    animation: progress 2s ease-in-out;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.loading-tips {
    text-align: center;
    color: #ecf0f1;
    font-size: 0.9em;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-tips p {
    margin: 0;
    opacity: 0;
    animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; transform: translateY(10px); }
    50% { opacity: 1; transform: translateY(0); }
}

/* Enhanced Button States */
.rolling-state {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d) !important;
    cursor: not-allowed !important;
    transform: none !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Enhanced Dice Rolling Animation */
.dice.rolling {
    animation: rollEnhanced 1s ease-in-out;
}

@keyframes rollEnhanced {
    0%, 100% { 
        transform: rotate(0deg) scale(1); 
    }
    25% { 
        transform: rotate(90deg) scale(1.1); 
        box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
    }
    50% { 
        transform: rotate(180deg) scale(1.2); 
        box-shadow: 0 15px 30px rgba(255, 215, 0, 0.5);
    }
    75% { 
        transform: rotate(270deg) scale(1.1); 
        box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    .loading-spinner {
        transform: scale(0.8);
    }
    
    .spinner {
        width: 50px;
        height: 50px;
    }
    
    .loading-text {
        font-size: 1em;
    }
    
    .loading-progress {
        width: 150px;
    }
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    overflow-x: hidden;
    width: 100%;
}

.game-container {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 800px;
    width: 100%;
    position: relative;
    overflow-x: hidden;
    box-sizing: border-box;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.game-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.logo-text {
    font-size: 2.2em;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    font-weight: bold;
}

/* Enhanced Tooltips */
[title] {
    position: relative;
    cursor: help;
}

/* Custom tooltip styling for better appearance */
button[title]:hover::after,
.bet-square[title]:hover::after,
.dice[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ffd700;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 1em;
    font-weight: bold;
    white-space: pre-line;
    z-index: 1000;
    pointer-events: none;
    border: 1px solid #ffd700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-align: center;
    line-height: 1.3;
    max-width: 120px;
}

/* Tooltip arrow */
button[title]:hover::before,
.bet-square[title]:hover::before,
.dice[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(1px);
    border: 5px solid transparent;
    border-top-color: #ffd700;
    z-index: 1001;
    pointer-events: none;
}

/* Special positioning for betting squares */
.bet-square[title]:hover::after {
    bottom: 100%;
    top: auto;
    margin-bottom: 5px;
}

.bet-square[title]:hover::before {
    bottom: 100%;
    top: auto;
    transform: translateX(-50%) translateY(1px);
}

/* Mobile responsive design */
@media (max-width: 768px) {
    .logo-text {
        display: none;
    }

    .logo-icon {
        font-size: 2em;
    }

    .control-buttons {
        gap: 5px;
    }

    .control-btn {
        width: 30px;
        height: 30px;
        font-size: 1em;
    }

    .balance {
        gap: 10px;
        font-size: 1em;
    }

    /* Hide custom tooltips on mobile, use native ones */
    button[title]:hover::after,
    button[title]:hover::before,
    .bet-square[title]:hover::after,
    .bet-square[title]:hover::before,
    .dice[title]:hover::after,
    .dice[title]:hover::before {
        display: none;
    }
}

.game-mode-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.game-mode-selector label {
    font-weight: bold;
    color: #ecf0f1;
}

.game-mode-selector select {
    padding: 5px 10px;
    border: 2px solid #34495e;
    border-radius: 5px;
    background: #2c3e50;
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.game-mode-selector select:hover {
    border-color: #ffd700;
}

.balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 1.2em;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.balance>span:first-child {
    font-size: 1.3em;
    color: #4CAF50;
    font-weight: bold;
}

.betting-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.bet-square {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    border: 3px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.bet-square:hover,
.bet-square:focus {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
    border-color: #ffed4e;
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

.bet-square:focus {
    outline: 3px solid #ffd700;
    outline-offset: 3px;
}

.bet-square.selected {
    border-color: #ff6b6b;
    background: linear-gradient(145deg, #e74c3c, #c0392b);
}

.symbol {
    font-size: 3em;
    margin-bottom: 10px;
}

.symbol-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.bet-amount {
    font-size: 1.1em;
    color: #ffd700;
    font-weight: bold;
}

.betting-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.chip-selector {
    display: flex;
    gap: 10px;
}

.chip {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #ffd700;
}

.chip:hover,
.chip:focus {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

.chip.selected {
    background: linear-gradient(145deg, #ffd700, #f39c12);
    color: #2c3e50;
}

.game-controls {
    display: flex;
    gap: 15px;
}

.game-controls button {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-controls button:hover,
.game-controls button:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

#clear-bets {
    background: linear-gradient(145deg, #e74c3c, #c0392b) !important;
}

#clear-bets:hover {
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4) !important;
}

.dice-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.dice {
    font-size: 4em;
    background: white;
    color: #2c3e50;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.dice.rolling {
    animation: roll 1s ease-in-out;
}

@keyframes roll {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(90deg);
    }

    50% {
        transform: rotate(180deg);
    }

    75% {
        transform: rotate(270deg);
    }
}

.result-message {
    font-size: 1.3em;
    font-weight: bold;
    min-height: 30px;
    margin-top: 20px;
}

.result-message.win {
    color: #4CAF50;
}

.result-message.lose {
    color: #f44336;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
        min-height: auto;
    }

    .game-container {
        padding: 15px;
        margin: 0;
        max-width: 100%;
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .header-section {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .logo-text {
        font-size: 1.8em;
    }

    .logo-icon {
        font-size: 2em;
    }

    .balance {
        flex-direction: column;
        gap: 10px;
        font-size: 1em;
        padding: 10px;
    }

    .control-buttons {
        gap: 5px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .control-btn {
        width: 30px;
        height: 30px;
        font-size: 1em;
    }

    .betting-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .bet-square {
        padding: 15px 10px;
    }

    .symbol {
        font-size: 2.5em;
        margin-bottom: 8px;
    }

    .symbol-name {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .betting-controls {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }

    .chip-selector {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .chip {
        width: 50px;
        height: 50px;
        font-size: 0.9em;
    }

    .game-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .game-controls button {
        padding: 12px 18px;
        font-size: 1em;
        min-width: 120px;
    }

    .quick-bets {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .quick-bet-btn {
        padding: 8px 12px;
        font-size: 0.85em;
        min-width: 100px;
    }

    .dice-container {
        gap: 15px;
        margin-bottom: 15px;
    }

    .dice {
        font-size: 3em;
        width: 60px;
        height: 60px;
    }

    .result-message {
        font-size: 1.1em;
        margin-top: 15px;
        word-wrap: break-word;
    }

    .history-container {
        margin-top: 20px;
        padding: 15px;
    }

    .theme-selector {
        font-size: 0.8em;
    }

    .theme-selector select {
        font-size: 0.75em;
        padding: 2px 6px;
    }

    .game-mode-selector {
        font-size: 0.8em;
    }

    .game-mode-selector select {
        font-size: 0.8em;
        padding: 4px 8px;
    }

    /* Hide custom tooltips on mobile, use native ones */
    button[title]:hover::after,
    button[title]:hover::before,
    .bet-square[title]:hover::after,
    .bet-square[title]:hover::before,
    .dice[title]:hover::after,
    .dice[title]:hover::before {
        display: none;
    }

    /* Panel adjustments for mobile */
    .stats-panel,
    .limits-panel,
    .profile-panel,
    .help-panel,
    .achievements-panel,
    .instructions-panel {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        margin: 5px;
        padding: 15px;
    }

    .shortcuts-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .shortcut-item {
        font-size: 0.85em;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .achievement-item {
        padding: 12px;
        gap: 12px;
    }

    .achievement-icon {
        font-size: 1.8em;
        width: 40px;
    }

    .symbols-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .symbol-info {
        padding: 12px;
        gap: 12px;
    }

    .symbol-large {
        font-size: 2em;
        width: 50px;
    }
}

/* Control Buttons */
.control-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #ffd700;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: scale(1.1);
}

.control-btn.muted {
    opacity: 0.5;
}

.game-container {
    position: relative;
}

/*
 Statistics Panel */
.stats-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 3px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.stats-panel.show {
    display: block;
}

.stats-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stats-panel h3 {
    color: #ffd700;
    margin: 0;
    font-size: 1.5em;
}

.stats-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.9em;
    color: #ccc;
}

.stat-value {
    font-weight: bold;
    color: #ffd700;
}

.reset-btn {
    width: 100%;
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/*
 Betting Limits Panel */
.limits-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 3px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.limits-panel.show {
    display: block;
}

.limits-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.limits-panel h3 {
    color: #ffd700;
    margin: 0;
    font-size: 1.5em;
}

.limits-grid {
    display: grid;
    gap: 15px;
}

.limit-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.limit-item label {
    font-size: 0.9em;
    color: #ccc;
    font-weight: bold;
}

.limit-item select {
    background: #2c3e50;
    color: #ffd700;
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 8px;
    font-weight: bold;
    cursor: pointer;
}

.limit-item select:focus {
    outline: none;
    border-color: #ffed4e;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* 
Game History */
.history-container {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #34495e;
}

.history-container h4 {
    color: #ffd700;
    margin-bottom: 15px;
    text-align: center;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-dice {
    font-size: 1.2em;
    letter-spacing: 5px;
}

.history-result {
    font-weight: bold;
}

.history-result.win {
    color: #4CAF50;
}

.history-result.lose {
    color: #f44336;
}

.history-placeholder {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
}

/* Custom scrollbar for history */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #ffed4e;
}

/* St
reak Display */
.streak-display {
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

#streak-text {
    font-weight: bold;
}

#streak-text.win-streak {
    color: #4CAF50;
}

#streak-text.lose-streak {
    color: #f44336;
}

#streak-emoji {
    font-size: 1.5em;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* 
Help Panel */
.help-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 3px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.help-panel.show {
    display: block;
}

.help-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.help-panel h3 {
    color: #ffd700;
    margin: 0;
    font-size: 1.5em;
}

.shortcuts-grid {
    display: grid;
    gap: 8px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: #ccc;
}

kbd {
    background: #2c3e50;
    color: #ffd700;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    border: 1px solid #ffd700;
    min-width: 30px;
    text-align: center;
}

/* Quick B
et Buttons */
.quick-bets {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.quick-bet-btn {
    background: linear-gradient(145deg, #8e44ad, #9b59b6);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quick-bet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(142, 68, 173, 0.4);
    border-color: #ffd700;
}

#bet-max {
    background: linear-gradient(145deg, #e67e22, #f39c12) !important;
}

#bet-max:hover {
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.4) !important;
}

/* Th
eme Selector */
.theme-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
}

.theme-selector label {
    font-weight: bold;
}

.theme-selector select {
    padding: 3px 8px;
    border: 1px solid #34495e;
    border-radius: 5px;
    background: #2c3e50;
    color: white;
    font-size: 0.8em;
    cursor: pointer;
}

/* Theme Styles */
body.theme-neon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.theme-neon .game-container {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

body.theme-neon .bet-square {
    background: linear-gradient(45deg, #ff006e, #8338ec);
    border: 2px solid #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

body.theme-neon .bet-square.selected {
    box-shadow: 0 0 25px rgba(255, 255, 0, 0.8);
    border-color: #ffff00;
}

body.theme-royal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.theme-royal .game-container {
    background: linear-gradient(45deg, #2c1810, #8b4513);
    border: 3px solid #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

body.theme-royal .bet-square {
    background: linear-gradient(45deg, #8b0000, #4b0000);
    border: 2px solid #ffd700;
    color: #ffd700;
}

body.theme-royal .bet-square.selected {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #8b0000;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

body.theme-pirate {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

body.theme-pirate .game-container {
    background: linear-gradient(45deg, #8b4513, #654321);
    border: 3px solid #cd853f;
    box-shadow: 0 0 30px rgba(205, 133, 63, 0.3);
}

body.theme-pirate .bet-square {
    background: linear-gradient(45deg, #2f4f4f, #1c3333);
    border: 2px solid #cd853f;
    color: #f5deb3;
}

body.theme-pirate .bet-square.selected {
    background: linear-gradient(45deg, #cd853f, #daa520);
    color: #2f4f4f;
    box-shadow: 0 0 20px rgba(205, 133, 63, 0.8);
}

/* Theme-specific button styles */
body.theme-neon button {
    background: linear-gradient(45deg, #ff006e, #8338ec);
    border: 2px solid #00ffff;
    color: white;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

body.theme-royal button {
    background: linear-gradient(45deg, #8b0000, #4b0000);
    border: 2px solid #ffd700;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

body.theme-pirate button {
    background: linear-gradient(45deg, #2f4f4f, #1c3333);
    border: 2px solid #cd853f;
    color: #f5deb3;
    text-shadow: 0 0 5px rgba(205, 133, 63, 0.5);
}

/* Dark Mode Styles */
body.dark-mode {
    background: linear-gradient(135deg, #0f0f23, #1a1a2e);
    color: #e0e0e0;
}

body.dark-mode .game-container {
    background: rgba(20, 20, 30, 0.95);
    border: 2px solid #333;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

body.dark-mode .logo-text {
    color: #bb86fc;
}

body.dark-mode .balance {
    background: rgba(40, 40, 50, 0.8);
    border-color: rgba(187, 134, 252, 0.3);
}

body.dark-mode .bet-square {
    background: linear-gradient(145deg, #2a2a3a, #1f1f2e);
    border-color: #bb86fc;
    color: #e0e0e0;
}

body.dark-mode .bet-square:hover,
body.dark-mode .bet-square:focus {
    border-color: #03dac6;
    box-shadow: 0 10px 20px rgba(3, 218, 198, 0.3);
}

body.dark-mode .bet-square.selected {
    background: linear-gradient(145deg, #bb86fc, #9c4dcc);
    color: #000;
}

body.dark-mode .chip {
    background: linear-gradient(145deg, #bb86fc, #9c4dcc);
    color: #000;
    border-color: #03dac6;
}

body.dark-mode .chip.selected {
    background: linear-gradient(145deg, #03dac6, #018786);
    color: #000;
}

body.dark-mode .game-controls button {
    background: linear-gradient(145deg, #03dac6, #018786);
    color: #000;
}

body.dark-mode .game-controls button:hover,
body.dark-mode .game-controls button:focus {
    box-shadow: 0 5px 15px rgba(3, 218, 198, 0.4);
}

body.dark-mode .dice {
    background: #2a2a3a;
    color: #bb86fc;
    border: 2px solid #03dac6;
}

body.dark-mode .control-btn {
    background: rgba(40, 40, 50, 0.8);
    border-color: #bb86fc;
    color: #e0e0e0;
}

body.dark-mode .control-btn:hover {
    background: rgba(187, 134, 252, 0.3);
}

body.dark-mode .history-container {
    background: rgba(20, 20, 30, 0.8);
    border-color: #333;
}

body.dark-mode .history-item {
    background: rgba(40, 40, 50, 0.6);
    color: #e0e0e0;
}

body.dark-mode .history-item:hover {
    background: rgba(40, 40, 50, 0.8);
}

/* Dark mode panels */
body.dark-mode .stats-panel,
body.dark-mode .limits-panel,
body.dark-mode .help-panel,
body.dark-mode .achievements-panel,
body.dark-mode .instructions-panel {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-color: #bb86fc;
    color: #e0e0e0;
}

body.dark-mode .panel-header h3 {
    color: #bb86fc;
}

body.dark-mode .close-btn {
    color: #bb86fc;
}

body.dark-mode .close-btn:hover {
    background: rgba(187, 134, 252, 0.2);
}

body.dark-mode .achievement-item {
    background: rgba(40, 40, 50, 0.8);
    color: #e0e0e0;
}

body.dark-mode .achievement-item.unlocked {
    border-color: #03dac6;
    background: rgba(3, 218, 198, 0.1);
}

body.dark-mode .achievement-title {
    color: #bb86fc;
}

body.dark-mode .symbol-info {
    background: rgba(40, 40, 50, 0.6);
    border-color: rgba(187, 134, 252, 0.3);
}

body.dark-mode .symbol-info:hover {
    border-color: #bb86fc;
    background: rgba(187, 134, 252, 0.1);
}

body.dark-mode kbd {
    background: #2a2a3a;
    color: #bb86fc;
    border-color: #bb86fc;
}

/* Dark mode loading overlay */
body.dark-mode .loading-overlay {
    background: rgba(15, 15, 35, 0.95);
}

body.dark-mode .loading-text {
    color: #bb86fc;
}

body.dark-mode .spinner {
    border-color: rgba(187, 134, 252, 0.3);
    border-top-color: #bb86fc;
}

body.dark-mode .progress-bar {
    background: linear-gradient(90deg, #bb86fc, #03dac6);
}

/* 
Achievements Panel */
.achievements-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 3px solid #f39c12;
    border-radius: 15px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.achievements-panel.show {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.achievements-panel h3 {
    color: #f39c12;
    margin: 0;
    font-size: 1.5em;
}

.close-btn {
    background: none;
    border: none;
    color: #f39c12;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(243, 156, 18, 0.2);
    transform: scale(1.1);
}

.achievements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(52, 73, 94, 0.8);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.achievement-item.unlocked {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.3);
}

.achievement-icon {
    font-size: 2em;
    width: 50px;
    text-align: center;
}

.achievement-info {
    flex: 1;
}

.achievement-title {
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 5px;
}

.achievement-description {
    font-size: 0.9em;
    color: #bdc3c7;
    line-height: 1.3;
}

.achievement-progress {
    font-size: 0.8em;
    color: #f39c12;
    margin-top: 5px;
}

.achievement-item.unlocked .achievement-title {
    color: #f39c12;
}

.achievement-item.unlocked .achievement-description {
    color: #ecf0f1;
}

/* Instructions Panel */
.instructions-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 3px solid #3498db;
    border-radius: 15px;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.instructions-panel.show {
    display: block;
}

.instructions-panel h3 {
    color: #3498db;
    margin: 0;
    font-size: 1.5em;
}

.instructions-content {
    color: #ecf0f1;
}

.instruction-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(52, 152, 219, 0.3);
}

.instruction-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.instruction-section h4 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.instruction-section p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #bdc3c7;
}

.instruction-section ol,
.instruction-section ul {
    line-height: 1.6;
    padding-left: 20px;
}

.instruction-section li {
    margin-bottom: 8px;
    color: #ecf0f1;
}

.instruction-section strong {
    color: #3498db;
}

.symbols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.symbol-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(52, 73, 94, 0.6);
    border-radius: 10px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.symbol-info:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.symbol-large {
    font-size: 2.5em;
    width: 60px;
    text-align: center;
}

.symbol-info div {
    flex: 1;
}

.symbol-info strong {
    display: block;
    color: #3498db;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.symbol-info p {
    margin: 0;
    color: #bdc3c7;
    font-size: 0.9em;
}

/* 
Bonus Display */
.bonus-display {
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.bonus-display.active {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #2c3e50;
    border-color: #f39c12;
    animation: bonusGlow 2s infinite;
}

@keyframes bonusGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
}

#bonus-text {
    font-weight: bold;
}

#bonus-emoji {
    font-size: 1.3em;
}

/* Multiplayer Section */
.multiplayer-section {
    margin: 20px 0;
    padding: 20px;
    background: rgba(52, 73, 94, 0.8);
    border-radius: 15px;
    border: 2px solid #3498db;
}

.multiplayer-section h3 {
    color: #3498db;
    text-align: center;
    margin-bottom: 15px;
}

.lobby-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.lobby-controls input {
    padding: 8px 12px;
    border: 2px solid #34495e;
    border-radius: 5px;
    background: #2c3e50;
    color: white;
    font-size: 0.9em;
}

.lobby-controls input:focus {
    outline: none;
    border-color: #3498db;
}

.lobby-controls button {
    padding: 8px 15px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.lobby-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.players-list h4 {
    color: #ecf0f1;
    margin-bottom: 10px;
}

.player-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-item.ready {
    background: rgba(46, 204, 113, 0.2);
    border-left: 4px solid #2ecc71;
}

/* Tournament Section */
.tournament-section {
    margin: 20px 0;
    padding: 20px;
    background: rgba(142, 68, 173, 0.8);
    border-radius: 15px;
    border: 2px solid #9b59b6;
}

.tournament-section h3 {
    color: #9b59b6;
    text-align: center;
    margin-bottom: 15px;
}

.tournament-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.tournament-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tournament-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 80px;
}

.tournament-stats .stat-label {
    font-size: 0.8em;
    color: #bdc3c7;
    margin-bottom: 5px;
}

.tournament-stats .stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #9b59b6;
}

.tournament-controls button {
    padding: 10px 20px;
    background: linear-gradient(45deg, #9b59b6, #8e44ad);
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.tournament-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.3);
}

.tournament-bracket {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.bracket-round {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
}

.bracket-round h4 {
    color: #9b59b6;
    text-align: center;
    margin-bottom: 10px;
}

.bracket-match {
    background: rgba(52, 73, 94, 0.8);
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #9b59b6;
}

.bracket-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.bracket-player.winner {
    color: #2ecc71;
    font-weight: bold;
}

.bracket-player.loser {
    color: #95a5a6;
    text-decoration: line-through;
}
/* 
Performance Optimizations */
.low-performance * {
    animation-duration: 0.1s !important;
    transition-duration: 0.1s !important;
}

.low-performance .dice.rolling {
    animation: none;
    transform: scale(1.1);
}

.low-performance .loading-spinner .spinner {
    animation-duration: 2s;
}

/* Connection Status Indicator */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    z-index: 1001;
    transition: all 0.3s ease;
}

.connection-status.online {
    background: rgba(76, 175, 80, 0.9);
    color: white;
}

.connection-status.offline {
    background: rgba(244, 67, 54, 0.9);
    color: white;
}

/* Enhanced Error Messages */
.error-recovery {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 1002;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.error-recovery h4 {
    margin: 0 0 10px 0;
    color: #fff;
}

.error-recovery p {
    margin: 0 0 15px 0;
    font-size: 0.9em;
}

.error-recovery button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.error-recovery button:hover {
    background: white;
    color: #e74c3c;
}

/* Advanced Animations */
@keyframes slideInFromTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutToTop {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.notification-enter {
    animation: slideInFromTop 0.3s ease-out;
}

.notification-exit {
    animation: slideOutToTop 0.3s ease-in;
}

/* Improved Focus Indicators */
button:focus-visible,
.bet-square:focus-visible,
.chip:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(255, 215, 0, 0.3);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bet-square {
        border-width: 4px;
    }
    
    .chip {
        border-width: 4px;
    }
    
    button {
        border-width: 3px;
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    .loading-tips p {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .notification-enter,
    .notification-exit {
        animation: none;
    }
    
    .dice.rolling {
        animation: none;
        transform: scale(1.05);
    }
}

/* Print Styles */
@media print {
    .game-container {
        background: white;
        color: black;
        box-shadow: none;
    }
    
    .control-buttons,
    .loading-overlay,
    .stats-panel,
    .limits-panel,
    .profile-panel,
    .help-panel,
    .achievements-panel,
    .instructions-panel {
        display: none !important;
    }
}

/* Screen Reader Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced Mobile Performance */
@media (max-width: 768px) {
    .low-performance .betting-board {
        transform: translateZ(0);
        will-change: auto;
    }
    
    .low-performance .dice-container {
        transform: translateZ(0);
        will-change: auto;
    }
    
    /* Reduce visual complexity on low-end devices */
    .low-performance .bet-square {
        background: #2c3e50;
        box-shadow: none;
    }
    
    .low-performance .chip {
        background: #e74c3c;
        box-shadow: none;
    }
}/* 
Advanced Notification Styles */
.advanced-notification {
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
}

.advanced-notification.notification-enter {
    transform: translateX(0);
}

.advanced-notification.notification-exit {
    transform: translateX(100%);
    opacity: 0;
}

.advanced-notification:hover {
    transform: translateX(-5px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

/* Notification Types */
.advanced-notification.info {
    border-left: 4px solid #3498db;
}

.advanced-notification.success {
    border-left: 4px solid #27ae60;
}

.advanced-notification.warning {
    border-left: 4px solid #f39c12;
}

.advanced-notification.error {
    border-left: 4px solid #e74c3c;
}

/* Enhanced Loading Tips Animation */
.loading-tips p {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(5px);
}

/* Improved Panel Animations */
.stats-panel.show,
.limits-panel.show,
.profile-panel.show,
.help-panel.show,
.achievements-panel.show,
.instructions-panel.show {
    animation: panelSlideIn 0.3s ease-out;
}

@keyframes panelSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Enhanced Focus Management */
.focus-trap-active {
    overflow: hidden;
}

/* Better Mobile Notifications */
@media (max-width: 768px) {
    #notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .advanced-notification {
        max-width: none;
        margin-bottom: 8px;
        font-size: 0.85em;
        padding: 10px 14px;
    }
    
    .advanced-notification:hover {
        transform: translateX(0) scale(1);
    }
}

/* Dark Mode Notification Adjustments */
body.dark-mode .advanced-notification {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(187, 134, 252, 0.3);
}

body.dark-mode .advanced-notification.info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.9), rgba(41, 128, 185, 0.9));
    border-left-color: #bb86fc;
}

body.dark-mode .advanced-notification.success {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.9), rgba(46, 204, 113, 0.9));
    border-left-color: #03dac6;
}

body.dark-mode .advanced-notification.warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.9), rgba(230, 126, 34, 0.9));
    border-left-color: #ffd700;
}

body.dark-mode .advanced-notification.error {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.9), rgba(192, 57, 43, 0.9));
    border-left-color: #cf6679;
}

/* Performance Indicator */
.performance-indicator {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.7em;
    font-family: monospace;
    z-index: 1000;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.performance-indicator:hover {
    opacity: 1;
}

/* Accessibility Improvements */
@media (prefers-color-scheme: dark) {
    body:not(.dark-mode) {
        /* Respect system dark mode preference */
        background: linear-gradient(135deg, #0f0f23, #1a1a2e);
        color: #e0e0e0;
    }
}

/* High Contrast Mode Enhancements */
.high-contrast .bet-square {
    border-width: 4px;
    border-color: #ffffff;
}

.high-contrast .chip {
    border-width: 4px;
    border-color: #ffffff;
}

.high-contrast button {
    border-width: 3px;
    border-color: #ffffff;
}

.high-contrast .advanced-notification {
    border: 3px solid #ffffff;
    color: #000000;
    background: #ffffff !important;
}

/* Reduced Motion Enhancements */
.reduced-motion .advanced-notification {
    transition: none;
    transform: none;
}

.reduced-motion .advanced-notification.notification-enter,
.reduced-motion .advanced-notification.notification-exit {
    transform: none;
    opacity: 1;
}

.reduced-motion .reduced-motion .advanced-notification.notification-exit {
    opacity: 0;
}

.reduced-motion .loading-tips p {
    animation: none;
    opacity: 1;
    transform: none;
}

.reduced-motion .stats-panel.show,
.reduced-motion .limits-panel.show,
.reduced-motion .profile-panel.show,
.reduced-motion .help-panel.show,
.reduced-motion .achievements-panel.show,
.reduced-motion .instructions-panel.show {
    animation: none;
}

/* Player Profile Panel */
.profile-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 3px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.profile-panel.show {
    display: block;
}

.profile-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.profile-panel h3 {
    color: #ffd700;
    margin: 0;
    font-size: 1.5em;
}

/* Other Players' Bets Badges on Squares */
.bet-square {
    position: relative;
}

.other-bets-container {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    pointer-events: none;
    align-items: flex-end;
    font-size: 0.7em;
    max-height: 70px;
    overflow-y: hidden;
    z-index: 5;
}

.other-bet-badge {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border-left: 3px solid #2ecc71;
    white-space: nowrap;
}
/* ============================================================
   COMPACT ONE-SCREEN LAYOUT (no scroll on desktop)
   Two-column grid: board/dice/result on the left,
   betting controls + history on the right, full-width header+balance.
   ============================================================ */
.game-container {
    max-width: 1200px;
    padding: 20px;
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    grid-template-areas:
        "header   header"
        "balance  balance"
        "board    controls"
        "dice     history"
        "result   .";
    gap: 18px;
    align-items: start;
}

.header-section { grid-area: header; margin-bottom: 0; }
.balance        { grid-area: balance; margin-bottom: 0; }
.betting-board  { grid-area: board; margin-bottom: 0; }
.betting-controls { grid-area: controls; margin-bottom: 0; flex-direction: column; align-items: stretch; gap: 14px; }
.dice-container { grid-area: dice; margin-bottom: 0; }
.result-message { grid-area: result; margin-top: 0; }
.history-container { grid-area: history; margin-top: 0; }

/* Full-width for mode sections when made visible */
.multiplayer-section,
.tournament-section {
    grid-column: 1 / -1;
    width: 100%;
    text-align: left;
}

/* Tighter sizing so everything fits one screen */
.betting-board { gap: 12px; }
.bet-square { padding: 14px 10px; }
.bet-square .symbol { font-size: 2.4em; margin-bottom: 4px; }
.bet-square .symbol-name { font-size: 1.05em; margin-bottom: 6px; }
.game-controls { flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip-selector { justify-content: center; }
.quick-bets { margin-top: 0; }
.dice { width: 62px; height: 62px; font-size: 2.8em; }
.history-list { max-height: 150px; }

/* Single-column fallback on narrow screens */
@media (max-width: 900px) {
    .game-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "balance"
            "board"
            "controls"
            "dice"
            "result"
            "history";
    }
    .betting-controls { flex-direction: row; align-items: center; justify-content: center; }
    .multiplayer-section,
    .tournament-section { grid-column: auto; }
}
