/* Tight Lines — Dawn to Dusk
   Identity: dusk on still water, seen from the dock. Muted violet sky sinking
   through a wine horizon into cold teal depths; the only warm thing is the
   last light. Fraunces for the title voice, Inter for UI. Quiet nature
   documentary, not arcade — nothing neon, the drama is in the line. */

body {
    background-color: #f5f4f0;
}

.game-wrapper {
    position: relative;
    max-width: 1100px;
    margin: 1.25rem auto 2.5rem;
    padding: 0 12px;
}

.game-header-integrated {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #0c1418;
    border: 1px solid #23343a;
    border-radius: 12px 12px 0 0;
    padding: 10px 14px;
}

.game-logo {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 650;
    letter-spacing: 1px;
    color: #e9f1ee;
    font-size: 1.3rem;
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.high-score-display {
    font-family: 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
    font-weight: 700;
    color: #7fd4c4;
    background: rgba(127, 212, 196, 0.12);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    white-space: nowrap;
}

.mute-btn {
    background: #14232a;
    color: #e9f1ee;
    border: 1px solid #2b4048;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.mute-btn:hover {
    background: #1e3138;
}

/* The playfield: viewport height minus site nav + game header, same recipe as
   the other games so portrait and landscape both work. */
.canvas-container {
    position: relative;
    width: 100%;
    height: 70vh; /* fallback for browsers without dvh */
    height: max(430px, min(calc(100dvh - 230px), 820px));
    background: #0a1216;
    border: 1px solid #23343a;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    --chrome-accent: #7fd4c4;
    font-family: 'Inter', sans-serif;
}

.canvas-container canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

@supports (padding: max(0px)) {
    .game-wrapper {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
}

.canvas-container:fullscreen {
    height: 100%;
    border: none;
    border-radius: 0;
}

.canvas-container:-webkit-full-screen {
    height: 100%;
    border: none;
    border-radius: 0;
}

/* ---------- Start overlay ----------
   Dusk sky ramp (GDD keyframe t=1.00: #14121f / #3a2c44 / #7a4258) sinking
   through the surface line into river-teal water (#3d6b6e -> #0e2224). */
.start-screen {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-content: safe center; /* don't clip the top when content overflows */
    text-align: center;
    gap: 0.4rem;
    padding: 20px;
    background:
        linear-gradient(180deg,
            rgba(20, 18, 31, 0.92) 0%,
            rgba(58, 44, 68, 0.88) 32%,
            rgba(122, 66, 88, 0.84) 50%,
            rgba(24, 56, 58, 0.9) 62%,
            rgba(14, 34, 36, 0.93) 78%,
            rgba(6, 13, 22, 0.96) 100%);
    color: #e9f1ee;
    overflow-y: auto;
}

.start-screen h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 2.7rem;
    font-weight: 650;
    letter-spacing: 4px;
    margin: 0;
    text-shadow: 0 2px 24px rgba(127, 212, 196, 0.3);
}

.start-screen .tagline {
    color: #7fd4c4;
    letter-spacing: 5px;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 0 0.8rem;
}

.start-screen .instructions p {
    margin: 0 0 0.6rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #d6e2dc;
    max-width: 460px;
}

/* Location selector — each button carries a small-caps subtitle line */
.cond-row {
    display: flex;
    gap: 8px;
    margin-top: 0.4rem;
}

.cond-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    background: rgba(10, 22, 26, 0.72);
    color: #cfe0d8;
    border: 1px solid #35555a;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.cond-btn .cond-sub {
    display: block;
    font-variant: small-caps;
    text-transform: lowercase;
    font-weight: 600;
    font-size: 0.64rem;
    letter-spacing: 1.5px;
    color: #8fa8a0;
    transition: color 0.15s;
}

.cond-btn:hover {
    border-color: #578077;
}

.cond-btn.sel {
    background: #7fd4c4;
    border-color: #7fd4c4;
    color: #06201c;
}

.cond-btn.sel .cond-sub {
    color: #2a5a50;
}

/* Mode buttons + end-of-day actions */
.mode-row {
    display: flex;
    gap: 10px;
    margin-top: 0.7rem;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-button {
    min-height: 44px;
    background: rgba(10, 22, 26, 0.72);
    color: #d6e2dc;
    border: 1px solid #35555a;
    border-radius: 8px;
    padding: 0.6rem 1.1rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.mode-button:hover {
    border-color: #7fd4c4;
    background: rgba(24, 42, 44, 0.85);
}

.mode-button-quiet {
    font-size: 0.76rem;
    padding: 0.45rem 0.9rem;
    opacity: 0.85;
}

.play-button {
    margin-top: 0.9rem;
    min-height: 48px;
    background: #7fd4c4;
    color: #06201c;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 2.4rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.play-button:hover {
    background: #9de2d4;
    transform: translateY(-1px);
}

.crash-note {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 80;
    background: rgba(8, 14, 16, 0.95);
    border: 1px solid #e06a5a;
    border-radius: 10px;
    padding: 14px 18px;
    color: #e9f1ee;
    font-weight: 700;
}

/* In-game corner buttons (menu/exit) */
.corner-btn {
    position: absolute;
    left: calc(10px + env(safe-area-inset-left, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    background: rgba(10, 18, 20, 0.65);
    color: #e9f1ee;
    border: 1px solid rgba(233, 241, 238, 0.25);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
}

.corner-btn:hover {
    background: rgba(30, 44, 48, 0.8);
}

@media (prefers-reduced-motion: reduce) {
    .play-button:hover { transform: none; }
}

@media (max-width: 480px) {
    .game-wrapper { padding: 0 6px; margin-top: 0.75rem; }
    .game-logo { font-size: 1.05rem; }
    .high-score-display { font-size: 0.7rem; padding: 0.3rem 0.55rem; }
    .start-screen h2 { font-size: 2rem; letter-spacing: 2px; }
    .start-screen .instructions p { font-size: 0.85rem; }
    .cond-btn { padding: 0.5rem 0.8rem; font-size: 0.76rem; }
    .cond-btn .cond-sub { font-size: 0.58rem; letter-spacing: 1px; }
    .mode-button { font-size: 0.8rem; padding: 0.55rem 0.9rem; }
}
