/* ==========================================================================
   Apple Juice - Tilt Drinking Game
   ========================================================================== */

/* ---------- Variables ---------- */
:root {
    --juice-gold: #D4890A;
    --juice-amber: #E8A317;
    --juice-light: #F5D280;
    --card-radius: 16px;
}

/* ---------- Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #1a1205;
    color: #fff;
    -webkit-user-select: none;
    user-select: none;
}

/* ---------- Skip to content ---------- */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    padding: 8px 16px;
    background: var(--juice-gold);
    color: #000;
    font-weight: 600;
    border-radius: 0 0 8px 0;
}

.skip-to-content:focus {
    left: 0;
}

/* ---------- Header ---------- */
.game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(26, 18, 5, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 137, 10, 0.2);
    padding: env(safe-area-inset-top, 0) 0 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    max-width: 600px;
    margin: 0 auto;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--juice-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.back-link:hover {
    color: #fff;
}

.back-arrow {
    font-size: 18px;
}

.game-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--juice-amber);
    letter-spacing: 0.5px;
}

.mute-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    line-height: 1;
}

.mute-button .sound-off {
    display: none;
}

.mute-button[aria-pressed="true"] .sound-on {
    display: none;
}

.mute-button[aria-pressed="true"] .sound-off {
    display: inline;
}

/* ---------- Screens ---------- */
.game-main {
    width: 100%;
    height: 100%;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* ---------- Start Screen ---------- */
.start-screen {
    background: linear-gradient(145deg, #1a1205 0%, #2d1f0a 50%, #1a1205 100%);
    flex-direction: column;
    padding: 20px;
}

.start-card {
    text-align: center;
    max-width: 360px;
    width: 100%;
}

.juice-emoji {
    font-size: 80px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.start-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--juice-amber);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.start-subtitle {
    font-size: 18px;
    color: var(--juice-light);
    margin-bottom: 8px;
    opacity: 0.9;
    font-weight: 600;
}

.start-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

/* Start button */
.start-btn {
    display: inline-block;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    background: linear-gradient(135deg, var(--juice-amber), var(--juice-gold));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 20px rgba(212, 137, 10, 0.4);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(212, 137, 10, 0.5);
}

.start-btn:active {
    transform: translateY(0) scale(0.97);
}

.start-hint {
    margin-top: 24px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    line-height: 1.5;
}

/* ---------- Game Screen ---------- */
.game-screen {
    background: #0D0A04;
}

#juice-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* ---------- Drink Prompt ---------- */
.drink-prompt {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    pointer-events: none;
    transition: opacity 0.4s;
}

.drink-prompt-text {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(26, 18, 5, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 137, 10, 0.3);
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--juice-light);
    white-space: nowrap;
}

.drink-prompt.fading {
    opacity: 0;
}

/* ---------- Another One Button ---------- */
.another-one {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom, 0);
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.another-one-btn {
    padding: 14px 40px;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    background: linear-gradient(135deg, var(--juice-amber), var(--juice-gold));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 24px rgba(212, 137, 10, 0.5);
    transition: transform 0.15s, box-shadow 0.15s;
}

.another-one-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 32px rgba(212, 137, 10, 0.6);
}

.another-one-btn:active {
    transform: scale(0.95);
}

/* ---------- Permission Overlay ---------- */
.permission-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
}

.permission-card {
    background: linear-gradient(145deg, #2d1f0a, #1a1205);
    border: 2px solid var(--juice-gold);
    border-radius: var(--card-radius);
    padding: 36px 28px;
    text-align: center;
    max-width: 340px;
    width: 100%;
}

.permission-card h2 {
    font-size: 24px;
    color: var(--juice-amber);
    margin-bottom: 12px;
}

.permission-card p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ---------- Desktop tilt hint ---------- */
.tilt-indicator {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    pointer-events: none;
    z-index: 40;
}

/* ---------- Responsive ---------- */
@media (max-height: 500px) {
    .juice-emoji {
        font-size: 48px;
        margin-bottom: 8px;
    }

    .start-title {
        font-size: 28px;
    }

    .start-description {
        margin-bottom: 16px;
    }
}
