/* Global Page Reset & Box Sizing */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrollbars globally */
    box-sizing: border-box;
    scroll-behavior: smooth; /* Added for smooth scrolling on anchor links */
}

*, *::before, *::after {
    box-sizing: inherit; /* All elements inherit box-sizing from html/body */
}

body {
    font-family: Arial, sans-serif;
    background-color: #166534; /* User specified page background */
    display: flex;
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center children horizontally */
    justify-content: flex-start; /* Align content to the top */
    min-height: 100vh;
    padding-top: 10px; /* Reduced top padding to accommodate logo */
}

/* Logo styles */
#logo-container {
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
}

#site-logo {
    max-width: 100px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Top Bar Styles from Solitaire */
#page-top-bar {
    background: linear-gradient(to bottom, rgba(22, 101, 52, 0.85), rgba(20, 80, 45, 0.95));
    padding: 10px 25px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    border-bottom: 2px solid rgba(10, 60, 30, 0.9);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#page-menu a {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Cleaner font for menu */
    color: #FFD700; /* Brighter Gold/Yellow color */
    text-decoration: none;
    margin: 0 10px; /* More margin */
    font-size: 0.95em; /* Slightly larger font */
    padding: 5px 8px; /* Add padding to make them more like buttons */
    border-radius: 4px; /* Rounded corners for button feel */
    transition: background-color 0.2s ease, color 0.2s ease;
}

#page-menu a:hover {
    text-decoration: none; /* Remove underline on hover for button feel */
    background-color: rgba(255, 215, 0, 0.15); /* Light gold highlight on hover */
    color: #fff;
}

#page-menu a#back-to-games-link {
    background-color: rgba(255, 255, 255, 0.05); /* Slightly different background */
    padding: 5px 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

#page-menu a#back-to-games-link:hover {
    background-color: rgba(255, 215, 0, 0.25);
    border-color: rgba(255, 215, 0, 0.6);
}

#page-menu a.disabled-look,
#page-menu a.disabled { /* Group with existing disabled style */
    color: #777 !important; /* Grey out disabled link, ensure override */
    pointer-events: none; /* Prevent clicks */
    text-decoration: none;
    background-color: transparent !important; /* Ensure no hover background persists */
}

/* Scorecard game info styles */
#scorecard-game-info {
    margin-top: 15px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.scorecard-info-item {
    margin-bottom: 5px;
    font-size: 0.85em;
    color: #ffffff;
    text-align: center;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

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

.button-style {
    color: #FFD700; /* Match menu link color */
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.08);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.button-style:hover {
    background-color: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
    color: #fff;
}

.button-style.disabled {
    color: #777 !important; /* Ensure disabled color overrides */
    background-color: rgba(100, 100, 100, 0.1) !important;
    border-color: rgba(120, 120, 120, 0.3) !important;
    pointer-events: none;
    text-decoration: none;
}

/* Game Board Styles */
#game-board-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

#game-board {
    background-color: #15803d;
    border: 1px solid #103F2E;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 650px;
    margin: 30px auto 20px auto; /* Match Solitaire's spacing */
    min-height: 70vh; /* Match front page height */
    position: relative;
    padding: 50px 22px 20px 22px; /* Match Solitaire's padding with extra top space */
}

/* --- MULTIPLAYER BOARD LAYOUT --- */
.multiplayer-board {
    display: grid;
    grid-template-columns: 1fr 215px;
    grid-template-rows: auto 1fr auto; /* Opponent, play area, current player */
    grid-template-areas:
        "opponent scorecard"
        "play-area scorecard"
        "current-player scorecard";
    gap: 10px;
}

/* Player Styles */
.player {
    display: flex;
    align-items: center;
    padding: 8px; /* Reduced padding */
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Current player highlighting */
.player.current-player {
    background-color: rgba(255, 215, 0, 0.2); /* Gold background */
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.5);
    animation: current-player-pulse 2s infinite;
}

@keyframes current-player-pulse {
    0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.7); }
    100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
}

/* Opponent area */
.opponent {
    grid-area: opponent;
    justify-content: center;
    position: relative;
    padding: 0;
    margin: 0;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 60px;
}

/* Current player area */
#player1 {
    grid-area: current-player;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: -5px; /* Move player closer to play area */
}

/* Space for dice in play area - positioned at bottom */
#play-area {
    grid-area: play-area;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribute content with space between */
    align-items: center;
    background-color: transparent;
    border-radius: 8px;
    padding: 5px 10px 0 10px; /* Remove bottom padding */
    min-height: 180px; /* Reduced height */
}

/* Move controls closer to dice */
#game-controls {
    margin-top: 5px;
}

/* Create empty space for the opponent's dice area in HTML */
/* Add space for potential opponent dice */
#opponent-area-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

/* Regular player avatar (circular) */
.player-avatar {
    width: 50px; /* Reduced size */
    height: 50px; /* Reduced size */
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #FFD700;
    overflow: hidden;
    position: relative;
}

/* Default avatar image styling */
.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* Opponent avatar */
.opponent .player-avatar {
    width: auto;
    height: 70px; /* Increased from 50px */
    margin: 0;
    border-radius: 0;
    border: none;
    overflow: visible;
    background-color: transparent;
}

.opponent .avatar-image {
    width: auto;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.player-name {
    font-size: 1em; /* Smaller font */
    font-weight: bold;
    color: white;
}

.player-status {
    font-size: 0.8em;
    color: #f0f0f0;
    margin-left: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

#notification-banner {
    background-color: #feffbe;
    color: #333;
    padding: 8px 15px;
    border-radius: 6px;
    margin-bottom: 5px; /* Reduced margin */
    text-align: center;
    font-weight: bold;
    width: 100%;
    max-width: 500px;
    font-size: 0.95em;
}

/* Dice area (board) */
#dice-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    flex-wrap: wrap;
    margin: 0 auto; /* Remove vertical margins to position closer to player */
    padding: 10px;
    background-color: transparent; /* Changed from rgba(0, 100, 0, 0.1) to match game board */
    border-radius: 10px;
    border: none; /* Remove dashed border */
    position: relative;
}

/* Dice container */
.dice-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* Reduced from 12px */
    flex-wrap: nowrap;
    width: 100%;
    height: 100%;
    position: relative;
    padding: 8px; /* Reduced padding */
}

/* Dice styling */
.die {
    width: 48px; /* Slightly smaller dice */
    height: 48px;
    background-color: white;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.2s ease;
    position: relative;
    z-index: 1;
}

.die:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.die.held {
    background-color: #ffeb99; /* Light yellow for held dice */
    border-color: #b8860b; /* DarkGoldenrod */
    box-shadow: 0 0 12px #ffd700; /* Gold glow */
}

/* Remove complex animations, handled in JavaScript instead */
@keyframes throwDice {
    0% {
        transform: translateY(100px);
        opacity: 0.5;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes returnDice {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0.8;
    }
}

/* Player's dice area - keep the dotted lines only for the player and opponent dice areas */
#player-dice-area {
    grid-area: current-player; /* This implies its part of .multiplayer-board grid */
    width: 100%;
    min-height: 70px; /* It has a minimum height */
    display: flex;
    align-items: center;
    justify-content: center; /* Changed back from space-around to center */
    position: relative; /* Important for absolute positioning of children if that was used */
    background-color: rgba(0, 100, 0, 0.2);
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

/* Add opponent dice area */
#opponent-dice-area {
    width: 90%;
    height: 60px;
    margin: 5px auto 10px auto; /* Adjusted margin to maintain spacing with larger Ingrid */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 100, 0, 0.2);
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    position: relative;
}

/* Dice directly in player area (held dice) */
#player-dice-area > .die {
    margin: 0 4px; /* Reduced from 5px */
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6); /* Subtle gold glow */
}

/* Stronger held styling for dice in player area */
#player-dice-area .die.held {
    background-color: #ffeb99; /* Light yellow */
    border-color: #b8860b; /* DarkGoldenrod */
    transform: scale(1.05); /* Slightly larger */
}

/* Player name styling for current player */
#player1 .player-name {
    font-size: 1.1em;
    margin-bottom: 3px;
    font-weight: bold;
    color: white;
}

/* Dice Dots Styles */
.dot-container {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 4px; /* Reduced padding */
}

.dot {
    width: 8px; /* Smaller dots */
    height: 8px; /* Smaller dots */
    background-color: #d21f3c; /* Red color for the dots */
    border-radius: 50%;
    margin: auto;
    box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.5);
}

.top-left { grid-area: 1 / 1; }
.top-center { grid-area: 1 / 2; }
.top-right { grid-area: 1 / 3; }
.middle-left { grid-area: 2 / 1; }
.center-dot { grid-area: 2 / 2; }
.middle-right { grid-area: 2 / 3; }
.bottom-left { grid-area: 3 / 1; }
.bottom-center { grid-area: 3 / 2; }
.bottom-right { grid-area: 3 / 3; }

/* Game Controls */
#game-controls {
    display: flex;
    gap: 8px; /* Reduced gap */
    margin-top: 5px;
}

.game-button {
    background-color: #f0f0f0;
    border: none;
    border-radius: 6px;
    padding: 6px 14px; /* Reduced padding */
    font-size: 0.95em; /* Smaller font */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-button:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

/* Change player button specific styling */
#change-player-button {
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    margin-left: 20px;
}

/* Roll button specific styling */
#roll-button {
    background-color: #f0f0f0;
    color: #333;
    font-weight: bold;
}

/* Score button specific styling */
#score-button-game {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
}

#score-button-game:disabled {
    background-color: #a5d6a7;
    color: #e0e0e0;
    cursor: not-allowed;
}

#score-button-game:hover:not(:disabled) {
    background-color: #3e8e41;
}

/* Score Card Styles */
#scorecard {
    grid-area: scorecard;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    max-height: 100%;
    font-size: 0.95em; /* Increased font size */
}

#scorecard table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #333;
}

#scorecard th, 
#scorecard td {
    padding: 4px 5px; /* Increased padding slightly */
    text-align: center;
    border: 1px solid #333;
    font-size: 0.9em; /* Increased font size */
}

#scorecard th {
    background-color: #333;
    color: white;
    font-weight: bold;
    padding: 5px; /* Slightly more padding for headers */
}

#scorecard td:first-child {
    text-align: left;
    font-weight: bold;
    font-size: 0.92em; /* Slightly larger font for category names */
    padding-left: 6px;
    padding-right: 3px;
}

/* Active Player Column Highlighting */
#scorecard th[data-player="player1"],
#scorecard td[data-player="player1"] {
    background-color: rgba(0, 0, 255, 0.05);
}

#scorecard th[data-player="player2"],
#scorecard td[data-player="player2"] {
    background-color: rgba(255, 0, 0, 0.05);
}

/* Current Player Column */
#scorecard[data-current-turn="player1"] th[data-player="player1"],
#scorecard[data-current-turn="player1"] .score-cell[data-player="player1"]:not(.scored) {
    background-color: rgba(0, 0, 255, 0.15);
    box-shadow: inset 0 0 5px rgba(0, 0, 255, 0.2);
    cursor: pointer;
}

#scorecard[data-current-turn="player2"] th[data-player="player2"],
#scorecard[data-current-turn="player2"] .score-cell[data-player="player2"]:not(.scored) {
    background-color: rgba(255, 0, 0, 0.15);
    box-shadow: inset 0 0 5px rgba(255, 0, 0, 0.2);
}

/* AI Player Cells - not interactive */
.score-cell[data-player="player2"]:not(.scored) {
    cursor: not-allowed;
    position: relative;
}

.score-cell[data-player="player2"]:not(.scored)::after {
    content: "AI";
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 8px;
    color: rgba(255, 0, 0, 0.5);
    pointer-events: none;
}

.score-row:hover {
    background-color: rgba(255, 215, 0, 0.1);
}

.score-row.scored {
    background-color: rgba(0, 100, 0, 0.1);
}

.score-row.selected {
    background-color: rgba(0, 100, 255, 0.1);
}

/* Score Cell Styles */
.score-cell {
    text-align: center;
    padding: 6px 5px; /* Increased padding */
    transition: background-color 0.2s ease;
    color: #000000;
    font-weight: normal;
}

.score-cell.available {
    background-color: rgba(255, 215, 0, 0.15);
    cursor: pointer;
    color: #FF0000; /* Red color for available scores */
    font-weight: normal; /* Remove bold for available scores */
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.score-cell.highlighted {
    background-color: rgba(255, 215, 0, 0.4);
    color: #FF0000; /* Red color for highlighted */
    font-weight: normal; /* Remove bold for highlighted */
    animation: pulse 1s infinite;
    border: 1px solid rgba(255, 215, 0, 0.6);
}

.score-cell.scored {
    background-color: rgba(0, 128, 0, 0.2); /* Lighter green to improve readability */
    color: #000000; 
    font-weight: bold;
}

.score-cell.unavailable-zero {
    background-color: rgba(128, 128, 128, 0.1); /* Light gray background */
    color: #888888; /* Gray text */
    cursor: not-allowed;
    font-style: italic;
}

.score-cell.zero-score-only {
    background-color: rgba(255, 165, 0, 0.15); /* Orange background for forced zero */
    border: 1px solid rgba(255, 165, 0, 0.3);
    color: #FF4500; /* Orange-red color */
    font-weight: normal;
}

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

.sum-row, .bonus-row, .total-row {
    background-color: #e0e0e0;
    font-weight: bold;
}

.total-row {
    background-color: #d0d0d0;
    font-size: 1.05em; /* Slightly larger font for total score */
}

/* Pause Overlay Styles */
#pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    border-radius: 12px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    pointer-events: none;
}

#pause-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

#pause-overlay h2 {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 20px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

#resume-button-overlay {
    padding: 8px 18px;
    font-size: 1em;
    color: white;
    background-color: #4CAF50;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.2s ease;
}

#resume-button-overlay:hover {
    background-color: #45a049;
}

/* Confirmation Modal Styles */
#confirmation-modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#confirmation-modal.modal-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: #fefefe;
    padding: 25px 35px;
    border: 1px solid #888;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    width: auto;
    max-width: 400px;
    min-width: 280px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#confirmation-modal.modal-visible .modal-content {
    transform: scale(1);
}

#modal-message {
    font-size: 1.1em;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-buttons button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    margin: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

.modal-buttons button:hover {
    background-color: #45a049;
}

.modal-buttons button#modal-cancel-button {
    background-color: #f44336;
}

.modal-buttons button#modal-cancel-button:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.win-modal-button {
    display: none;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    color: white;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin: 5px 10px !important;
}

.win-modal-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#modal-new-game-button.win-modal-button {
    background-color: #007bff;
}

#modal-restart-game-button.win-modal-button {
    background-color: #28a745;
}

/* Rules Section Styles */
#rules-section {
    background-color: transparent !important;
    color: #e0e0e0;
    padding: 25px 30px;
    margin: 40px auto;
    width: 90%;
    max-width: 750px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Add rules-container class to match the rules section styling */
.rules-container {
    background-color: transparent !important;
    color: #e0e0e0;
    padding: 25px 30px;
    margin: 40px auto;
    width: 90%;
    max-width: 750px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#rules-section h2, #rules-section h3, #rules-section h4 {
    color: #a3d9a5;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
}

/* Add heading styles for rules-container class */
.rules-container h2, .rules-container h3, .rules-container h4 {
    color: #a3d9a5;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
}

#rules-section h2 {
    text-align: center;
    margin-top: 0;
    font-size: 1.8em;
}

.rules-container h2 {
    text-align: center;
    margin-top: 0;
    font-size: 1.8em;
}

#rules-section h3 {
    font-size: 1.4em;
}

.rules-container h3 {
    font-size: 1.4em;
}

#rules-section h4 {
    font-size: 1.1em;
}

.rules-container h4 {
    font-size: 1.1em;
}

#rules-section ul {
    padding-left: 25px;
}

.rules-container ul {
    padding-left: 25px;
}

#rules-section ul ul {
    padding-left: 25px;
}

.rules-container ul ul {
    padding-left: 25px;
}

#rules-section li, #rules-section p {
    margin-bottom: 0.6em;
    line-height: 1.6;
}

.rules-container li, .rules-container p {
    margin-bottom: 0.6em;
    line-height: 1.6;
}

#rules-section strong {
    color: #f5f5f5;
    font-weight: 600;
}

.rules-container strong {
    color: #f5f5f5;
    font-weight: 600;
}

#rules-section a {
    color: #FFD700;
    text-decoration: none;
}

.rules-container a {
    color: #FFD700;
    text-decoration: none;
}

#rules-section a:hover {
    text-decoration: underline;
}

.rules-container a:hover {
    text-decoration: underline;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .multiplayer-board {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    #scorecard {
        max-height: none;
        width: 100%;
        order: 4; /* Move scorecard to the bottom on mobile */
        font-size: 0.9em;
    }
    
    .player {
        width: 100%;
    }
    
    #dice-area {
        gap: 8px;
    }
    
    .die {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    #game-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #change-player-button {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Speech bubble styling */
.speech-bubble {
    position: absolute;
    top: 10px;
    left: auto;
    right: -18px;
    transform: none;
    background-color: white;
    color: #333;
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 180px;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    z-index: 10;
    animation: fadeIn 0.5s ease-in;
    border: 1px solid #ddd;
}

/* Speech bubble pointer - now pointing left instead of down */
.speech-bubble:before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    border-width: 6px 8px 6px 0;
    border-style: solid;
    border-color: transparent white transparent transparent;
}

/* Animation for speech bubble */
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Player info container */
.player-info {
    display: flex;
    flex-direction: column;
}

/* Styling for dice when AI controlled (optional) */
.die.ai-controlled {
    /* Example: slightly dim dice or change border */
    /* opacity: 0.8; */
    /* border-color: #888; */
}

/* Styling for game board when AI turn is active (optional) */
#game-board.ai-turn-active {
    /* Example: slightly dim the game board or show a small indicator */
    /* opacity: 0.95; */
    /* border: 2px dashed gold; */
}

/* Responsive adjustments to match Solitaire */
@media (max-width: 700px) {
    #game-board {
        padding: 12px 20px;
    }
    
    .multiplayer-board {
        grid-template-columns: 1fr 200px; /* Slightly reduced for smaller screens */
    }
    
    #scorecard {
        grid-area: scorecard;
        width: 100%;
        margin-top: 20px;
    }
    
    .die {
        width: 42px;
        height: 42px;
    }
    
    .dot {
        width: 7px;
        height: 7px;
    }
}

@media (max-width: 519px) {
    html, body {
        padding-top: 5px; /* Reduced top padding for mobile */
    }

    body {
        padding-left: 0; /* No padding on sides to maximize space */
        padding-right: 0;
    }

    #page-menu a {
        font-size: 0.8em;
        margin: 0 5px;
    }

    #game-board-wrapper {
        width: 100%; /* Full width for the scrollable wrapper */
        overflow-x: auto; /* Enable horizontal scrolling */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        margin-bottom: 10px;
    }

    #game-board {
        padding: 35px 20px 10px 20px; /* Match Solitaire's mobile padding */
        gap: 10px;
    }
    
    .scorecard-info-item {
        font-size: 0.75em;
    }
    
    .die {
        width: 45px;
        height: 45px;
    }
}

/* Current role styles */
.current {
    grid-area: current-player;
    justify-content: flex-end;
}

/* Player info container for opponent */
.opponent .player-info {
    position: relative;
    bottom: auto;
    text-align: center;
    margin: 5px 0 0 0;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.9em;
}

/* Make player name for opponent */
.opponent .player-name {
    font-size: 1.1em; /* Reduced from 1.2em but still larger than original 0.9em */
    margin: 0;
    font-weight: bold;
    color: white;
}

/* Hide player status for cleaner look */
.opponent .player-status {
    display: none;
}

/* --- Ad Container Styles (updated for flex layout) --- */
.game-board-flex-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    gap: 32px;
}
.side-ad-container {
    width: 160px;
    min-width: 160px; /* Ensure minimum width for AdSense */
    max-width: 20vw;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    visibility: visible; /* Ensure containers are visible */
}
.side-ad-left {
    /* Left ad specific styles if needed */
}
.side-ad-right {
    /* Right ad specific styles if needed */
}
.ad-label {
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: normal;
    color: #999;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
.ad-banner {
    width: 100%;
    min-width: 160px; /* Ensure minimum width for AdSense */
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.ad-banner .adsbygoogle {
    width: 100% !important;
    min-width: 160px !important;
    display: block !important;
}
.ad-placeholder {
    width: 100%;
    height: 250px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
}
@media (max-width: 1100px) {
    .side-ad-container {
        display: none;
    }
    .game-board-flex-row {
        max-width: 100%;
        gap: 0;
    }
} 