:root {
    --bg-color: #1a4a2a;
    --board-bg: #143d22;
    --panel-bg: rgba(0, 0, 0, 0.4);
    --text-color: #ffffff;
    --accent-color: #ffd700;
}

* {
    box-sizing: border-box;
    user-select: none;
}


/* Game Header / Status Panel */
header {
    background: var(--panel-bg);
    /*padding: 10px 20px;*/
    padding: 5px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10;
}

#mobile-header {
    display:none;
}

.score-board {
    display: flex;
    gap: 20px;
   /* font-size: 1.1rem;*/
    font-size: 1.0rem;
    font-weight: bold;
}

.status-msg {
    font-style: italic;
    color: var(--accent-color);
}

button {
    background: #e67e22;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

button:hover {
    background: #d35400;
}

button:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
}

#winner-win {
    position:absolute;
    top:50%;
    left:50%;
    display:none;
    flex-direction:column;
    background-color:blue;
    z-index:2010;
    transform: translate(-50%,-50%);
    border-radius: 5%;
    font-size:1.2rem;
    text-align:center;
    padding:10px;
    align-items:center;
}

/*
#winner-win h1,h2,h3 {
    text-align:center;
}

#winner-win button {
    width:50%;
    text-align:center;
}
*/

/* The Game Board */

/* Player's Hand Area */
#player-hand-container {
    position: absolute;
    bottom:-50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg);
    padding: 5px;
    border-top: 2px solid rgba(255,255,255,0.1);
/*   display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
*/
    z-index: 10;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.3);
}

.hand {
    display: flex;
    gap: 12px;
    justify-content: center;
    min-height: 130px;
    align-items: center;
}


/* Domino SVG Styling */
.domino {
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.4));
    display: block;
}

.hand .domino:hover {
    transform: translateY(-15px) scale(1.05);
    filter: drop-shadow(0px 10px 12px rgba(0,0,0,0.6)) brightness(1.1);
}

.domino.playable {
    outline: 3px solid var(--accent-color);
    outline-offset: 4px;
    border-radius: 8px;
}

/* Absolute anchoring for table tiles */
.board-domino {
    position: absolute;
/*    width: 60px;
    height: 120px;  */
    width: 42px;
    height: 84px; 
    transform-origin: center center;
    transition: all 0.3s ease-out;
}

/* Controls for picking target placement side */
.placement-overlay {
    position: absolute;
    display: none;
    gap: 20px;
    z-index: 100;
    background: rgba(0,0,0,0.9);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* ... Keep all previous styles, and add/modify these sections ... */

/* AI Hand Area at the Top */
.opponent-status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg);
    padding: 12px 24px;
    border-radius: 8px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#ai-hand {
    display: flex;
    gap: 8px;
    justify-content: center;
    min-height: 65px; /* Shorter height since they are scaled down */
    align-items: center;
}

/* Scaled-down look for AI tiles in hand */
#ai-hand .domino {
    transform: scale(0.55);
    transform-origin: center top;
    margin: 0 -12px; /* Tighten overlap look */
    cursor: default;
    pointer-events: none; /* Player can't click AI tiles */
}

/* Back of Domino Card design */
.domino-back {
    fill: #2c3e50 !important; /* Deep Midnight Blue */
    stroke: #ffd700 !important; /* Gold border trim */
    stroke-width: 2px !important;
}

.domino-back-pattern {
    fill: none;
    stroke: rgba(255, 215, 0, 0.15);
    stroke-width: 1.5;
}

/* Back of Domino Card design - Traditional Ivory Style */
.domino-back {
    fill: #fcfaf2 !important; /* Matches the front elegant ivory shade */
    stroke: #dcd7c9 !important; /* Clean ivory-bone side borders */
    stroke-width: 1.5px !important;
}

.domino-back-spinner {
    fill: #b8860b;
    stroke: #5c4033;
    stroke-width: 0.5;
}


/* ... Keep all previous styles, and add these badge rules ... */

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    align-self: center;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.badge-active {
    background-color: #2ecc71; /* Emerald Green */
    color: #ffffff;
    border: 1px solid #27ae60;
}

.badge-blocked {
    background-color: #e74c3c; /* Tomato Red */
    color: #ffffff;
    border: 1px solid #c0392b;
    animation: pulse 1.5s infinite;
}

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


/* ... Keep your header, hand containers, and badges exactly the same ... */

/* The Game Board */
#board {
    position: relative;
    width: 100%;
    height: 100%;
    /* Keeps the entire snake formation centered on screen as it grows */
    display: flex;
    align-items: center;
    justify-content: center; 
}

.board-domino {
    position: absolute;
    transform-origin: center center;
    transition: all 0.3s ease-out;
}

/* Controls for picking target placement side */
.placement-overlay {
    position: absolute;
    display: none;
    gap: 20px;
    z-index: 100;
    background: rgba(0,0,0,0.9);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* ... Keep all previous styles, and add/modify these sections ... */

/* AI Hand Area at the Top */
.opponent-status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg);
    padding: 12px 24px;
    border-radius: 8px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* ... Keep all previous styles, and add these badge rules ... */


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


/* ... Keep your header, hand containers, and badges exactly the same ... */


.board-domino {
    position: absolute;
    transform-origin: center center;
    z-index: 2;
    /* Remove any hardcoded standard transitions so WAAPI handles all multi-axis rotations */
}
