/* =========================================
   BOSS RYAN - FIRST PLAYER PICKER STYLES
   ========================================= */

/* Override global body width limitation for full-canvas picker */
body.picker-body {
    max-width: 100vw !important;
    margin: 0 !important;
    overflow: hidden;
}

.picker-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background-color: var(--color-bg);
}

/* iOS Dynamic Island HUD Pill Styles */
.header.hud-container {
    position: absolute;
    top: 1.8dvh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000 !important;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 92vw;
    box-sizing: border-box;
}

.hud-pill {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    gap: 2vw;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(3dvh) saturate(200%);
    -webkit-backdrop-filter: blur(3dvh) saturate(200%);
    border: 0.1dvh solid rgba(255, 255, 255, 0.18);
    border-radius: 4vw;
    padding: 1dvh 4vw;
    box-shadow: 0 1.2dvh 3.5dvh rgba(0, 0, 0, 0.6), inset 0 0.1dvh 0 rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    max-width: 100%;
    box-sizing: border-box;
}

.hud-pill:active {
    transform: scale(0.96);
}

.hud-dot {
    width: 1dvh;
    height: 1dvh;
    border-radius: 50%;
    background-color: var(--color-accent);
    box-shadow: 0 0 1dvh var(--color-accent);
    animation: pulseDot 2s infinite ease-in-out;
    flex-shrink: 0;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.hud-title {
    font-size: 1.8dvh;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.hud-chevron {
    width: 1.8dvh;
    height: 1.8dvh;
    color: rgba(235, 235, 245, 0.6);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

/* Expanded Settings Drawer - iOS Sheet Card Style (Expanded Version) */
.hud-settings {
    pointer-events: auto;
    margin-top: 1.5dvh;
    background: rgba(20, 20, 22, 0.95);
    backdrop-filter: blur(4dvh) saturate(220%);
    -webkit-backdrop-filter: blur(4dvh) saturate(220%);
    border: 0.1dvh solid rgba(255, 255, 255, 0.2);
    border-radius: 4vw;
    padding: 2.5dvh 5vw;
    box-shadow: 0 3dvh 7dvh rgba(0, 0, 0, 0.8), inset 0 0.1dvh 0 rgba(255, 255, 255, 0.2);
    width: 90vw;
    max-width: 92vw;
    
    /* 쫀득한 iOS 드로어 트랜지션 애니메이션 속성 */
    visibility: hidden;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-2.5dvh) scale(0.88);
    transform-origin: top center;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, max-height 0.3s ease, visibility 0.3s;
    z-index: 2500 !important;
}

.hud-container.open .hud-settings {
    visibility: visible;
    opacity: 1;
    max-height: 70dvh;
    transform: translateY(0) scale(1);
    transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease, max-height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0s;
}

.hud-container.open .hud-chevron {
    transform: rotate(180deg);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.5dvh;
    border-bottom: 0.1dvh solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.8dvh;
}

.settings-header-title {
    font-size: 2.2dvh;
    font-weight: 900;
    color: #FFFFFF;
    letter-spacing: -0.02em;
}

.settings-close-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    width: 4dvh;
    height: 4dvh;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(235, 235, 245, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.settings-close-btn svg {
    width: 2.2dvh;
    height: 2.2dvh;
}

.settings-label {
    display: block;
    font-size: 1.6dvh;
    font-weight: 800;
    color: rgba(235, 235, 245, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5dvh;
    text-align: left;
}

/* iOS Settings Vertical List Layout */
.mode-list {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1.2dvh;
}

.mode-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 0.1dvh solid rgba(255, 255, 255, 0.08);
    border-radius: 3vw;
    padding: 1.6dvh 4vw;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-sizing: border-box;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.mode-btn:active {
    transform: scale(0.98);
}

.mode-btn.active {
    background: rgba(10, 132, 255, 0.16);
    border-color: rgba(10, 132, 255, 0.45);
    box-shadow: 0 0.5dvh 2dvh rgba(10, 132, 255, 0.25);
}

.mode-list-icon {
    font-size: 3.2dvh;
    min-width: 4dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-list-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    flex: 1;
    margin: 0 2vw;
}

.mode-list-title {
    font-size: 1.9dvh;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.01em;
}

.mode-list-desc {
    font-size: 1.5dvh;
    font-weight: 500;
    color: rgba(235, 235, 245, 0.6);
    margin-top: 0.4dvh;
    line-height: 1.35;
}

.mode-list-check {
    width: 2.5dvh;
    height: 2.5dvh;
    color: var(--color-accent-blue);
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.mode-btn.active .mode-list-check {
    opacity: 1;
    transform: scale(1);
}

.ring-badge {
    position: absolute;
    top: -8dvh;
    left: 50%;
    transform: translateX(-50%) scale(0.5);
    font-size: 2dvh;
    font-weight: 800;
    color: #ffffff;
    background-color: var(--color-surface);
    border: 0.25dvh solid currentColor;
    padding: 0.8dvh 3vw;
    border-radius: var(--radius-xl);
    box-shadow: 0 0.5dvh 2.5dvh rgba(0, 0, 0, 0.6);
    pointer-events: none;
    white-space: nowrap;
    z-index: 1000 !important;
    opacity: 0;
    animation: badgePop 0.3s var(--ease-ios) forwards;
}

.ring-badge::after {
    content: '';
    position: absolute;
    bottom: -0.7dvh;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 1.2dvh;
    height: 1.2dvh;
    background-color: var(--color-surface);
    border-right: 0.25dvh solid currentColor;
    border-bottom: 0.25dvh solid currentColor;
}

.ring-badge.bottom-badge {
    top: 12dvh;
}

.ring-badge.bottom-badge::after {
    top: -0.7dvh;
    bottom: auto;
    border-right: none;
    border-bottom: none;
    border-left: 0.25dvh solid currentColor;
    border-top: 0.25dvh solid currentColor;
}

@keyframes badgePop {
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

.touch-area {
    width: 100vw;
    height: 100vh;
    background-color: var(--color-bg);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none; /* Prevents scrolling during multi-touch */
    overflow: hidden;
}

.picker-home-container {
    position: absolute;
    bottom: 2.5dvh;
    left: 4vw;
    z-index: 30;
    pointer-events: auto;
}

.home-icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5dvh;
    height: 5dvh;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(3dvh) saturate(200%);
    -webkit-backdrop-filter: blur(3dvh) saturate(200%);
    border: 0.1dvh solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1dvh 3dvh rgba(0, 0, 0, 0.5), inset 0 0.1dvh 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.2s var(--ease-ios), background-color 0.2s ease;
    text-decoration: none;
}

.home-icon-button:active {
    transform: scale(0.92);
}

.home-icon-button svg {
    width: 2.2dvh;
    height: 2.2dvh;
}

.instruction-box {
    text-align: center;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pulse-graphic-container {
    position: relative;
    width: 9dvh;
    height: 9dvh;
    margin-bottom: 2.5dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-center-dot {
    width: 1.8dvh;
    height: 1.8dvh;
    border-radius: 50%;
    background-color: var(--color-accent);
    box-shadow: 0 0 2dvh var(--color-accent);
}

.pulse-ring-graphic {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 0.25dvh solid var(--color-accent);
    opacity: 0;
    animation: wavePulse 2.4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.pulse-ring-graphic.ring-2 {
    animation-delay: 1.2s;
}

@keyframes wavePulse {
    0% {
        transform: scale(0.3);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.instruction-title {
    font-size: 2dvh;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    margin-bottom: 0.5dvh;
}

.instruction-desc {
    font-size: 1.5dvh;
    color: rgba(235, 235, 245, 0.5);
    font-weight: 500;
}

.countdown-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.3);
    font-size: 18dvh;
    font-weight: 900;
    color: #FFFFFF;
    text-shadow: 
        0 0 2.5dvh var(--color-accent),
        0 0 6dvh var(--color-accent),
        0 0 11dvh var(--color-accent);
    pointer-events: none;
    opacity: 0;
    z-index: 1500 !important;
    font-family: system-ui, -apple-system, sans-serif;
    user-select: none;
}

.countdown-display.active {
    animation: intenseCountdownPop 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.4) forwards;
}

@keyframes intenseCountdownPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2.5);
        filter: blur(2dvh);
    }
    25% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
        filter: blur(1.2dvh);
    }
}

@property --gauge-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Dynamic Touch Rings - Soft Cute Bubble & Solid Circle Style */
.touch-ring {
    position: absolute;
    width: 10dvh;
    height: 10dvh;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: none;
    transition: transform 0.3s var(--ease-ios), opacity 0.3s var(--ease-ios);
    animation: bubbleSpawn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, intenseJellyPulse 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate 0.4s;
    filter: drop-shadow(0 1dvh 3dvh rgba(0, 0, 0, 0.45));
    z-index: 100;
}

@keyframes intenseJellyPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.92);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.25);
    }
    100% {
        transform: translate(-50%, -50%) scale(0.98);
    }
}

/* Outer Continuous Radar Wave Pulse */
.touch-ring::after {
    content: '';
    position: absolute;
    inset: -1.5dvh;
    border: 0.35dvh solid currentColor;
    border-radius: 50%;
    opacity: 0;
    animation: intenseOuterWave 1.4s cubic-bezier(0.1, 0.8, 0.3, 1) infinite 0.4s;
}

@keyframes intenseOuterWave {
    0% { transform: scale(0.85); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Filled Soft Center Bubble with Breathing Soft Inner Glow */
.touch-ring-inner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.92;
    box-shadow: inset 0 0.5dvh 1dvh rgba(255, 255, 255, 0.35), inset 0 -0.5dvh 1dvh rgba(0, 0, 0, 0.2);
    animation: softInnerGlow 2.2s ease-in-out infinite alternate;
}

@keyframes softInnerGlow {
    0% {
        box-shadow: inset 0 0.5dvh 1dvh rgba(255, 255, 255, 0.35), inset 0 -0.5dvh 1dvh rgba(0, 0, 0, 0.2);
    }
    100% {
        box-shadow: inset 0 0.8dvh 1.8dvh rgba(255, 255, 255, 0.55), inset 0 -0.5dvh 1.2dvh rgba(0, 0, 0, 0.3);
    }
}

/* Outer Round Gauge Ring - Fully Functional Conic Gauge */
.touch-ring-gauge {
    position: absolute;
    inset: -1.2dvh;
    border-radius: 50%;
    padding: 0.5dvh;
    background: conic-gradient(currentColor var(--gauge-angle), rgba(255, 255, 255, 0.15) var(--gauge-angle));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: smoothFillGauge 0.85s ease-out forwards;
}

@keyframes smoothFillGauge {
    from {
        --gauge-angle: 0deg;
    }
    to {
        --gauge-angle: 360deg;
    }
}

@keyframes bubbleSpawn {
    0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; }
    60% { transform: translate(-50%, -50%) scale(1.18); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.touch-ring.winner {
    transform: translate(-50%, -50%) scale(1.28) !important;
    filter: drop-shadow(0 1.8dvh 5dvh rgba(0, 0, 0, 0.65)) !important;
    animation: bubbleWinnerBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate !important;
    z-index: 900 !important;
}

@keyframes bubbleWinnerBounce {
    from { transform: translate(-50%, -50%) scale(1.18); }
    to { transform: translate(-50%, -50%) scale(1.32); }
}

/* Winner Screen Flash Animation */
.winner-screen-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.4) 0%, transparent 80%);
    pointer-events: none;
    z-index: 50;
    animation: flashFade 0.45s ease-out forwards;
}

@keyframes flashFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Confetti Particle Effects */
.confetti-particle {
    position: absolute;
    width: 0.8dvh;
    height: 0.8dvh;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
    animation: confettiPop 0.7s ease-out forwards;
}

@keyframes confettiPop {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(0.2);
    }
}

@keyframes confettiPop {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(0.2);
    }
}
