/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #eee;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

#app {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Screen Management - hide inactive screens completely */
.screen {
    display: none;
    visibility: hidden;
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
}

.screen.active {
    display: flex;
    visibility: visible;
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    height: auto;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto;
    opacity: 1;
}

/* Screen Header */
.screen-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.screen-header h2 {
    color: #e94560;
    font-size: 1.5rem;
}

/* Main Menu */
.menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 30px;
}

.logo-container {
    text-align: center;
}

.game-logo-inline {
    width: 50px;
    height: 50px;
    vertical-align: middle;
    border-radius: 50%;
    margin-right: 10px;
    filter: drop-shadow(0 0 15px rgba(233, 69, 96, 0.4));
}

.game-title {
    font-size: 3rem;
    color: #e94560;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-tagline {
    color: #aaa;
    font-size: 0.95rem;
    font-weight: 300;
    font-style: italic;
    margin-bottom: 5px;
}

.game-subtitle {
    color: #888;
    font-size: 0.9rem;
    font-weight: 300;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 350px;
}

.menu-secondary-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.menu-secondary-buttons .btn {
    font-size: 0.9rem;
    padding: 12px 16px;
}

.menu-divider {
    height: 1px;
    background: #333;
    margin: 10px 0;
}

/* Buttons */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-large {
    padding: 18px 28px;
    font-size: 1.1rem;
}

.btn-icon {
    font-size: 1.2em;
}

.btn-primary {
    background: #e94560;
    color: white;
}

.btn-primary:hover {
    background: #ff6b6b;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #16213e;
    color: #eee;
    border: 1px solid #333;
}

.btn-secondary:hover {
    background: #1f2b47;
    border-color: #e94560;
}

.btn:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
}

.btn-back {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 1rem;
    cursor: pointer;
    padding: 8px 12px;
}

.btn-back:hover {
    color: #e94560;
}

.btn-exit-game {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.3);
    color: #e94560;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-exit-game:hover {
    background: #e94560;
    color: white;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #16213e;
    color: #eee;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: #e94560;
}

/* Room List */
.room-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
}

.room-item {
    background: #16213e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.room-item:hover {
    border-color: #e94560;
    transform: translateX(4px);
}

.room-item.in-progress {
    opacity: 0.7;
}

.room-item.room-full {
    opacity: 0.5;
    cursor: not-allowed;
}

.room-item.room-full:hover {
    border-color: #333;
    transform: none;
}

.room-name {
    font-weight: 600;
    color: #eee;
    margin-bottom: 4px;
}

.room-info {
    font-size: 0.85rem;
    color: #aaa;
    font-style: italic;
}

.room-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 8px;
}

.room-status.waiting {
    background: #4ade80;
    color: #000;
}

.room-status.in-progress {
    background: #facc15;
    color: #000;
}

/* Players List */
.players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    flex: 1;
}

.player-item {
    background: #16213e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.player-item.is-host {
    border-color: #e94560;
}

.player-item.is-me {
    background: rgba(233, 69, 96, 0.1);
}

/* AI Player Styling */
.player-item.add-ai-slot {
    background: rgba(52, 152, 219, 0.1);
    border: 1px dashed #3498db;
}

.player-name.empty {
    color: #888;
    font-style: italic;
}

.btn-add-ai {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-add-ai:hover {
    background: #2980b9;
}

.btn-remove-ai {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-left: 8px;
}

.btn-remove-ai:hover {
    background: #c0392b;
}

.ai-difficulty {
    background: #9b59b6;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-name {
    font-weight: 600;
}

.host-badge {
    background: #e94560;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
}

/* Game Board */
#board-container,
#ai-board-container,
#local-board-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 10px;
    min-height: 200px;
    overflow: hidden;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    touch-action: none;
    /* Prevent touch scrolling on canvas */
}

/* Game Info */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #16213e;
    border-bottom: 1px solid #333;
    gap: 15px;
}

.scores-panel {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    min-width: 70px;
    margin-right: 5px;
}

.score-item.active-turn {
    background: rgba(233, 69, 96, 0.2);
    border: 1px solid #e94560;
}

.score-name {
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 2px;
}

.score-value {
    font-size: 1.1rem;
    font-weight: bold;
}

.turn-indicator {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e94560;
    animation: pulse 2s infinite;
}

/* Player Scores Panel (below board, like Android) */
.player-scores-panel {
    display: none;
    /* Hidden by default, shown on mobile */
    background: #16213e;
    border-radius: 8px;
    padding: 8px;
    margin: 4px 8px;
    border: 1px solid #333;
}

.player-scores-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.player-score-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.player-score-card.active-turn {
    background: rgba(233, 69, 96, 0.15);
    border-color: #e94560;
}

.player-score-card.current-player {
    background: rgba(74, 222, 128, 0.1);
}

.player-score-card.active-turn.current-player {
    background: rgba(233, 69, 96, 0.2);
    border-color: #e94560;
}

.player-score-card .turn-arrow {
    color: #e94560;
    font-weight: bold;
    margin-right: 6px;
    font-size: 0.9rem;
}

.player-score-card .player-name {
    font-weight: 600;
    color: #eee;
    font-size: 0.9rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-score-card .player-score {
    font-weight: bold;
    font-size: 1.1rem;
    color: #e94560;
    min-width: 30px;
    text-align: right;
}

.turn-indicator.thinking {
    color: #aaa;
    animation: none;
}

.turn-indicator.my-turn {
    color: #4ade80;
}

.turn-indicator.ai-turn {
    color: #e94560;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Player Hand */
.player-hand {
    background: #16213e;
    padding: 15px;
    border-top: 1px solid #333;
}

.hand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.hand-title {
    font-size: 0.9rem;
    color: #aaa;
}

.hand-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.joker-status {
    font-size: 0.8rem;
    color: #facc15;
}

.undo-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #aaa;
}

.undo-credit-icon {
    font-size: 1rem;
}

.btn-watch-ad {
    background: #333;
    border: none;
    border-radius: 4px;
    color: #eee;
    font-size: 0.7rem;
    padding: 2px 6px;
    cursor: pointer;
    margin-left: 5px;
}

.btn-watch-ad:hover {
    background: #444;
}

.hand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.hand-pins {
    display: flex;
    gap: 10px;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 5px;
}

.hand-pin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    min-width: 44px;
    /* Ensure enough width for buttons */
}

.hand-pin {
    width: 44px;
    /* Increased slightly to match Android's responsive size */
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hand-pin:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.hand-pin.selected {
    border-color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    border-width: 3px;
}

.hand-pin.red {
    background: #FF6B6B;
}

.hand-pin.green {
    background: #00FF00;
}

.hand-pin.purple {
    background: #8B00FF;
}

.hand-pin.yellow {
    background: #FFFF00;
}

.hand-pin.black {
    background: #000000;
    border-color: #555;
}

.hand-pin.joker {
    background: conic-gradient(#FF6B6B, #00FF00, #8B00FF, #FFFF00);
    border-width: 2px;
}

/* Android-style Joker Button */
.joker-btn {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid #e94560;
    color: #e94560;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    margin-top: 2px;
}

.joker-btn:hover {
    background: rgba(233, 69, 96, 0.2);
    transform: translateY(-1px);
}

.joker-btn:active {
    transform: translateY(0);
}

.btn-undo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #333;
    border: none;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    color: #aaa;
    cursor: pointer;
    font-size: 0.7rem;
    transition: background-color 0.2s, color 0.2s;
}

.btn-undo:hover:not(:disabled) {
    background: #444;
    color: white;
}

.btn-undo:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Active undo button - has credits and can undo */
.btn-undo.active {
    background: #4CAF50;
    color: white;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.btn-undo.active:hover:not(:disabled) {
    background: #45a049;
}

.undo-icon {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

/* Dialogs */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    touch-action: none;
    /* Prevent scrolling behind dialog */
}

.dialog-content {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    max-width: 90%;
    width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dialog-content h3 {
    color: #e94560;
    margin-bottom: 10px;
}

.joker-color-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 20px 0;
}

.joker-color-btn {
    padding: 16px 12px;
    /* Larger touch target */
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    touch-action: manipulation;
    /* Improve touch responsiveness */
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight on iOS */
    min-height: 50px;
    /* Ensure minimum touch target size */
}

.joker-color-btn:hover {
    transform: scale(1.05);
}

.joker-color-btn:active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Joker Color Button Colors */
.joker-color-btn.red {
    background: #FF6B6B;
    color: white;
}

.joker-color-btn.green {
    background: #00FF00;
    color: #000;
}

.joker-color-btn.purple {
    background: #8B00FF;
    color: white;
}

.joker-color-btn.yellow {
    background: #FFFF00;
    color: #000;
}

/* AI Difficulty Dialog */
.ai-difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.ai-difficulty-options .btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    text-align: center;
    min-height: auto;
}

.ai-difficulty-options .btn-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.difficulty-desc {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 4px;
    font-weight: normal;
}

/* Mobile-specific dialog improvements */
@media (max-width: 480px) {
    .dialog-content {
        width: 95%;
        max-width: none;
        padding: 20px 16px;
    }

    .joker-color-options {
        gap: 8px;
        margin: 16px 0;
    }

    .joker-color-btn {
        padding: 18px 12px;
        font-size: 1rem;
        min-height: 56px;
        /* Larger touch targets on mobile */
    }
}

/* Settings List */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px 0;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #333;
}

.setting-item label {
    color: #eee;
    font-size: 1rem;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #e94560;
}

/* AI Speed Slider */
.range-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 60%;
}

.range-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #333;
    outline: none;
    accent-color: #e94560;
}

#setting-ai-speed-value {
    font-size: 0.9rem;
    color: #aaa;
    min-width: 60px;
    text-align: right;
}

/* Leaderboard */
.leaderboard-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.leaderboard-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    margin-bottom: 10px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #aaa;
    padding: 12px;
    cursor: pointer;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #e94560;
    border-bottom-color: #e94560;
}

.leaderboard-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #16213e;
    border-radius: 8px;
    border: 1px solid #333;
}

.leaderboard-rank {
    width: 30px;
    font-weight: bold;
    color: #aaa;
}

.leaderboard-rank.top-3 {
    color: #facc15;
}

.leaderboard-name {
    flex: 1;
    font-weight: 600;
}

.leaderboard-score {
    font-weight: bold;
    color: #e94560;
}

.leaderboard-note {
    font-size: 1rem;
    color: #e94560;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: rgba(233, 69, 96, 0.1);
    border-radius: 8px;
    font-weight: 600;
}

/* Leaderboard Table Styles */
.leaderboard-header-row {
    display: flex;
    padding: 10px 12px;
    background: rgba(233, 69, 96, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: bold;
    color: #aaa;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leaderboard-row {
    display: flex;
    padding: 10px 12px;
    background: #16213e;
    border-radius: 8px;
    border: 1px solid #333;
    margin-bottom: 6px;
    align-items: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.leaderboard-row:hover {
    transform: translateX(4px);
    border-color: #444;
}

.leaderboard-row.current-user {
    background: rgba(233, 69, 96, 0.15);
    border-color: #e94560;
}

.col-rank {
    width: 35px;
    font-weight: bold;
    color: #aaa;
    flex-shrink: 0;
    text-align: center;
}

.col-rank.rank-1 {
    color: #ffd700;
    font-size: 1.1rem;
}

.col-rank.rank-2 {
    color: #c0c0c0;
    font-size: 1.05rem;
}

.col-rank.rank-3 {
    color: #cd7f32;
    font-size: 1rem;
}

.col-player {
    flex: 1;
    font-weight: 600;
    color: #eee;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    padding: 0 8px;
}

.col-score {
    width: 70px;
    text-align: right;
    font-weight: bold;
    color: #e94560;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.score-main {
    font-weight: bold;
    color: #e94560;
}

.score-best {
    font-size: 0.7rem;
    color: #aaa;
    font-weight: normal;
}

.col-games {
    width: 50px;
    text-align: right;
    color: #aaa;
    flex-shrink: 0;
}

.col-wins {
    width: 45px;
    text-align: right;
    color: #4ade80;
    flex-shrink: 0;
}

.no-data {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    font-size: 1.1rem;
}

/* Mobile leaderboard adjustments */
@media (max-width: 480px) {

    .leaderboard-header-row,
    .leaderboard-row {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .col-rank {
        width: 30px;
    }

    .col-score {
        width: 55px;
    }

    .col-games {
        width: 40px;
    }

    .col-wins {
        width: 35px;
    }

    .score-best {
        font-size: 0.6rem;
    }

    .leaderboard-note {
        font-size: 0.9rem;
        padding: 8px;
    }
}

/* Setup Section */
.setup-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setup-section {
    background: #16213e;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
}

.setup-section label {
    display: block;
    color: #aaa;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.player-count-selector {
    display: flex;
    gap: 10px;
}

.count-btn {
    flex: 1;
    padding: 10px;
    background: #1a1a2e;
    border: 1px solid #333;
    color: #aaa;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.count-btn.selected {
    background: #e94560;
    color: white;
    border-color: #e94560;
}

.player-slot,
.setup-slot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #1a1a2e;
    margin-bottom: 10px;
}

.player-slot:last-child,
.setup-slot:last-child {
    margin-bottom: 0;
}

.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #eee;
    font-size: 1.1rem;
}

.slot-label {
    font-weight: 600;
    color: #eee;
}

.slot-type {
    display: flex;
    gap: 10px;
}

.type-btn {
    padding: 8px 16px;
    font-size: 1rem;
    background: #16213e;
    border: 1px solid #333;
    color: #aaa;
    cursor: pointer;
    border-radius: 6px;
    flex: 1;
}

.type-btn.selected {
    background: #e94560;
    color: white;
    border-color: #e94560;
}

.player-name-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #16213e;
    color: #eee;
    font-size: 1rem;
}

.difficulty-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #16213e;
    color: #eee;
    font-size: 1rem;
}

.slot-type-toggle {
    display: flex;
    background: #1a1a2e;
    border-radius: 4px;
    padding: 2px;
}

.type-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    border-radius: 2px;
}

.type-btn.active {
    background: #333;
    color: white;
}

.slot-details {
    display: flex;
    gap: 10px;
}

.slot-details input,
.slot-details select {
    padding: 8px;
    background: #1a1a2e;
    border: 1px solid #333;
    color: #eee;
    border-radius: 4px;
}

.slot-details input {
    flex: 2;
}

.slot-details select {
    flex: 1;
}

/* Game Over Dialog */
.game-over-content {
    width: 90%;
    max-width: 400px;
}

.winner-display {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.winner-label {
    font-size: 0.9rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.winner-name {
    font-size: 2rem;
    color: #facc15;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

.final-scores-list {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.final-score-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: #16213e;
    border-radius: 6px;
    border: 1px solid #333;
}

.final-score-row.is-me {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

/* Score Display (Pin/Hand Score) */
.score-display {
    display: flex;
    gap: 10px;
    margin-left: 10px;
}

.score-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    min-width: 50px;
    border: 1px solid transparent;
}

.score-chip.score-positive {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.3);
}

.score-chip.score-zero {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.score-label {
    font-size: 0.65rem;
    color: #aaa;
    text-transform: uppercase;
}

.score-value {
    font-size: 1rem;
    font-weight: bold;
    color: #eee;
}

.score-positive .score-value {
    color: #4ade80;
}

.score-zero .score-value {
    color: #aaa;
}

/* AI Difficulty Screen */
.difficulty-intro {
    text-align: center;
    color: #aaa;
    margin-bottom: 20px;
}

.difficulty-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-difficulty {
    display: grid;
    grid-template-columns: 50px 1fr;
    grid-template-rows: auto auto;
    text-align: left;
    padding: 15px;
    background: #16213e;
    border: 1px solid #333;
    align-items: center;
}

.btn-difficulty:hover:not(.locked) {
    border-color: #e94560;
    transform: translateX(5px);
}

.difficulty-icon {
    font-size: 2rem;
    grid-row: 1 / 3;
}

.difficulty-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #eee;
}

.difficulty-desc {
    font-size: 0.85rem;
    color: #aaa;
}

.btn-difficulty.locked {
    opacity: 0.6;
    cursor: default;
}

.difficulty-note {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 20px;
    font-style: italic;
}

/* Pass and Play Screen */
.pass-play-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    gap: 30px;
}

.pass-play-player {
    font-size: 2.5rem;
    font-weight: bold;
    color: #e94560;
    margin: 20px 0;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

/* Landing Page Styles */
.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    min-height: 100vh;
    padding: 20px 0;
}

.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
}

.landing-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(233, 69, 96, 0.4));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.landing-title {
    font-size: 4rem;
    color: #e94560;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(233, 69, 96, 0.3);
}

.landing-tagline {
    font-size: 1.5rem;
    color: #eee;
    margin-bottom: 20px;
    font-weight: 300;
}

.landing-description {
    color: #aaa;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 30px;
}

.btn-play {
    font-size: 1.3rem;
    padding: 20px 40px;
    box-shadow: 0 10px 25px rgba(233, 69, 96, 0.4);
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    margin-bottom: 30px;
}

.feature-card {
    background: rgba(22, 33, 62, 0.5);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(22, 33, 62, 0.8);
    border-color: rgba(233, 69, 96, 0.3);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.feature-card h3 {
    color: #eee;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.feature-card p {
    color: #aaa;
    line-height: 1.5;
}

.landing-footer {
    display: flex;
    gap: 20px;
    color: #666;
    margin-top: 20px;
    font-size: 0.9rem;
}

.landing-footer a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.landing-footer a:hover {
    color: #e94560;
}

/* Play Store Badge in Feature Card */
.feature-card.app-promo {
    border-color: rgba(233, 69, 96, 0.3);
}

.btn-playstore {
    display: inline-block;
    margin-top: 10px;
    transition: transform 0.2s ease;
}

.btn-playstore:hover {
    transform: scale(1.05);
}

.playstore-badge {
    height: 40px;
    width: auto;
}

/* About, Contact, Guide Pages */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.page-title {
    color: #e94560;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.content-section {
    background: #16213e;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #333;
}

.content-section h2 {
    color: #eee;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.content-section p {
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 15px;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 40px;
    color: #e94560;
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

/* Guide specific styles */
.rule-block {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-block:last-child {
    border-bottom: none;
}

.rule-block h3 {
    color: #facc15;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.pattern-example {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

/* How to Play Styles */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.rules-content,
.tips-content {
    max-width: 600px;
    margin: 0 auto;
}

.tutorial-section-selector {
    margin-bottom: 20px;
    background: #16213e;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
}

.tutorial-section-selector select {
    width: 100%;
    padding: 10px;
    background: #1a1a2e;
    border: 1px solid #555;
    color: #eee;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 5px;
}

.tutorial-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tutorial-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tutorial-section h3 {
    color: #e94560;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.section-description {
    color: #aaa;
    font-style: italic;
    margin-bottom: 25px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}

.tutorial-section h4 {
    color: #facc15;
    font-size: 1.2rem;
    margin: 20px 0 10px;
}

.tutorial-section p,
.tutorial-section li {
    line-height: 1.6;
    color: #ddd;
    margin-bottom: 10px;
}

.tutorial-section ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.tutorial-diagram {
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    display: block;
    border-radius: 8px;
    border: 2px solid #333;
}

.tutorial-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

/* Banner Ad Styles */
/* Fixed height to prevent layout shifts and ensure visibility */
.banner-ad-wrapper {
    width: 100%;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
    background: #1a1a2e;
    border-top: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 0;
    margin-top: auto;
    overflow: hidden;
    flex-shrink: 0;
}

.ad-placeholder {
    width: 100%;
    height: 50px;
    background: #16213e;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #555;
    font-size: 0.8rem;
    border: 1px dashed #333;
}



/* Media Queries */
@media (max-width: 480px) {
    .game-title {
        font-size: 2.5rem;
    }

    .btn-large {
        padding: 16px 24px;
        font-size: 1rem;
    }

    .screen-header h2 {
        font-size: 1.2rem;
    }

    .hand-pin {
        width: 35px;
        height: 35px;
    }
}


/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Mobile-first game screen layout */
@media (max-width: 768px) {

    /* Prevent zoom on mobile */
    html {
        touch-action: manipulation;
    }

    /* App container - full width on mobile */
    #app {
        max-width: 100%;
        padding: 0;
    }

    /* Game screen - vertical stack layout */
    /* Reserve space for bottom banner ad to prevent "invisible ad" violations */
    #screen-game,
    #screen-local-game,
    #screen-ai-game {
        height: calc(100vh - 60px);
        height: calc(100dvh - 60px);
        /* Reserve 60px for banner ad at bottom */
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Compact game header on mobile - hide header scores, show panel below board */
    /* Add defensive padding to prevent accidental clicks on Auto Ads */
    .game-header {
        padding: 12px 10px;
        gap: 8px;
        flex-shrink: 0;
        flex-wrap: wrap;
    }

    /* Hide header scores on mobile - use panel below board instead */
    .game-header .scores-panel {
        display: none;
    }

    /* Show player scores panel below board on mobile */
    .player-scores-panel {
        display: block;
    }

    .scores-panel {
        gap: 8px;
        flex-wrap: wrap;
        flex: 1;
        min-width: 0;
    }

    .score-item {
        padding: 4px 8px;
        min-width: 55px;
        margin-right: 3px;
    }

    .score-name {
        font-size: 0.65rem;
    }

    .score-value {
        font-size: 0.95rem;
    }

    .turn-indicator {
        font-size: 0.8rem;
    }

    .btn-exit-game {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    /* Board container - takes remaining space, reduce padding */
    #board-container,
    #ai-board-container,
    #local-board-container {
        flex: 1;
        min-height: 0;
        /* Important for flex shrinking */
        padding: 2px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Canvas - responsive sizing */
    canvas {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    /* Player hand - fixed at bottom, reduced top padding */
    .player-hand {
        padding: 8px 10px;
        flex-shrink: 0;
    }

    .hand-header {
        margin-bottom: 6px;
    }

    .hand-title {
        font-size: 0.85rem;
    }

    .joker-status {
        font-size: 0.75rem;
    }

    /* Larger pins on mobile for better touch targets */
    .hand-pins {
        gap: 10px;
        justify-content: center;
    }

    .hand-pin {
        width: 52px;
        height: 52px;
        font-size: 1rem;
    }

    .hand-pin-container {
        min-width: 52px;
    }

    .joker-btn {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    /* Larger undo button */
    .btn-undo {
        width: 56px;
        height: 56px;
        font-size: 0.7rem;
    }

    .undo-icon {
        font-size: 1.1rem;
    }

    /* Larger watch ad button on mobile */
    .btn-watch-ad {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    /* Score display chips */
    .score-display {
        gap: 6px;
        margin-left: 5px;
    }

    .score-chip {
        padding: 2px 6px;
        min-width: 40px;
    }

    .score-label {
        font-size: 0.55rem;
    }

    .score-chip .score-value {
        font-size: 0.85rem;
    }
}

/* Extra small screens (phones in portrait) - Enhanced mobile styles */
@media (max-width: 480px) {
    .rule-step {
        padding: 18px !important;
        background: rgba(74, 222, 128, 0.25) !important;
        border: 2px solid rgba(74, 222, 128, 0.5) !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 8px rgba(74, 222, 128, 0.2) !important;
    }
    
    .feature-item {
        padding: 18px !important;
        background: rgba(59, 130, 246, 0.25) !important;
        border: 2px solid rgba(59, 130, 246, 0.5) !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2) !important;
    }
    
    .step-number {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.1rem !important;
        background: #4ade80 !important;
        color: #000 !important;
        border: 2px solid #fff !important;
        box-shadow: 0 4px 8px rgba(74, 222, 128, 0.6) !important;
    }
    
    .feature-emoji {
        font-size: 1.8em !important;
        filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.4)) !important;
    }
    
    .quick-rules {
        background: rgba(74, 222, 128, 0.2) !important;
        border: 3px solid rgba(74, 222, 128, 0.5) !important;
        box-shadow: 0 6px 12px rgba(74, 222, 128, 0.2) !important;
    }
    
    .game-features {
        background: rgba(59, 130, 246, 0.2) !important;
        border: 3px solid rgba(59, 130, 246, 0.5) !important;
        box-shadow: 0 6px 12px rgba(59, 130, 246, 0.2) !important;
        margin-top: 50px !important;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {

    #screen-game,
    #screen-local-game,
    #screen-ai-game {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .game-header {
        width: 100%;
        padding: 5px 10px;
    }

    #board-container,
    #ai-board-container,
    #local-board-container {
        flex: 1;
        height: calc(100vh - 100px);
        height: calc(100dvh - 100px);
    }

    .player-hand {
        width: 100%;
        padding: 8px;
    }

    .hand-row {
        justify-content: center;
    }

    canvas {
        max-height: calc(100vh - 120px);
        max-height: calc(100dvh - 120px);
    }
}

/* Tablet and desktop - larger screens */
@media (min-width: 769px) {

    #board-container,
    #ai-board-container,
    #local-board-container {
        max-height: 65vh;
    }

    canvas {
        max-height: 60vh;
    }
}


/* ========================================
   Score Display Panel (Pin/Hand/Total Scores)
   ======================================== */

/* Make player scores panel visible */
.player-scores-panel {
    display: block !important;
    background: #16213e;
    border-radius: 8px;
    padding: 10px;
    margin: 8px;
    border: 1px solid #333;
}

/* Current scores row (pin score + hand score) */
.current-scores {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.pin-score {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4ade80;
    padding: 4px 10px;
    background: rgba(74, 222, 128, 0.15);
    border-radius: 4px;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.hand-score {
    font-size: 0.9rem;
    font-weight: 600;
    color: #facc15;
    padding: 4px 10px;
    background: rgba(250, 204, 21, 0.15);
    border-radius: 4px;
    border: 1px solid rgba(250, 204, 21, 0.3);
}

/* Player scores grid - supports 2-4 players */
.player-scores-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* For 3 players, last card spans full width */
.player-scores-grid.three-players .player-score-card:last-child {
    grid-column: 1 / -1;
    max-width: 50%;
    margin: 0 auto;
}

/* Player score card */
.player-score-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.player-score-card.active-turn {
    background: rgba(233, 69, 96, 0.15);
    border-color: #e94560;
}

.player-score-card.current-player {
    background: rgba(74, 222, 128, 0.1);
}

.player-score-card.active-turn.current-player {
    background: rgba(233, 69, 96, 0.2);
    border-color: #e94560;
}

.player-score-card .turn-arrow {
    color: #e94560;
    font-weight: bold;
    margin-right: 6px;
    font-size: 0.9rem;
    animation: pulse 1.5s infinite;
}

.player-score-card .player-name {
    font-weight: 600;
    color: #eee;
    font-size: 0.9rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-score-card .player-score {
    font-weight: bold;
    font-size: 1.2rem;
    color: #e94560;
    min-width: 35px;
    text-align: right;
}

/* Joker indicators on player cards */
.player-jokers {
    display: flex;
    gap: 4px;
    margin-left: 10px;
    align-items: center;
}

.joker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #444;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.joker-dot.available {
    background: #4ade80;
    box-shadow: 0 0 5px rgba(74, 222, 128, 0.4);
}

.joker-dot.used {
    background: #444;
    opacity: 0.5;
}

/* Mobile adjustments for score panel */
@media (max-width: 480px) {
    .player-scores-panel {
        padding: 8px;
        margin: 4px;
    }

    .current-scores {
        gap: 10px;
        padding: 6px;
        margin-bottom: 8px;
    }

    .pin-score,
    .hand-score {
        font-size: 0.8rem;
        padding: 3px 8px;
    }

    .player-scores-grid {
        gap: 6px;
    }

    .player-score-card {
        padding: 8px 10px;
    }

    .player-score-card .player-name {
        font-size: 0.85rem;
    }

    .player-score-card .player-score {
        font-size: 1.1rem;
    }
}

/* Version Display */
.version-display {
    font-size: 0.75rem;
    color: #666;
    font-weight: 300;
}

.landing-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 20px;
    flex-wrap: wrap;
}

.menu-footer {
    margin-top: 20px;
    text-align: center;
}

/* --- Ad Buttons & Locking --- */

.btn-watch-ad {
    margin-left: 8px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #e94560, #a91d3a);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-watch-ad:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(233, 69, 96, 0.3);
    filter: brightness(1.1);
}

.btn-watch-ad:active {
    transform: translateY(0);
}

.undo-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.difficulty-select option[data-locked="true"] {
    color: #666;
    background: #1a1a2e;
}

.difficulty-note {
    font-size: 0.8rem;
    color: #e94560;
    margin-top: 5px;
    opacity: 0.8;
}

/* H5 Ad Break Overlay styles (AdSense handles this mostly, but we can style our triggers) */
.h5-ad-triggering {
    pointer-events: none;
    opacity: 0.7;
}

.lock-icon {
    font-size: 0.9rem;
    margin-left: 5px;
    vertical-align: middle;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.difficulty-note {
    font-size: 0.8rem;
    color: #e94560;
    margin-top: 5px;
    opacity: 0.8;
}
/* Compact Game Highlights */
.game-highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(233, 69, 96, 0.2);
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #eee;
    font-size: 0.95rem;
    white-space: nowrap;
}

.highlight-icon {
    font-size: 1.2em;
    filter: drop-shadow(0 0 5px rgba(233, 69, 96, 0.3));
}

@media (max-width: 768px) {
    .game-highlights {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px;
        margin: 20px 0;
    }
    
    .highlight-item {
        font-size: 0.9rem;
    }
}

/* Landing page feature cards enhancement */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.2);
}

/* Privacy settings button enhancement */
.btn-secondary:focus {
    outline: 2px solid #e94560;
    outline-offset: 2px;
}

/* Content Sections Layout - Side by Side on Desktop */
.content-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 40px 0;
}

/* Feature Rows Layout - 2x2 Grid on Desktop */
.landing-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    margin-bottom: 30px;
}

.feature-row {
    display: contents; /* This makes the children participate in the parent grid */
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .content-sections {
        grid-template-columns: 1fr;
        gap: 30px;
        margin: 30px 0;
    }
    
    .landing-features {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Add clear separation between sections on mobile */
    .game-features {
        margin-top: 40px !important;
        border-top: 2px solid rgba(59, 130, 246, 0.3) !important;
        padding-top: 30px !important;
    }
}
/* Screenshots Section Styles */
.screenshots-section {
    margin: 40px 0;
    text-align: center;
}

.screenshots-section h3 {
    color: #e94560;
    font-size: 1.8rem;
    margin-bottom: 25px;
}

.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.screenshot-placeholder {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(233, 69, 96, 0.3);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.screenshot-placeholder:hover {
    border-color: rgba(233, 69, 96, 0.6);
    background: rgba(233, 69, 96, 0.1);
    transform: translateY(-5px);
}

.screenshot-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(233, 69, 96, 0.3));
}

.screenshot-placeholder h4 {
    color: #4ade80;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.screenshot-placeholder p {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .screenshot-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .screenshot-placeholder {
        padding: 25px 15px;
        min-height: 150px;
    }
    
    .screenshot-icon {
        font-size: 2.5rem;
    }
}
/* Quick Rules Summary Styles */
.rules-summary {
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.rules-summary h3 {
    color: #4ade80;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 30px;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: rgba(74, 222, 128, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(74, 222, 128, 0.1);
    transition: all 0.3s ease;
}

.rule-item:hover {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.3);
    transform: translateY(-2px);
}

.rule-number {
    background: #4ade80;
    color: #000;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.rule-content h4 {
    color: #4ade80;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.rule-content p {
    color: #ddd;
    font-size: 0.95rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .rules-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .rule-item {
        padding: 15px;
    }
    
    .rules-summary {
        padding: 20px;
        margin: 30px 0;
    }
}
/* Compact Game Highlights */
.game-highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(233, 69, 96, 0.2);
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #eee;
    font-size: 0.95rem;
    white-space: nowrap;
}

.highlight-icon {
    font-size: 1.2em;
    filter: drop-shadow(0 0 5px rgba(233, 69, 96, 0.3));
}

@media (max-width: 768px) {
    .game-highlights {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px;
        margin: 20px 0;
    }
    
    .highlight-item {
        font-size: 0.9rem;
    }
}
/* Quick Rules Section */
.quick-rules {
    margin: 30px 0;
    padding: 25px;
    background: rgba(74, 222, 128, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(74, 222, 128, 0.2);
    text-align: center;
}

.quick-rules h3 {
    color: #4ade80;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.rules-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.rule-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(74, 222, 128, 0.1);
    border-radius: 8px;
    text-align: left;
    border: 1px solid rgba(74, 222, 128, 0.15);
}

.step-number {
    background: #4ade80;
    color: #000;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(74, 222, 128, 0.3);
}

.step-text {
    color: #eee;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Game Features Section */
.game-features {
    margin: 30px 0;
    padding: 25px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    text-align: center;
}

.game-features h3 {
    color: #3b82f6;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    text-align: left;
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.feature-item:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.3);
}

.feature-emoji {
    font-size: 1.3em;
    flex-shrink: 0;
}

.feature-item span:last-child {
    color: #eee;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rules-steps {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .rule-step {
        padding: 15px !important;
        background: rgba(74, 222, 128, 0.2) !important;
        border: 2px solid rgba(74, 222, 128, 0.4) !important;
        min-height: 60px;
        align-items: flex-start;
    }
    
    .feature-item {
        padding: 15px !important;
        background: rgba(59, 130, 246, 0.2) !important;
        border: 2px solid rgba(59, 130, 246, 0.4) !important;
        min-height: 60px;
        align-items: flex-start;
    }
    
    .step-number {
        background: #4ade80 !important;
        color: #000 !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
        font-weight: bold !important;
        box-shadow: 0 3px 6px rgba(74, 222, 128, 0.5) !important;
        flex-shrink: 0 !important;
        margin-top: 2px;
    }
    
    .step-text {
        color: #fff !important;
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        font-weight: 500 !important;
    }
    
    .feature-emoji {
        font-size: 1.5em !important;
        flex-shrink: 0 !important;
        margin-top: 2px;
    }
    
    .feature-item span:last-child {
        color: #fff !important;
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        font-weight: 500 !important;
    }
    
    .quick-rules {
        padding: 25px !important;
        margin: 25px 0 !important;
        background: rgba(74, 222, 128, 0.15) !important;
        border: 2px solid rgba(74, 222, 128, 0.4) !important;
        border-radius: 15px !important;
    }
    
    .game-features {
        padding: 25px !important;
        margin: 40px 0 25px 0 !important;
        background: rgba(59, 130, 246, 0.15) !important;
        border: 2px solid rgba(59, 130, 246, 0.4) !important;
        border-radius: 15px !important;
        border-top: 3px solid rgba(59, 130, 246, 0.6) !important;
        padding-top: 30px !important;
    }
    
    .quick-rules h3 {
        font-size: 1.4rem !important;
        color: #4ade80 !important;
        text-shadow: 0 2px 4px rgba(74, 222, 128, 0.3) !important;
    }
    
    .game-features h3 {
        font-size: 1.4rem !important;
        color: #3b82f6 !important;
        text-shadow: 0 2px 4px rgba(59, 130, 246, 0.3) !important;
    }
}