/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Beta Banner */
.beta-banner {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 12px 20px;
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease-out;
}

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

.beta-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.beta-badge {
    background: white;
    color: #ff6b6b;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.beta-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.beta-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.beta-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.beta-banner.hidden {
    display: none;
}

/* Dark mode for beta banner */
body.dark-mode .beta-banner {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
}

/* No need for body padding adjustment since banner is in document flow */

/* Responsive adjustments for beta banner */
@media (max-width: 768px) {
    .beta-banner {
        padding: 10px 15px;
    }
    
    .beta-banner-content {
        gap: 10px;
    }
    
    .beta-badge {
        font-size: 0.75rem;
        padding: 3px 10px;
    }
    
    .beta-message {
        font-size: 0.85rem;
        flex-basis: 100%;
    }
    
    .beta-close {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.game-header h1 {
    font-size: 2.5rem;
    color: #000;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2rem;
    font-weight: 600;
}

.current-player, .game-phase {
    background: #f7fafc;
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #e2e8f0;
}

/* Main game area */
.game-main {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.chess-board-container {
    flex: 1;
    min-width: 0;
}

.game-controls {
    width: 350px;
    flex-shrink: 0;
}

/* Chess board */
.chess-board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    gap: 10px;
}

.board-with-side-coords {
    display: flex;
    align-items: center;
    gap: 10px;
}

.board-coordinates {
    display: flex;
    user-select: none;
}

.board-coordinates.bottom-coords {
    flex-direction: row;
    gap: 0;
}

.board-coordinates.left-coords {
    flex-direction: column;
    gap: 0;
}

.coord-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: #667eea;
    transition: all 0.3s ease;
}

.board-coordinates.bottom-coords .coord-label {
    width: 70px;
    height: 30px;
}

.board-coordinates.left-coords .coord-label {
    width: 30px;
    height: 70px;
}

.coord-spacer {
    width: 40px;
    height: 40px;
}

.coord-label.highlighted {
    color: #ffd700;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

body.dark-mode .coord-label {
    color: #a8b6f5;
}

body.dark-mode .coord-label.highlighted {
    color: #ffd700;
}

.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 560px;
    height: 560px;
    border: 4px solid #4a5568;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.chess-square {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

/* Chess pieces should appear above rifts */
.chess-square:not(:empty) {
    z-index: 15;
}

.chess-square.light {
    background-color: #f0d9b5;
}

.chess-square.dark {
    background-color: #b58863;
}

.chess-square:hover {
    transform: scale(1.05);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.chess-square.selected {
    background-color: #ffd700 !important;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.8);
}

.chess-square.possible-move {
    background-color: #90ee90 !important;
    position: relative;
}

.chess-square.possible-move::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #228b22;
    border-radius: 50%;
    opacity: 0.7;
}

.chess-square.capture-move {
    background-color: #ff6b6b !important;
    position: relative;
}

.chess-square.capture-move::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid #dc2626;
    border-radius: 50%;
    opacity: 0.8;
}

/* Rift styling */
.chess-square.rift {
    background: linear-gradient(45deg, #667eea, #764ba2, #4facfe, #00f2fe) !important;
    background-size: 400% 400% !important;
    animation: rift-glow 6s ease-in-out infinite !important;
    position: relative;
}

/* Rifts stay the same in dark mode - no override needed */

.chess-square.rift::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-image: url('assets/Rift/SVG/Rift Blue.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 5;
    filter: drop-shadow(0 0 10px rgba(100, 150, 255, 0.8));
    animation: rift-swirl 4s linear infinite;
}

@keyframes rift-swirl {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* Hide rift graphic when square has a piece */
.chess-square.rift:not(:empty)::before {
    display: none;
}

/* Dark mode: Rift graphic stays the same (no changes needed) */

@keyframes rift-glow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.chess-square.rift.activated {
    animation: rift-activation 1s ease-in-out;
}

@keyframes rift-activation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Board coordinates */


/* Game controls */
.game-controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    height: fit-content;
}

.game-controls h3 {
    color: #000;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.game-controls p {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #666;
}

.rift-counter {
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    font-weight: 600;
    text-align: center;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn.primary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.btn.danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

/* Captured pieces */
.captured-pieces {
    margin: 20px 0;
}

.captured-pieces h4,
.active-effects h4 {
    color: #000;
}

.captured-white, .captured-black {
    margin: 10px 0;
    padding: 10px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #e2e8f0;
}

body.dark-mode .captured-white, 
body.dark-mode .captured-black {
    background: #444;
    color: #fff;
}

body.dark-mode .captured-white span, 
body.dark-mode .captured-black span {
    color: #fff;
}

.captured-white {
    border-left-color: #cbd5e0;
}

.captured-black {
    border-left-color: #4a5568;
}

.captured-white span, .captured-black span {
    font-weight: 600;
    margin-right: 10px;
}

#captured-white-pieces, #captured-black-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

/* Active effects */
.active-effects {
    margin: 20px 0;
}

#field-effects-list {
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    min-height: 50px;
}

body.dark-mode #field-effects-list {
    background: #444;
    color: #fff;
}

.effect-item {
    background: #e6fffa;
    border: 1px solid #81e6d9;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 5px 0;
    font-size: 0.9rem;
}

/* Modals */
.rift-effects-modal, .victory-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h2, .modal-content h3 {
    color: #4a5568;
    margin-bottom: 20px;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Dice roll */
.dice-roll {
    margin: 20px 0;
}

.dice-display {
    width: 140px;
    height: 140px;
    background-image: url('assets/D20/SVG/D20.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 2.2rem;
    font-weight: bold;
    color: #333;
    position: relative;
    padding-top: 8px; /* Move number up slightly */
}

.effect-options {
    margin: 20px 0;
}

.effect-option {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.effect-option:hover {
    border-color: #667eea;
    background: #edf2f7;
}

/* Responsive design */
@media (max-width: 1200px) {
    .game-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chess-board {
        width: 480px;
        height: 480px;
    }
    
    .chess-square {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .board-coordinates.bottom-coords .coord-label {
        width: 60px;
        height: 25px;
    }
    
    .board-coordinates.left-coords .coord-label {
        width: 25px;
        height: 60px;
    }
    
}

@media (max-width: 600px) {
    .chess-board {
        width: 320px;
        height: 320px;
    }
    
    .chess-square {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .board-coordinates.bottom-coords .coord-label {
        width: 40px;
        height: 20px;
    }
    
    .board-coordinates.left-coords .coord-label {
        width: 20px;
        height: 40px;
    }
    
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
}

/* Animation classes */
.piece-move {
    transition: all 0.3s ease;
}

.piece-capture {
    animation: capture-animation 0.5s ease-in-out;
}

@keyframes capture-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(0); }
}

.check-indicator {
    background-color: #ff6b6b !important;
    box-shadow: inset 0 0 20px rgba(255, 107, 107, 0.8);
}

/* Game Log and Chat Styles */
.game-log, .chat-section {
    margin: 15px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(5px);
}

.game-log h4, .chat-section h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1rem;
    text-shadow: none;
}

body.dark-mode .game-log h4, 
body.dark-mode .chat-section h4 {
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.log-content, .chat-messages {
    max-height: 150px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.log-content {
    color: #2c3e50;
}

.chat-messages {
    color: #2c3e50;
}

.log-entry, .chat-message {
    margin-bottom: 5px;
    padding: 2px 0;
}

.log-entry.system {
    color: #6b46c1;
    font-style: italic;
}

.log-entry.move {
    color: #1e40af;
}

.log-entry.effect {
    color: #f687b3;
}

.chat-message.own {
    color: #68d391;
}

.chat-message.opponent {
    color: #fbb6ce;
}

.chat-input-container {
    display: flex;
    gap: 5px;
}

.chat-input-container input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 0.9rem;
}

.chat-input-container input:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.btn.small {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-width: auto;
}

/* Piece removal animation */
@keyframes pieceRemoval {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.piece-removing {
    animation: pieceRemoval 1.5s ease-in-out forwards;
}

/* Rift effect choice buttons */
.effect-choices {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.effect-choice {
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.effect-choice:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.effect-choice.decline {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.effect-choice.accept {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

/* Dark Mode Styles */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e2e8f0;
}

body.dark-mode .game-header {
    background: rgba(0, 0, 0, 0.8);
    color: #e2e8f0;
}

body.dark-mode .game-header h1 {
    color: #f7fafc;
}

body.dark-mode .current-player, 
body.dark-mode .game-phase {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

/* Chess board styling for dark mode */
body.dark-mode .chess-board {
    background: #000000 !important;
    border: 3px solid #ffffff;
}

/* Make chess board container background black in dark mode */
body.dark-mode .chess-board-container {
    background: #000000;
    padding: 30px;
    border-radius: 20px;
}

body.dark-mode .chess-square {
    color: #333;
}

body.dark-mode .chess-square.light {
    background: #f0d9b5;
    color: #333;
}

body.dark-mode .chess-square.dark {
    background: #b58863;
    color: #333;
}

/* Ensure rift squares override dark mode square colors */
body.dark-mode .chess-square.rift {
    background: linear-gradient(45deg, #667eea, #764ba2, #4facfe, #00f2fe) !important;
    background-size: 400% 400% !important;
    animation: rift-glow 6s ease-in-out infinite !important;
}

body.dark-mode .chess-square.dark.rift {
    background: linear-gradient(45deg, #667eea, #764ba2, #4facfe, #00f2fe) !important;
    background-size: 400% 400% !important;
    animation: rift-glow 6s ease-in-out infinite !important;
}

body.dark-mode .chess-square.light.rift {
    background: linear-gradient(45deg, #667eea, #764ba2, #4facfe, #00f2fe) !important;
    background-size: 400% 400% !important;
    animation: rift-glow 6s ease-in-out infinite !important;
}

body.dark-mode .game-controls {
    background: rgba(0, 0, 0, 0.6);
    color: #e2e8f0;
}

body.dark-mode .game-controls h3 {
    color: #ffffff;
}

.setup-controls h3 {
    color: #000;
}

.setup-controls p {
    color: #000;
}

body.dark-mode .setup-controls h3 {
    color: #ffffff;
}

body.dark-mode .setup-controls p {
    color: #ffffff;
}

body.dark-mode .rift-counter {
    color: #333 !important;
}

body.dark-mode .rift-counter span {
    color: #333 !important;
}

/* Keep buttons unchanged in dark mode */
body.dark-mode .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

body.dark-mode .btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

body.dark-mode .btn.primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body.dark-mode .btn.danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

body.dark-mode .log-content, 
body.dark-mode .chat-messages {
    background: rgba(0, 0, 0, 0.4);
    color: #e2e8f0;
}

/* Fix light mode text legibility */
.log-content, 
.chat-messages {
    background: rgba(0, 0, 0, 0.1);
    color: #2c3e50;
}

.game-log h4, 
.chat-section h4 {
    color: #2c3e50;
    text-shadow: none;
}

/* Fix captured pieces text in dark mode */
body.dark-mode .captured-white span,
body.dark-mode .captured-black span {
    color: #fff !important;
}

/* Fix active field effects text in dark mode */
body.dark-mode .active-effects h4 {
    color: #e2e8f0;
}

body.dark-mode .field-effect-item {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark-mode .field-effect-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.02);
}

body.dark-mode .log-entry.system {
    color: #fbbf24;
}

body.dark-mode .log-entry.move {
    color: #60a5fa;
}

body.dark-mode .log-entry.effect {
    color: #f472b6;
}

body.dark-mode .chat-message.own {
    color: #34d399;
}

body.dark-mode .chat-message.opponent {
    color: #fbb6ce;
}

body.dark-mode .chat-input-container input {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid #4a5568;
}

body.dark-mode .chat-input-container input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: #60a5fa;
}

body.dark-mode .modal-content {
    background: rgba(0, 0, 0, 0.9);
    color: #e2e8f0;
}

body.dark-mode .effect-choice {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: #e2e8f0;
}

body.dark-mode .effect-choice.decline {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

body.dark-mode .effect-choice.accept {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

/* Multiplayer Controls */
.multiplayer-controls {
    position: fixed;
    top: 70px; /* Adjusted to account for banner height */
    left: 20px;
    z-index: 1000;
    transition: top 0.3s ease;
}

/* When banner is hidden, move multiplayer back to original position */
body:has(.beta-banner.hidden) .multiplayer-controls {
    top: 20px;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.close-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

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

body.dark-mode .close-btn:hover {
    background-color: #333;
    color: #fff;
}

/* Multiplayer Status */
.multiplayer-status {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.multiplayer-status h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.room-players-display, .room-spectators-display {
    margin-bottom: 10px;
}

.room-players-display:last-child, .room-spectators-display:last-child {
    margin-bottom: 0;
}

.room-player-item, .room-spectator-item {
    background: #e9ecef;
    border-radius: 4px;
    padding: 5px 8px;
    margin: 2px 0;
    font-size: 12px;
    color: #495057;
}

.room-player-item {
    background: #d4edda;
    color: #155724;
}

.room-spectator-item {
    background: #f8d7da;
    color: #721c24;
}

body.dark-mode .multiplayer-status {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .multiplayer-status h4 {
    color: #e2e8f0;
}

body.dark-mode .room-player-item {
    background: #2f855a;
    color: #f0fff4;
}

body.dark-mode .room-spectator-item {
    background: #c53030;
    color: #fed7d7;
}

.multiplayer-controls .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.multiplayer-controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Room Modal */
.room-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.room-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.room-inputs input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    text-transform: uppercase;
}

.room-inputs input:focus {
    outline: none;
    border-color: #667eea;
}

.room-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.players-list, .spectators-list {
    margin: 10px 0;
}

.players-list h5, .spectators-list h5 {
    margin: 5px 0;
    color: #333;
}

.player-item, .spectator-item {
    padding: 5px 10px;
    margin: 5px 0;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.coin-flip-result {
    background: #e8f4fd;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 15px 0;
}

.coin-flip-result p {
    margin: 0;
    font-weight: bold;
    color: #1e40af;
}

/* Settings Menu */
.settings-menu {
    position: fixed;
    top: 70px; /* Adjusted to account for banner height */
    right: 20px;
    z-index: 1000;
    transition: top 0.3s ease;
}

/* When banner is hidden, move settings back to original position */
body:has(.beta-banner.hidden) .settings-menu {
    top: 20px;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.settings-btn:hover .settings-icon {
    animation: settingsRotate 0.5s ease-in-out;
}

.settings-btn:not(:hover) .settings-icon {
    animation: settingsRotateReverse 0.5s ease-in-out;
}

@keyframes settingsRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(180deg); }
}

@keyframes settingsRotateReverse {
    0% { transform: rotate(180deg); }
    100% { transform: rotate(0deg); }
}

body.dark-mode .settings-btn {
    background: rgba(0, 0, 0, 0.8);
    color: #e2e8f0;
}

body.dark-mode .settings-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.settings-panel {
    position: absolute;
    top: 60px;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 20px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    display: none;
}

body.dark-mode .settings-panel {
    background: rgba(0, 0, 0, 0.9);
    color: #e2e8f0;
}

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

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: #4CAF50;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.active::after {
    transform: translateX(26px);
}

/* D20 Animation */
.dice-rolling {
    animation: diceRoll 2s ease-in-out;
}

/* D20 highlighting states */
.d20-ready-to-roll {
    filter: drop-shadow(0 0 25px rgba(0, 128, 255, 1));
    animation: d20BlueGlow 1.5s ease-in-out infinite;
}

.d20-final-result {
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 1));
    animation: d20YellowGlow 3s ease-out;
}

@keyframes diceRoll {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes d20BlueGlow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(0, 128, 255, 0.8)); }
    50% { filter: drop-shadow(0 0 40px rgba(0, 128, 255, 1)); }
}

@keyframes d20YellowGlow {
    0% { 
        filter: drop-shadow(0 0 30px rgba(255, 215, 0, 1));
        transform: scale(1.2);
    }
    50% { 
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
        transform: scale(1.1);
    }
    100% { 
        filter: drop-shadow(0 0 0px rgba(255, 215, 0, 0));
        transform: scale(1);
    }
}

.dice-display {
    font-size: 2.2rem;
    font-weight: bold;
    color: #333;
    min-width: 140px;
    min-height: 140px;
    width: 140px;
    height: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: url('assets/D20/SVG/D20.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    padding-top: 8px; /* Move number up slightly */
    transition: all 0.3s ease;
}

body.dark-mode .dice-display {
    color: #fff;
}

/* Field Effect Items */
.field-effect-item {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.field-effect-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.field-effect-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.field-effect-item.active:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.frozen-piece {
    opacity: 0.5;
    cursor: not-allowed;
}

.frozen-piece::after {
    content: '❄️';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1rem;
}

/* Sandstorm visual effect */
.sandstorm-effect {
    position: relative;
    overflow: hidden;
}

.sandstorm-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 215, 0, 0.1) 0%, 
        rgba(255, 165, 0, 0.1) 25%, 
        rgba(255, 140, 0, 0.1) 50%, 
        rgba(255, 165, 0, 0.1) 75%, 
        rgba(255, 215, 0, 0.1) 100%);
    animation: sandstorm 2s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes sandstorm {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

/* Conqueror's Tale gold aura */
.conqueror-king {
    position: relative;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    background-size: 200% 200%;
    animation: goldAura 2s ease-in-out infinite;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

/* Ensure gold aura stays gold in dark mode */
body.dark-mode .conqueror-king {
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700) !important;
    box-shadow: 0 0 25px rgba(255, 215, 0, 1) !important;
    background-size: 200% 200%;
    animation: goldAura 2s ease-in-out infinite;
    border-radius: 50%;
}

.fairy-fountain-pawn {
    position: relative;
    background: linear-gradient(45deg, #ff69b4, #ffb6c1, #ff69b4);
    background-size: 200% 200%;
    animation: pinkAura 2s ease-in-out infinite;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.8);
}

/* Ensure pink aura stays pink in dark mode */
body.dark-mode .fairy-fountain-pawn {
    background: linear-gradient(45deg, #ff69b4, #ffb6c1, #ff69b4) !important;
    box-shadow: 0 0 25px rgba(255, 105, 180, 1) !important;
    background-size: 200% 200%;
    animation: pinkAura 2s ease-in-out infinite;
    border-radius: 50%;
}

/* Ensure ALL visual effects are not affected by dark mode */
body.dark-mode .frozen-piece {
    opacity: 0.5 !important;
}

body.dark-mode .frozen-piece::after {
    filter: brightness(1) !important;
}

body.dark-mode .dragon-target {
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.8), inset 0 0 20px rgba(255, 69, 0, 0.4) !important;
    animation: dragonPulse 1s ease-in-out infinite !important;
}

body.dark-mode .archer-target {
    box-shadow: 0 0 20px rgba(0, 128, 255, 0.8), inset 0 0 20px rgba(0, 128, 255, 0.4) !important;
    animation: archerPulse 1s ease-in-out infinite !important;
}

body.dark-mode .revival-target {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8), inset 0 0 20px rgba(76, 175, 80, 0.4) !important;
    animation: revivalPulse 1s ease-in-out infinite !important;
}

body.dark-mode .portal-target {
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.9), inset 0 0 20px rgba(0, 150, 255, 0.5) !important;
    animation: portalPulse 1s ease-in-out infinite !important;
}

body.dark-mode .sandstorm-overlay {
    background: linear-gradient(135deg, rgba(194, 178, 128, 0.4) 0%, rgba(244, 164, 96, 0.3) 50%, rgba(210, 180, 140, 0.4) 100%) !important;
    mix-blend-mode: multiply !important;
}

body.dark-mode .sandstorm-overlay.active {
    opacity: 1 !important;
    animation: sandstormPulse 4s ease-in-out infinite, sandstormGrain 0.5s steps(10) infinite !important;
}

@keyframes goldAura {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pinkAura {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Dragon's Breath target highlighting */
.dragon-target {
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.8), inset 0 0 20px rgba(255, 69, 0, 0.4);
    cursor: crosshair;
    animation: dragonPulse 1s ease-in-out infinite;
}

@keyframes dragonPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 69, 0, 0.6), inset 0 0 15px rgba(255, 69, 0, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 69, 0, 1), inset 0 0 25px rgba(255, 69, 0, 0.5); }
}

/* Archer's Trick Shot target highlighting */
.archer-target {
    box-shadow: 0 0 20px rgba(0, 128, 255, 0.8), inset 0 0 20px rgba(0, 128, 255, 0.4);
    cursor: crosshair;
    animation: archerPulse 1s ease-in-out infinite;
}

@keyframes archerPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(0, 128, 255, 0.6), inset 0 0 15px rgba(0, 128, 255, 0.3); }
    50% { box-shadow: 0 0 25px rgba(0, 128, 255, 1), inset 0 0 25px rgba(0, 128, 255, 0.5); }
}

/* Sandstorm overlay effect */
.sandstorm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    background: 
        linear-gradient(135deg, rgba(194, 178, 128, 0.4) 0%, rgba(244, 164, 96, 0.3) 50%, rgba(210, 180, 140, 0.4) 100%);
    mix-blend-mode: multiply;
    transition: opacity 2s ease-in-out;
    z-index: 10;
}

.sandstorm-overlay.active {
    opacity: 1;
    animation: sandstormPulse 4s ease-in-out infinite, sandstormGrain 0.5s steps(10) infinite;
}

@keyframes sandstormPulse {
    0%, 100% { 
        opacity: 0.6;
        filter: blur(1px);
    }
    50% { 
        opacity: 0.8;
        filter: blur(2px);
    }
}

@keyframes sandstormGrain {
    0%, 100% { background-position: 0% 0%; }
    10% { background-position: -5% -10%; }
    20% { background-position: -15% 5%; }
    30% { background-position: 7% -25%; }
    40% { background-position: -5% 25%; }
    50% { background-position: -25% 10%; }
    60% { background-position: 20% 0%; }
    70% { background-position: 0% 15%; }
    80% { background-position: -10% 10%; }
    90% { background-position: 10% -10%; }
}

.sandstorm-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(210, 180, 140, 0.1) 2px,
            rgba(210, 180, 140, 0.1) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(210, 180, 140, 0.1) 2px,
            rgba(210, 180, 140, 0.1) 4px
        );
    opacity: 0.3;
    animation: sandDrift 8s linear infinite;
}

@keyframes sandDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

/* Spring of Revival target highlighting */
.revival-target {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8), inset 0 0 20px rgba(76, 175, 80, 0.4);
    cursor: pointer;
    animation: revivalPulse 1s ease-in-out infinite;
}

@keyframes revivalPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(76, 175, 80, 0.6), inset 0 0 15px rgba(76, 175, 80, 0.3); }
    50% { box-shadow: 0 0 25px rgba(76, 175, 80, 1), inset 0 0 25px rgba(76, 175, 80, 0.5); }
}

/* Portal in the Rift target highlighting */
.portal-target {
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.9), inset 0 0 20px rgba(0, 150, 255, 0.5);
    cursor: pointer;
    animation: portalPulse 1s ease-in-out infinite;
}

@keyframes portalPulse {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(0, 150, 255, 0.7), inset 0 0 15px rgba(0, 150, 255, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(0, 150, 255, 1), inset 0 0 30px rgba(0, 150, 255, 0.6);
        transform: scale(1.05);
    }
}

/* D20 Dice Roll Animation */
.dice-roll-number {
    font-size: 2.2rem;
    font-weight: bold;
    color: #333;
    min-width: 140px;
    min-height: 140px;
    width: 140px;
    height: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: url('assets/D20/SVG/D20.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    padding-top: 8px; /* Move number up slightly */
    /* Fixed size - no enlargement during animation */
}

/* Dark mode: Keep number readable on D20 */
body.dark-mode .dice-roll-number {
    color: #fff;
}

/* Left Sidebar (D20 + Multiplayer) */
.left-sidebar {
    width: 320px;
    margin-right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* D20 Roll Panel (Side Panel) */
.d20-roll-panel {
    background: #fff;
    border: 2px solid #333;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.d20-panel-header {
    background: #000;
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.d20-panel-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.d20-panel-content {
    padding: 20px;
    background: #fff;
    color: #333;
}

body.dark-mode .d20-panel-content {
    background: #444;
    color: #fff;
}

.d20-roll-section {
    text-align: center;
}

.d20-display-container {
    margin-bottom: 20px;
}

.d20-display {
    font-size: 2.2rem;
    font-weight: bold;
    color: #333;
    width: 140px;
    height: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: url('assets/D20/SVG/D20.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    padding-top: 8px;
    margin: 0 auto;
}

.roll-d20-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.roll-d20-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* D20 button glows blue when D20 is ready to roll */
.d20-roll-section:has(.d20-ready-to-roll) .roll-d20-btn:not(:disabled) {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    animation: d20ButtonGlow 2s ease-in-out infinite;
}

@keyframes d20ButtonGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    }
    50% { 
        box-shadow: 0 0 30px rgba(102, 126, 234, 1);
    }
}

.d20-result-section {
    text-align: center;
    margin-bottom: 20px;
}

.d20-result-display {
    margin-bottom: 15px;
}

.d20-result-number {
    font-size: 2.2rem;
    font-weight: bold;
    color: #333;
    width: 140px;
    height: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: url('assets/D20/SVG/D20.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    padding-top: 8px;
    margin: 0 auto;
}

.d20-result-text {
    font-size: 1.1rem;
    color: #666;
    margin-top: 10px;
}

.rift-effect-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.rift-effect-info h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1rem;
}

.rift-effect-info p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Dark mode for side panel */
body.dark-mode .d20-side-panel {
    background: #2a2a2a;
    border-color: #667eea;
}

body.dark-mode .d20-display,
body.dark-mode .d20-result-number {
    color: #fff;
    background-color: transparent;
}

body.dark-mode .d20-result-text {
    color: #ccc;
}

body.dark-mode .rift-effect-info {
    background: #3a3a3a;
    border-left-color: #667eea;
}

body.dark-mode .rift-effect-info h5 {
    color: #fff;
}

body.dark-mode .rift-effect-info p {
    color: #ccc;
}

/* D20 Options Area */
.d20-options-area {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.d20-options-area button {
    margin: 5px;
    padding: 8px 16px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.d20-options-area button.cancel-btn {
    background: #dc3545;
    color: white;
}

.d20-options-area button.cancel-btn:hover {
    background: #c82333;
}

.d20-options-area button.action-btn {
    background: #007bff;
    color: white;
}

.d20-options-area button.action-btn:hover {
    background: #0056b3;
}

.d20-options-area button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

body.dark-mode .d20-options-area {
    background: #3a3a3a;
    border-color: #555;
}

/* Multiplayer Icon Styling */
.multiplayer-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
}

#multiplayer-btn {
    font-size: 1.1rem;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding-top: 14px;
    padding-bottom: 10px;
    width: 100%;
    background: white;
    color: black;
    border: 2px solid #333;
}

body.dark-mode #multiplayer-btn {
    background: black;
    color: white;
    border: 2px solid #ccc;
}

.multiplayer-controls-sidebar {
    width: 100%;
}

/* Multiplayer icon styling - black in light mode, white in dark mode */
body.dark-mode .multiplayer-icon {
    content: url('assets/Multiplayer/SVG/Multiplayer Icon White.svg');
}

/* Rules Icon Styling */
.rules-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
}

/* Rules icon styling - black in light mode, white in dark mode */
body.dark-mode .rules-icon {
    content: url('assets/Rulebook/SVG/Rulebook White.svg');
}

/* Rules Header Icon Styling */
.rules-header-icon {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
}

.rules-modal .modal-header {
    display: flex;
    align-items: center;
}

.rules-modal .modal-header h2 {
    margin: 0;
    flex: 1;
}

/* Modal Header Icon Styling */
.modal-header-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
}

.room-modal .modal-header {
    display: flex;
    align-items: center;
}

.room-modal .modal-header h3 {
    margin: 0;
    flex: 1;
}

/* Settings Icon Styling */
.settings-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    display: block;
}

/* Settings icon switches between black and white based on mode */
body.dark-mode .settings-icon {
    content: url('assets/Settings/SVG/Settings White.svg');
}

/* Catapult Roulette hit animation */
.catapult-hit {
    animation: catapultBlink 0.4s ease-in-out 5;
}

@keyframes catapultBlink {
    0%, 100% { 
        background-color: inherit;
        box-shadow: none;
    }
    50% { 
        background-color: rgba(255, 0, 0, 0.7) !important;
        box-shadow: 0 0 30px rgba(255, 0, 0, 1), inset 0 0 30px rgba(255, 0, 0, 0.5);
    }
}

/* Clickable Setting Item */
.setting-item.clickable {
    cursor: pointer;
    padding: 10px;
    margin: -10px -10px 5px -10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.setting-item.clickable:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(3px);
}

body.dark-mode .setting-item.clickable:hover {
    background: rgba(102, 126, 234, 0.2);
}

.setting-item.clickable span {
    font-weight: 500;
    display: block;
    width: 100%;
}

/* Rules Modal */
.rules-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
    overflow-y: auto;
}

.rules-modal .modal-content {
    background: white;
    border-radius: 15px;
    width: 1000px;
    height: 700px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

body.dark-mode .rules-modal .modal-content {
    background: #1a202c;
    color: #e2e8f0;
}

.rules-modal .modal-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

body.dark-mode .rules-modal .modal-header {
    background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
}

.rules-modal .modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: white;
}

.rules-modal .modal-header .close-btn {
    background: white;
    border: none;
    color: #667eea;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.rules-modal .modal-header .close-btn:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.rules-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

/* Rules Tabs */
.rules-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    padding: 0 10px;
    border-bottom: 2px solid #e2e8f0;
}

body.dark-mode .rules-tabs {
    border-bottom-color: #2d3748;
}

.tab-btn {
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

body.dark-mode .tab-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #cbd5e0;
}

.tab-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

body.dark-mode .tab-btn:hover {
    background: #4a5568;
    border-color: #718096;
}

.tab-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    border-bottom: 2px solid white;
    margin-bottom: -2px;
}

body.dark-mode .tab-btn.active {
    background: #818cf8;
    border-color: #818cf8;
    border-bottom-color: #1a202c;
}

/* Tab Content */
.rules-tab-content {
    display: none;
}

.rules-tab-content.active {
    display: block;
}

.rules-tab-content h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

body.dark-mode .rules-tab-content h3 {
    color: #818cf8;
}

.rules-tab-content p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #333;
    text-align: left;
}

body.dark-mode .rules-tab-content p {
    color: #cbd5e0;
}

.rules-tab-content ul, .rules-tab-content ol {
    margin-bottom: 15px;
    padding-left: 20px;
    text-align: left;
}

.rules-tab-content li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #333;
    text-align: left;
}

body.dark-mode .rules-tab-content li {
    color: #cbd5e0;
}

.rules-tab-content strong {
    color: #667eea;
    font-weight: 600;
}

body.dark-mode .rules-tab-content strong {
    color: #818cf8;
}

.rules-tab-content em {
    color: #e63946;
    font-style: italic;
    font-weight: 500;
}

body.dark-mode .rules-tab-content em {
    color: #fc8181;
}

/* Rift Effects List */
.rift-effects-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.effect-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    line-height: 1.6;
    color: #333;
}

body.dark-mode .effect-item {
    background: #2d3748;
    color: #cbd5e0;
    border-left-color: #818cf8;
}

.effect-item strong {
    display: block;
    margin-bottom: 10px;
    color: #667eea;
    font-size: 1.1rem;
}

body.dark-mode .effect-item strong {
    color: #818cf8;
}

.effect-item ul {
    margin-left: 0;
    padding-left: 20px;
    text-align: left;
}

.effect-item li {
    margin-bottom: 5px;
    text-align: left;
}

.effect-item em {
    color: #e63946;
    font-style: italic;
    font-weight: 500;
}

body.dark-mode .effect-item em {
    color: #fc8181;
}

/* Rift Navigation */
.rift-nav {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

body.dark-mode .rift-nav {
    background: rgba(129, 140, 248, 0.1);
    border-left-color: #818cf8;
}

.rift-nav strong {
    color: #667eea;
    font-size: 1rem;
    margin-bottom: 10px;
    display: block;
}

body.dark-mode .rift-nav strong {
    color: #818cf8;
}

.rift-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rift-nav-link {
    display: inline-block;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 32px;
    text-align: center;
}

.rift-nav-link:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

body.dark-mode .rift-nav-link {
    background: #818cf8;
}

body.dark-mode .rift-nav-link:hover {
    background: #6366f1;
}

/* Ad Container Styling */
.ad-container {
    margin: 20px auto;
    text-align: center;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.dark-mode .ad-container {
    background: rgba(255, 255, 255, 0.05);
}

.ad-banner-top {
    margin-top: 0;
    margin-bottom: 20px;
}

.ad-sidebar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    z-index: 100;
}

.ad-mobile {
    display: none;
}

/* Hide ads on mobile to avoid cluttering gameplay */
@media (max-width: 768px) {
    .ad-sidebar {
        display: none;
    }
    
    .ad-mobile {
        display: block;
        margin: 10px auto;
        max-width: 320px;
    }
}

/* Responsive Rules Modal */
@media (max-width: 1100px) {
    .rules-modal .modal-content {
        width: 95vw;
        height: 80vh;
        max-width: 1000px;
    }
}

@media (max-width: 768px) {
    .rules-modal .modal-content {
        width: 95vw;
        height: 85vh;
    }
    
    .rules-modal .modal-header h2 {
        font-size: 1.4rem;
    }
    
    .rules-body {
        padding: 20px;
    }
    
    .rules-tabs {
        gap: 3px;
        padding: 0 5px;
    }
    
    .tab-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .rules-tab-content h3 {
        font-size: 1.2rem;
    }
    
    .effect-item {
        padding: 12px;
    }
}
