/* Ducky Doubles — core game board styles extracted from game.css. */

/* ========================================
   GAME BOARD STYLES
   ======================================== */

/* Game board container */
.game-board {
    border-radius: 16px; /* rounded-2xl */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* shadow-2xl */
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.touch-support .game-board {
    border-radius: 16px 16px 0 0;
}

/* Game board positioning wrapper */
.game-board__wrapper {
    position: relative;
}

/* ========================================
   SHELL LAYOUT
   ======================================== */

.duckydoubles-root {
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    /* Ensure content clears iOS Safari URL bar and home indicator */
    padding-top: max(env(safe-area-inset-top, 0px), 8px);
    padding-top: max(constant(safe-area-inset-top, 0px), 8px); /* iOS 11.0-11.2 */
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 4px);
    padding-bottom: max(constant(safe-area-inset-bottom, 0px), 4px); /* iOS 11.0-11.2 */
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    overflow: hidden;
}

.duckydoubles-game-container {
    position: relative;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.duckydoubles-controls-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    opacity: 1;
    -webkit-transition: opacity 500ms ease-out;
    -o-transition: opacity 500ms ease-out;
    transition: opacity 500ms ease-out;
}

.duckydoubles-controls-hint--fadeout {
    opacity: 0;
}

@media (min-width: 768px) {
    .duckydoubles-controls-hint {
        font-size: 14px;
        line-height: 20px;
    }
}

/* ========================================
   SCOREBOARD
   ======================================== */

#ducky-doubles-stats.ducky-stats {
    width: 100%;
    cursor: pointer;
}

#ducky-doubles-stats.ducky-stats:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 4px;
}

.ducky-stats {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    gap: 12px;
    border-radius: 12px;
    color: #f4f8fb;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    max-width: 360px;
}

.ducky-stats__column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 150px;
    gap: 3.2px;
}

.ducky-stats__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    position: relative;
}

.ducky-stats__row:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
}

.ducky-stats__label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 10.4px;
    opacity: 0.85;
}

.ducky-stats__value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.ducky-stats__figure {
    font-size: 19.2px;
}

.ducky-stats__score {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 120px;
    text-align: center;
}

.ducky-stats__score-label {
    text-transform: uppercase;
    font-size: 11.2px;
    letter-spacing: 0.08em;
    opacity: 0.85;
}

.ducky-stats__score-value {
    font-size: 32px;
    line-height: 1.1;
}

.ducky-stats__score-value-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 38.4px;
}

.ducky-stats__score-popups {
    position: absolute;
    top: 0;
    left: 50%;
    width: 100%;
    transform: translateX(-50%);
    pointer-events: none;
}

.ducky-score-popup {
    position: absolute;
    left: 50%;
    -webkit-transform: translate(-50%, 0);
    -ms-transform: translate(-50%, 0);
    transform: translate(-50%, 0);
    font-size: 32px;
    font-weight: 600;
    color: #FFF;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    white-space: nowrap;
    -webkit-animation: duckyScoreFloat 600ms ease-out forwards;
    animation: duckyScoreFloat 600ms ease-out forwards;
    will-change: transform, opacity;
}

.ducky-stats__score--highlight {
    background: linear-gradient(150deg, rgba(255, 202, 62, 0.95), rgba(255, 177, 67, 0.95));
    color: #2a1f05;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 25px rgba(255, 195, 0, 0.4);
}

@media (max-width: 420px) {
    .ducky-stats {
        gap: 8px;
        max-width: none;
    }

    .ducky-stats__column {
        min-width: 135px;
    }

    .ducky-stats__figure {
        font-size: 16px;
    }

    .ducky-stats__score {
        padding: 3.2px 16px;
        min-width: 110px;
    }

    .ducky-stats__score-value {
        font-size: 25.6px;
    }

    .ducky-score-popup {
        font-size: 14.4px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@-webkit-keyframes duckyScoreFloat {
    0% {
        opacity: 0;
        -webkit-transform: translate(-50%, 0);
        transform: translate(-50%, 0);
    }
    10% {
        opacity: 8;
    }
    100% {
        opacity: 0;
        -webkit-transform: translate(-50%, -50px);
        transform: translate(-50%, -50px);
    }
}
@keyframes duckyScoreFloat {
    0% {
        opacity: 0;
        -webkit-transform: translate(-50%, 0);
        transform: translate(-50%, 0);
    }
    10% {
        opacity: 8;
    }
    100% {
        opacity: 0;
        -webkit-transform: translate(-50%, -50px);
        transform: translate(-50%, -50px);
    }
}

/* High score pulse animation */
@-webkit-keyframes highScorePulse {
    0%, 100% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    50% {
        -webkit-transform: scale(1.1);
        transform: scale(1.1);
    }
}
@keyframes highScorePulse {
    0%, 100% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    50% {
        -webkit-transform: scale(1.1);
        transform: scale(1.1);
    }
}

.high-score-pulse {
    -webkit-animation: highScorePulse 0.5s ease-in-out 3;
    animation: highScorePulse 0.5s ease-in-out 3;
}

/* ========================================
   GAME OVER OVERLAY
   ======================================== */

.game-over-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 24px;
    background: rgba(19, 43, 64, 0.62);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    -webkit-transition: opacity 300ms ease-in-out;
    -o-transition: opacity 300ms ease-in-out;
    transition: opacity 300ms ease-in-out;
    z-index: 40;
}

.game-over-overlay--visible {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

.game-over-overlay__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    color: #ffffff;
    background: rgba(10, 24, 36, 0.85);
    padding: 24px;
    border-radius: 16px;
    width: 100%;
    max-width: min(360px, 90vw);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.game-over-overlay__title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #ffd405;
    width: 100%;
    text-shadow: -1px -1px 1px #FFF, 2px 2px 5px #000;
}

.game-over-overlay__score {
    font-size: clamp(24px, 3.5vw, 36px);
    font-weight: 600;
}

.game-over-overlay__high-score {
    font-size: clamp(17.6px, 3vw, 24px);
    font-weight: 600;
    color: #FACC15;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ========================================
   SWIPE TRAY STYLES
   ======================================== */

/* Swipe tray container - extends swipe area below game grid */
.swipe-tray {
    width: 100%;
    min-height: 150px;
    height: auto;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    margin-top: 2px;
    display: none;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    border-radius: 0 0 16px 16px; /* rounded bottom corners */
    background: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    -ms-touch-action: none;
    touch-action: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
    -o-transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
    transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.touch-support .swipe-tray {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.swipe-tray__glow-canvas {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    -webkit-transition: opacity 220ms ease;
    -o-transition: opacity 220ms ease;
    transition: opacity 220ms ease;
    mix-blend-mode: screen;
    z-index: 5;
}

.swipe-tray--active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.3);
}

/* Swipe hint text */
.swipe-tray__hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    pointer-events: none;
    letter-spacing: 0.5px;
    -webkit-transition: color 200ms ease;
    -o-transition: color 200ms ease;
    transition: color 200ms ease;
}

.swipe-tray--active .swipe-tray__hint {
    color: rgba(255, 255, 255, 0.85);
}

/* Swipe tray hover effect (desktop only) */
@media (hover: hover) {
    .swipe-tray:hover {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.25);
    }
}
