/*
 * Theme: Watercolor (Player)
 * Matches the soft, elegant aesthetic of the host screen.
 */

/* SatsukiGendaiMincho Font */
@font-face {
    font-family: 'SatsukiGendaiMincho';
    src: url('/fonts/SatsukiGendaiMincho_v1.04/SatsukiGendaiMincho-M.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Background */
/* Background */
html,
body,
.game-container,
#lobby,
#waiting-screen,
#get-ready-screen,
#controller {
    background-color: #F3EDDE !important;
    background-image: url('/wedding_theme_elements/watercolor_background.webp') !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    background-position: center !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100dvh !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    position: fixed !important;
    /* Lock scroll on mobile */
    top: 0 !important;
    left: 0 !important;
}

/* ... existing comments ... */

/* Watercolor Decorations (Only visible when this theme is loaded) */
.watercolor-decoration {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
    width: 100% !important;
    display: flex !important;
    justify-content: center;
}

.watercolor-decoration img {
    max-width: none;
    /* Allow overflowing */
    width: 600px;
    /* Adjust size based on visual requirement */
}

.top-splash {
    top: -350px;
    /* Pull up to show half */
    opacity: 1;
}

.bottom-splash {
    bottom: -350px;
    /* Pull down to show half */
    transform: translateX(-50%) rotate(180deg);
    /* Rotate for variety if needed, or just standard */
    opacity: 1;
}

.bottom-bouquet {
    bottom: -380px;
    /* Adjust to show half */
    z-index: 1;
}

.bottom-bouquet img {
    width: 480px;
    transform: rotate(-90deg);
    /* Orient horizontally if it's a vertical bouquet */
}

/* Ensure content is above decorations */
#result-content,
.sprites-container,
#waiting-text {
    z-index: 2;
    position: relative;
}

/* Ensure waiting screen clips overflow correctly and fills screen */
#waiting-screen {
    position: relative;
    overflow: hidden;
    height: 100vh !important;
    /* Fallback */
    height: 100dvh !important;
    /* Mobile support */
    margin: 0 !important;
    /* Reset negative margin */
    padding: 0 !important;
    /* Reset padding */
    width: 100vw !important;
    /* Ensure full width */
}

/* ==========================================================================
   Result Screen Elements (Manual Adjustments)
   Edit these values to change size and position of result elements.
   These use !important to override defaults in index.html.
   ========================================================================== */

/* 1. Tick Mark Icon */
.result-icon {
    width: 150px !important;
    /* Adjust size */
    height: 150px !important;
    /* Adjust size */
    margin-bottom: 0.5rem !important;
    /* Adjust spacing below icon */
    margin-top: 0 !important;
    /* Adjust spacing above icon */
    transform: translateX(10px) !important;
    /* Adjust horizontal position (e.g., 10px to shift right) */
}

/* 2. Score Box (+963) */
.score-box {
    font-size: 2rem !important;
    /* Adjust text size */
    padding: 0.5rem 2rem !important;
    /* Adjust inner spacing */
    margin-bottom: 0.5rem !important;
    /* Adjust spacing below score */
    width: 100% !important;
    /* Container width */
    max-width: 300px !important;
    /* Max width constraint */
    /* Note: Border and Font Family are handled in the main theme section above */
}

/* 3. Streak/Status Text (連續答對 x N) */
.status-text {
    font-size: 2rem !important;
    /* Adjust text size */
    margin-bottom: 0.5rem !important;
    /* Adjust spacing below text */
    margin-top: 1rem !important;
    /* Adjust spacing above text */
    text-align: center !important;
    /* Alignment */
}

/* 4. Character Sprites Container */
.sprites-container {
    width: 300px !important;
    /* Adjust container width */
    height: 180px !important;
    /* Adjust container height */
    margin-bottom: 2rem !important;
    /* Adjust bottom margin */
    padding-bottom: 0px !important;
    /* Adjust bottom padding */
    /* Note: Border removed in main theme section */
}

/* 5. Result Content Container (Wraps Icon, Score, Text) */
#result-content:not(.hidden) {
    margin-bottom: 2rem !important;
    /* Spacing below the whole result block */
    max-width: 300px !important;
    /* Width constraint */
    display: flex !important;
    /* Layout mode */
    flex-direction: column !important;
    /* Stack vertically */
    align-items: center !important;
    /* Center horizontally */
}

/* ==========================================================================
   Get Ready Screen (Question Preview)
   ========================================================================== */

#get-ready-screen {
    /* Reset inline styles from index.html via !important */
    background-image: url('/wedding_theme_elements/watercolor_background.webp') !important;
    background-color: #F3EDDE !important;
    background-size: cover !important;
    margin: 0 !important;
    padding: 2rem !important;
    padding-bottom: 10rem !important;
    justify-content: center !important;
    /* Center vertically */
    align-items: center !important;
    /* Center horizontally */
    overflow: hidden !important;
    box-sizing: border-box !important;
}

#get-ready-screen div {
    /* Remove pixel border/sstyle from inline styles if any leak through */
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    text-shadow: none !important;
}

.ready-counter {
    font-family: 'SatsukiGendaiMincho', serif !important;
    font-size: 1.5rem !important;
    color: #4a4a4a !important;
    margin-bottom: 1.3rem !important;
    text-align: center !important;
    width: 100%;
    order: 1;
    /* Display above title */
}

.ready-title {
    font-family: 'SatsukiGendaiMincho', serif !important;
    font-size: 3rem !important;
    line-height: 1.3 !important;
    color: #4a4a4a !important;
    text-align: left !important;
    /* "Keep the question text left aligned" */
    width: 100% !important;
    max-width: 90% !important;
    word-break: break-word !important;
    order: 2;
    /* Display below counter */
    /* Center the block itself? */
    margin: 0 auto !important;
}

/* Ensure decorations are visible on this screen too */
#get-ready-screen .watercolor-decoration {
    display: flex !important;
    z-index: 0;
}

#get-ready-screen .ready-counter,
#get-ready-screen .ready-title {
    z-index: 2;
    position: relative;
}

/* ==========================================================================
   Lobby Screen (Watercolor Theme Override)
   ========================================================================== */

/* 1. Hide Standard Retro Content */
#lobby .pixel-box,
#lobby-retro-content {
    display: none !important;
}

/* 2. Show Watercolor Content */
#lobby-watercolor-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    position: relative;
    z-index: 10;
}

/* 3. Typography */
.watercolor-title {
    font-family: 'SatsukiGendaiMincho', serif !important;
    font-size: 3rem !important;
    margin-bottom: 2rem !important;
    color: #4b5e43 !important;
    /* Dark Olive */
    letter-spacing: 0.1rem !important;
}

.watercolor-subtitle {
    font-family: 'SatsukiGendaiMincho', serif !important;
    font-size: 1.2rem !important;
    color: #4b5e43 !important;
    /* Dark Olive */
    letter-spacing: 0.05rem !important;
}

/* 4. Decorations visibility in Lobby and Login */
#lobby .watercolor-decoration,
#login .watercolor-decoration {
    display: flex !important;
}

/* Ensure container handles full height and overflow */
#lobby,
#join-loading-screen {
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden !important;
}

/* Loading Screen Decorations */
#join-loading-screen .watercolor-decoration {
    display: flex !important;
}

/* Classic Loader (Spinning Circle) - Matches standard browser gray or theme color */
.classic-loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(75, 94, 67, 0.2);
    /* Light version of theme color */
    border-radius: 50%;
    border-top-color: #4b5e43;
    /* Theme color */
    animation: spin 1s ease-in-out infinite;
    -webkit-animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@-webkit-keyframes spin {
    to {
        -webkit-transform: rotate(360deg);
    }
}

/* ==========================================================================
   Login Screen (Watercolor Theme Override)
   ========================================================================== */

/* 1. Login Container */
#login {
    background-color: transparent !important;
    /* Use body background */
}

#login .pixel-box {
    background: rgba(255, 255, 255, 0.85) !important;
    /* Creamy transparent white */
    border: none !important;
    /* Remove pixel border */
    box-shadow: 0 8px 32px rgba(99, 89, 72, 0.15) !important;
    /* Soft diffuse shadow */
    border-radius: 24px !important;
    padding: 2.5rem !important;
    position: relative;
    max-width: 360px !important;
    /* Slightly narrower for elegance */
    width: 90% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(4px);
    /* Subtle blur override if supported, else fallback */
    z-index: 10 !important;
}

/* 1.1 Remove White Border Pseudo-element */
#login .pixel-box::after {
    display: none !important;
}

/* 2. Login Title */
#login h1 {
    font-family: 'SatsukiGendaiMincho', serif !important;
    color: #4b5e43 !important;
    /* Dark Olive to match lobby */
    font-size: 2.5rem !important;
    margin-bottom: 2rem !important;
    text-shadow: none !important;
    font-weight: normal !important;
    letter-spacing: 0.1rem;
    text-align: center !important;
}

/* 3. Inputs */
#login input {
    font-family: 'SatsukiGendaiMincho', serif !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 2px solid rgba(168, 162, 149, 0.4) !important;
    /* Soft beige/grey border */
    border-radius: 12px !important;
    padding: 12px 16px !important;
    margin-bottom: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    color: #4a4a4a !important;
    font-size: 1.2rem !important;
    box-shadow: none !important;
    outline: none !important;
    transition: all 0.3s ease;
}

#login input::placeholder {
    color: rgba(74, 74, 74, 0.4) !important;
}

#login input:focus {
    border-color: #8D6E63 !important;
    /* Warm brown/rose tone */
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.1) !important;
}

/* 4. Button */
#login button {
    font-family: 'SatsukiGendaiMincho', serif !important;
    background-color: #8EAFC5 !important;
    /* Soft Watercolor Blue */
    background-image: linear-gradient(135deg, #8EAFC5 0%, #76A5CC 100%) !important;
    /* Subtle blue gradient */
    color: white !important;
    border: none !important;
    border-radius: 50px !important;
    /* Pill shape */
    padding: 12px 0 !important;
    font-size: 1.4rem !important;
    margin-top: 1rem !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(142, 175, 197, 0.4) !important;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100% !important;
    text-shadow: none !important;
}

#login button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(142, 175, 197, 0.5) !important;
    filter: brightness(1.05);
}

#login button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(118, 165, 204, 0.4) !important;
}


/* ==========================================================================
   Waiting / Result Screen Overrides
   ========================================================================== */

/* 1. Status Text (Waiting...) */
#waiting-text {
    font-family: 'SatsukiGendaiMincho', serif !important;
    color: #4a4a4a !important;
    text-shadow: none !important;

    /* Align width with sprites container */
    width: 300px !important;
    max-width: 90% !important;

    /* Centering */
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;

    /* Spacing */
    margin-top: 1rem !important;
    margin-bottom: 2rem !important;
}

/* 2. Sprites Container - Remove Pixel Box Styling */
.sprites-container {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;

    /* Shared width logic */
    width: 300px !important;
    max-width: 90% !important;
    margin-left: auto !important;
    margin-right: auto !important;

    /* Layout: Push sprites to edges so text aligns with their outer boundary */
    justify-content: space-between !important;
    padding: 0 !important;
    /* Remove any padding that might shift sprites */
}

/* Ensure Sprite Boxes scale within the container */
.sprite-box {
    width: 48% !important;
    /* Slightly less than 50% to allow gap */
    max-width: 140px !important;
    /* Don't exceed original design size */
}

/* 3. Score Box - Remove Pixel Styling */
.score-box {
    border: none !important;
    background-color: transparent !important;
    font-family: 'SatsukiGendaiMincho', serif !important;
    color: #4a4a4a !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* 4. Result Status Text */
.status-text {
    font-family: 'SatsukiGendaiMincho', serif !important;
    color: #4a4a4a !important;
    text-shadow: none !important;
}

/* 5. Result Text (Message) */
#result-text {
    font-family: 'SatsukiGendaiMincho', serif !important;
    color: #4a4a4a !important;
}

/* 6. Loading Dots Color */
.loading-dots span {
    color: #4a4a4a !important;
}




/* ==========================================================================
   Controller / Game Buttons (Watercolor Theme Override)
   ========================================================================== */

#controller .status-text {
    font-family: 'SatsukiGendaiMincho', serif !important;
    color: #4a4a4a !important;
    margin-bottom: 2rem !important;
}

#buttons-grid {
    gap: 15px !important;
    padding: 0 1rem;
    box-sizing: border-box;
}

.game-btn {
    border: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
    background-image: none !important;
    /* clear any gradients */
    font-family: 'SatsukiGendaiMincho', serif !important;
    position: relative;
    /* Ensure text is above ::before */
    z-index: 1;
    color: #4a4a4a !important;
}

/* Create the watercolor shape using ::before */
.game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;

    -webkit-mask-image: url('/wedding_theme_elements/watercolor_option_select_box.png');
    mask-image: url('/wedding_theme_elements/watercolor_option_select_box.png');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    background-color: rgba(255, 255, 255, 0.8);
    /* Fallback */
}

/* Button Colors - Matching Host theme-watercolor.css */
/* btn-0 (Host choice-1) -> Pinkish */
.game-btn.btn-0::before {
    background-color: rgba(240, 98, 146, 0.6) !important;
}

/* btn-1 (Host choice-2) -> Light Green */
.game-btn.btn-1::before {
    background-color: rgba(174, 213, 129, 0.6) !important;
}

/* btn-2 (Host choice-3) -> Orange */
.game-btn.btn-2::before {
    background-color: rgba(255, 183, 77, 0.6) !important;
}

/* btn-3 (Host choice-4) -> Teal */
.game-btn.btn-3::before {
    background-color: rgba(77, 182, 172, 0.6) !important;
}

/* Active State - Darken/Scale */
.game-btn:active {
    transform: scale(0.95);
}

/* Text overrides in buttons */
.game-btn span {
    color: #fff !important;
    /* Making text white for better contrast on color blobs */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

/* Wait, host theme uses dark text #4a4a4a EXCEPT maybe choices? 
   Host theme choice-4 has explicit black color in style.css, but theme-watercolor overrides input to #4a4a4a.
   However, the backgrounds are 0.5 opacity.
   Let's check readability. 
   Option 1 is Pink (0.5). Dark text might be better.
   Option 2 is Green (0.5). Dark text.
   Option 3 is Orange (0.5). Dark text.
   Option 4 is Teal (0.5). Dark text.
   
   Host theme sets .answer-input color to #4a4a4a !important.
   So I should stick to dark text.
*/
.game-btn span {
    color: #4a4a4a !important;
    text-shadow: none !important;
    font-weight: bold;
}

/* ==========================================================================
   Final Ranking Screen (Watercolor Theme)
   ========================================================================== */

#ranking-screen {
    background-image: url('/wedding_theme_elements/watercolor_background.webp') !important;
    background-color: #F3EDDE !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

#ranking-screen .ranking-congrats {
    font-family: 'SatsukiGendaiMincho', serif !important;
    color: #4a4a4a !important;
}

#ranking-screen .ranking-place {
    font-family: 'SatsukiGendaiMincho', serif !important;
    color: #4a4a4a !important;
}

#ranking-screen .sprites-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#ranking-screen .watercolor-decoration {
    display: flex !important;
}

#ranking-screen .ranking-content {
    z-index: 2;
    position: relative;
}