:root {
    --watch-size: 500px;
    --screen-size: 360px;
    /* Fenix 7X is large, scaling for desktop view */
    --bezel-color: #2c2c2c;
    --body-color: #1a1a1a;
    --accent-color: #ff4400;
    /* Garmin Red/Orange accent */
    --screen-bg: #000000;
    --text-color: #ffffff;
    --font-main: 'Roboto Condensed', sans-serif;
}

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

body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    font-family: var(--font-main);
    overflow: hidden;
    /* Prevent scrollbars from fixed size watch container */
}

.watch-container {
    position: relative;
    width: var(--watch-size);
    height: var(--watch-size);
    /* Responsive scaling for mobile devices */
    transform-origin: center center;
    flex-shrink: 0;
    /* Prevent flexbox from squashing the watch */
}

/* Responsive scaling handled by JS now */

.watch-body {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #1a1a1a;
    /* Base dark color */
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.6),
        /* Drop shadow */
        inset 0 0 0 2px #333,
        /* Outer edge definition */
        inset 0 0 0 50px #222,
        /* Main Bezel Face */
        inset 0 0 10px 50px rgba(0, 0, 0, 0.5);
    /* Inner depth */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Inner black border around screen */
.watch-body::before {
    content: '';
    position: absolute;
    width: 380px;
    /* Slightly larger than screen */
    height: 380px;
    border-radius: 50%;
    background: #000;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* Screws on the bezel */
.screw {
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #666, #333);
    border-radius: 50%;
    box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.8), 0 1px 1px rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.screw::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 1px;
    background: #222;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Positioning screws - On the bezel ring */
.screw-1 {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
}

.screw-2 {
    top: 100px;
    right: 18px;
}

.screw-3 {
    bottom: 100px;
    right: 18px;
}

.screw-4 {
    bottom: 100px;
    left: 18px;
}

.screw-5 {
    top: 100px;
    left: 18px;
}


/* Buttons - Protruding metal pieces */
.button {
    position: absolute;
    background: linear-gradient(to right, #333, #555, #333);
    width: 14px;
    height: 50px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.1s;
    z-index: 0;
    /* Behind bezel slightly visually, but we need them clickable */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.button:active {
    transform: scale(0.95);
}

/* Button Labels - Printed on the watch body/background */
.button span {
    position: absolute;
    color: #555;
    /* Dark color for contrast on light background */
    font-size: 11px;
    font-weight: 700;
    font-family: 'Roboto Condensed', sans-serif;
    white-space: nowrap;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

/* Button Positions & Labels */
/* LIGHT: Top Left */
.btn-light {
    top: 70px;
    left: -6px;
    transform: rotate(25deg);
}

.btn-light span {
    right: 140%;
    top: 50%;
    transform: translateY(-50%) rotate(-25deg);
    /* Anchored to right */
    text-align: right;
}

/* UP-MENU: Middle Left */
.btn-up {
    top: 50%;
    left: -10px;
    transform: translateY(-50%);
}

.btn-up span {
    right: 140%;
    top: 50%;
    transform: translateY(-50%);
    /* Anchored to right */
}

/* DOWN: Bottom Left */
.btn-down {
    bottom: 70px;
    left: -6px;
    transform: rotate(-25deg);
}

.btn-down span {
    right: 140%;
    bottom: 50%;
    transform: translateY(50%) rotate(25deg);
    /* Anchored to right */
}

/* START-STOP: Top Right */
.btn-start {
    top: 70px;
    right: -6px;
    transform: rotate(-25deg);
    background: linear-gradient(to left, #333, #555, #333);
}

/* Red ring detail on button */
.btn-start::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 2px;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: #ff4400;
    border-radius: 2px;
    opacity: 0.8;
}

.btn-start span {
    left: 140%;
    top: 50%;
    transform: translateY(-50%) rotate(25deg);
    /* Anchored to left */
    color: #ff4400;
    /* Accent color for label */
}

/* BACK-LAP: Bottom Right */
.btn-back {
    bottom: 70px;
    right: -6px;
    transform: rotate(25deg);
    background: linear-gradient(to left, #333, #555, #333);
}

.btn-back span {
    left: 140%;
    bottom: 50%;
    transform: translateY(50%) rotate(-25deg);
    /* Anchored to left */
}


/* Screen */
.screen {
    width: var(--screen-size);
    height: var(--screen-size);
    background-color: var(--screen-bg);
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    z-index: 10;
    /* Above bezel inner border */
    /* Glass reflection hint */
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-ui {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
    /* Space for top curve */
}

.status-bar {
    position: absolute;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    font-size: 14px;
    color: #888;
}

/* Screens */
.hidden {
    display: none !important;
}

#start-screen {
    text-align: center;
    margin-top: 40px;
}

#start-screen h1 {
    font-size: 48px;
    line-height: 1;
    margin: 0 0 20px 0;
    letter-spacing: 2px;
}

#start-screen p {
    font-size: 18px;
    color: var(--accent-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

#game-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud {
    display: flex;
    justify-content: space-around;
    width: 80%;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: bold;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 240px;
    height: 240px;
}

.hole {
    background: #333;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #444;
}

.mole {
    width: 100%;
    height: 100%;
    background: #8b4513;
    /* SaddleBrown */
    border-radius: 50%;
    position: absolute;
    top: 100%;
    transition: top 0.2s ease-out;
    box-shadow: inset -5px -5px 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    /* Keep face inside */
}

/* Mole Face */
.mole::before {
    content: '';
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 30%;
    background: #ffcd94;
    /* Snout color */
    border-radius: 50%;
}

.mole::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 15%;
    height: 10%;
    background: #000;
    /* Nose */
    border-radius: 50%;
    box-shadow:
        -12px -8px 0 2px #000,
        /* Left Eye */
        12px -8px 0 2px #000;
    /* Right Eye */
}

.hole.up .mole {
    top: 0;
}

#game-over-screen {
    text-align: center;
    margin-top: 80px;
}

#game-over-screen h2 {
    font-size: 36px;
    color: var(--accent-color);
}

.mole.hit {
    background: #ffffff;
    /* Flash white on hit */
    transform: scale(0.9);
}

/* Main Menu */
#main-menu {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
}

.menu-title {
    font-size: 24px;
    color: #888;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

/* --- Soccer Game --- */
#soccer-game {
    background: #4caf50;
    /* Grass Green */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

#soccer-ui {
    position: absolute;
    top: 60px;
    /* Moved down from 20px to avoid clipping */
    width: 100%;
    display: flex;
    justify-content: center;
    /* Centered */
    gap: 30px;
    /* Add gap between elements */
    padding: 0 20px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 0 #000;
    z-index: 10;
    box-sizing: border-box;
}

.team-score {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Increased gap */
}

.dots {
    display: flex;
    gap: 8px;
    /* Increased gap */
}

.dot {
    width: 14px;
    /* Larger dots */
    height: 14px;
    border-radius: 50%;
    background-color: #555;
    /* Darker gray for better contrast */
    border: 2px solid #fff;
    /* Thicker border */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dot.green {
    background-color: #4caf50;
    /* Goal */
    box-shadow: 0 0 8px #4caf50;
}

.dot.red {
    background-color: #f44336;
    /* Miss */
    box-shadow: 0 0 8px #f44336;
}

#soccer-canvas {
    border-radius: 50%;
    background: #4caf50;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

#soccer-message {
    position: absolute;
    top: 70%;
    /* Moved down from 50% towards penalty spot */
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #fff;
    z-index: 20;
}

#soccer-message h2 {
    font-size: 32px;
    color: #ffeb3b;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 0 #000;
}

#soccer-message p {
    font-size: 16px;
    color: #fff;
    margin: 0;
}

#soccer-turn-msg {
    position: absolute;
    top: 65%;
    /* Moved down from 50% to be closer to penalty spot */
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 5px;
    z-index: 15;
}

.menu-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.menu-item {
    font-size: 20px;
    padding: 5px 15px;
    color: #aaa;
    border: 1px solid transparent;
    border-radius: 20px;
    transition: all 0.2s;
}

.menu-item.selected {
    color: #fff;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
    font-weight: bold;
}

.menu-hint {
    margin-top: 30px;
    font-size: 12px;
    color: #666;
    text-align: center;
    line-height: 1.4;
}

/* Game Containers */
.game-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
}

/* Whack-a-Mole Specifics (Updates) */
#whack-start-screen {
    text-align: center;
    margin-top: 40px;
}

#whack-start-screen h1 {
    font-size: 48px;
    line-height: 1;
    margin: 0 0 20px 0;
    letter-spacing: 2px;
}

#whack-start-screen p {
    font-size: 18px;
    color: var(--accent-color);
    animation: blink 1s infinite;
}

#whack-play-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#whack-game-over-screen {
    text-align: center;
    margin-top: 80px;
}

#whack-game-over-screen h2 {
    font-size: 36px;
    color: var(--accent-color);
}

/* Flappy Bird */
#flappy-game {
    position: relative;
    padding-top: 0;
    /* Canvas takes full space */
    justify-content: center;
}

#flappy-canvas {
    border-radius: 50%;
    background: #000;
    /* Will be drawn over */
}

#flappy-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass to canvas/container */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#flappy-score {
    position: absolute;
    top: 40px;
    font-size: 36px;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
    z-index: 10;
}

#flappy-start-msg {
    font-size: 24px;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    z-index: 10;
}

/* --- Mini Golf Game --- */
#golf-game {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#golf-ui {
    position: absolute;
    top: 40px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    z-index: 20;
    pointer-events: none;
}

#golf-score-container,
#golf-par-container {
    font-size: 14px;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    font-weight: bold;
}

#golf-canvas {
    border-radius: 50%;
    background-color: #4caf50;
    /* Grass Green */
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Power Meter */
#power-meter-container {
    position: absolute;
    bottom: 60px;
    width: 120px;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    border-radius: 5px;
    overflow: visible;
    /* Changed to show hint arrow */
    z-index: 20;
}

#power-meter-bar {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    /* Clip the fill gradient */
    border-radius: 3px;
}

#power-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #0f0, #ff0, #f00);
    transition: width 0.05s linear;
}

/* Power Hint Arrow */
#power-hint-arrow {
    position: absolute;
    bottom: 78px;
    /* Position above the power meter */
    left: 50%;
    /* Center horizontally */
    display: block;
    width: 0;
    height: 0;
    margin-left: -60px;
    /* Half of power meter width (120px / 2) to align with meter */
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid #ffeb3b;
    /* Smaller, elegant yellow arrow */
    z-index: 100;
    transition: margin-left 0.2s ease-out;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

#golf-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #fff;
    z-index: 30;
    width: 80%;
}

#golf-message h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #ffeb3b;
}

#golf-message p {
    margin: 5px 0;
    font-size: 14px;
}

#flappy-game-over-msg {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 20;
}