/*
 * Gravity Garden - Game Styles
 *
 * @author      Mike Fairbrother
 * @copyright   2024-2026 Mike Fairbrother. All rights reserved.
 */

/* ---- Custom Design Tokens ---- */
:root {
    --gg-sky-top: #0a1628;
    --gg-sky-mid: #0f1f3d;
    --gg-sky-low: #1a2d4a;
    --gg-soil-top: #2d1a0e;
    --gg-soil-mid: #1f1208;
    --gg-soil-bottom: #140d05;
    --gg-stem: #4ade80;
    --gg-flower: #f472b6;
    --gg-leaf: #a3e635;
    --gg-vine: #34d399;
    --gg-glow-stem: rgba(74, 222, 128, 0.3);
    --gg-glow-flower: rgba(244, 114, 182, 0.4);
    --gg-glow-leaf: rgba(163, 230, 53, 0.3);
    --gg-glow-vine: rgba(52, 211, 153, 0.3);
}

/* ---- Override shell background for garden theme ---- */
#app.gp-game-shell {
    background: linear-gradient(180deg, var(--gg-sky-top) 0%, var(--gg-sky-mid) 40%, var(--gg-sky-low) 60%, var(--gg-soil-top) 78%, var(--gg-soil-mid) 90%, var(--gg-soil-bottom) 100%);
}

/* ---- Menu Screen ---- */
.menu-icon-area {
    position: relative;
    width: 120px;
    height: 100px;
    margin: 0 auto 8px;
}
.menu-seed-float {
    position: absolute;
    font-size: 28px;
    animation: gg-float 4s ease-in-out infinite;
}
.s1 { top: 0; left: 10px; animation-delay: 0s; }
.s2 { top: 5px; right: 10px; animation-delay: 1s; }
.s3 { bottom: 10px; left: 20px; animation-delay: 2s; }
.s4 { bottom: 5px; right: 20px; animation-delay: 3s; }

@keyframes gg-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(5deg); }
    50% { transform: translateY(-4px) rotate(-3deg); }
    75% { transform: translateY(-10px) rotate(2deg); }
}

.menu-title {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
    background: linear-gradient(135deg, #4ade80, #34d399, #a3e635);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}
.menu-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 28px;
    font-weight: 500;
}
.menu-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 28px;
}
.menu-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.menu-stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--gg-stem);
}
.menu-stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 2px;
}

/* ---- Canvas Wrapper ---- */
#canvas-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    position: relative;
    overflow: hidden;
}
#game-canvas {
    display: block;
    width: 100%;
    max-width: 420px;
    border-radius: 8px;
    touch-action: none;
}

/* ---- Seed Palette ---- */
#seed-palette {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    #seed-palette {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

.seed-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: var(--gp-radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 64px;
}
.seed-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}
.seed-btn:active {
    transform: scale(0.95);
}
.seed-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.seed-name {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.seed-btn.active .seed-name {
    color: rgba(255, 255, 255, 0.9);
}

/* ---- Drop indicator ---- */
.drop-indicator {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.15) 0px,
        rgba(255, 255, 255, 0.15) 4px,
        transparent 4px,
        transparent 8px
    );
    pointer-events: none;
    transition: left 0.05s linear;
    z-index: 5;
}

/* ---- Round / Complete Screens ---- */
.round-emoji,
.complete-garden-emoji {
    font-size: 56px;
    margin-bottom: 8px;
    animation: gp-badge-pop 0.5s ease-out;
}
.round-title,
.complete-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
}
.complete-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.complete-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.complete-stat-num {
    font-size: 30px;
    font-weight: 800;
    color: var(--gg-stem);
}
.complete-stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 2px;
}
.round-score-line,
.round-total-line {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}
.round-score-line strong,
.round-total-line strong {
    color: var(--gg-stem);
    font-size: 20px;
}
.new-best {
    font-size: 18px;
    font-weight: 700;
    color: var(--gp-accent);
    margin-bottom: 16px;
    animation: gp-badge-pop 0.5s ease-out;
}

/* ---- Help Modal ---- */
.help-section {
    margin-bottom: 14px;
}
.help-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}
.help-rules {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.help-rule {
    display: flex;
    align-items: center;
    gap: 12px;
}
.help-rule-emoji {
    font-size: 24px;
    min-width: 32px;
    text-align: center;
}
.help-rule-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.4;
}

/* ---- Star particles ---- */
.star-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    pointer-events: none;
    animation: gg-star-twinkle 3s ease-in-out infinite;
}
@keyframes gg-star-twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

/* ---- Growth particles ---- */
.growth-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    animation: gg-growth-pop 0.6s ease-out forwards;
}
@keyframes gg-growth-pop {
    0% { transform: scale(0) translateY(0); opacity: 1; }
    50% { transform: scale(1.2) translateY(-10px); opacity: 0.8; }
    100% { transform: scale(0.5) translateY(-25px); opacity: 0; }
}

/* ---- HUD seed count emphasis ---- */
#hud-seeds {
    transition: color 0.3s ease;
}
#hud-seeds.low {
    color: var(--gp-fire-a);
}
