/*
 * tunnel.css — "Jejak Terowongan" (Tunnel Trail), the second daily per-node
 * minigame (js/tunnel.js). 2026-09-06: converted from a small centered modal
 * to a FULLSCREEN takeover ("kasih visual gamenya biar bagus, keduanya
 * fullscreen"), same as minigame.css's Drill Strike treatment — but kept
 * deliberately a DIFFERENT visual mood: where Drill Strike is a bright,
 * warm rock-strata shaft, this is a dim, near-black torch-lit cave — dark
 * stone card, ember/gold accents glowing out of the dark, so the two
 * minigames read as genuinely different places to be, not two skins of one
 * screen.
 */

.tn-fullscreen {
    position: fixed; inset: 0; z-index: 1100;
    display: flex; align-items: center; justify-content: center;
    padding: 28px 18px;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255,140,60,.10), transparent 65%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(120,60,20,.12), transparent 70%),
        linear-gradient(180deg, #120c07 0%, #0a0705 50%, #050403 100%);
    overflow-y: auto;
}

.tn-fs-close {
    position: fixed; top: 18px; right: 18px; z-index: 2;
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.5); border: 1.5px solid rgba(255,150,60,.3);
    color: #ffb347; font-size: 16px; cursor: pointer;
    transition: background .15s, transform .15s;
}
.tn-fs-close:hover { background: rgba(0,0,0,.8); transform: scale(1.08); }

.tn-fs-frame {
    position: relative; z-index: 1;
    width: 100%; max-width: 560px; max-height: 100%;
    margin: 0 auto;
}
.tn-fs-body {
    background: linear-gradient(165deg, #241a12 0%, #1a130c 55%, #120d08 100%);
    border: 1px solid rgba(255,150,60,.16);
    border-radius: 18px;
    padding: 30px 26px 26px;
    box-shadow: 0 24px 60px rgba(0,0,0,.65), inset 0 0 50px rgba(0,0,0,.4), 0 0 0 1px rgba(255,150,60,.05);
    color: #e8d0a8;
}

/* ── Hero icon — a torch, a chamber icon, or an outcome glyph, big and
   central at the top of every screen. ───────────────────────────────────── */
.tn-hero { font-size: 46px; text-align: center; margin-bottom: 8px; filter: drop-shadow(0 0 10px rgba(255,140,60,.5)); }
.tn-hero-flicker { animation: tn-flicker 1.8s ease-in-out infinite; }
@keyframes tn-flicker {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 12px rgba(255,150,60,.7)); transform: scale(1); }
    45%      { opacity: .88; filter: drop-shadow(0 0 6px rgba(255,150,60,.35)); transform: scale(.97); }
    60%      { opacity: 1; filter: drop-shadow(0 0 16px rgba(255,150,60,.8)); transform: scale(1.02); }
}
.tn-hero-glow { animation: tn-glow-pulse 1.6s ease-in-out infinite; }
@keyframes tn-glow-pulse {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255,215,0,.4)); }
    50%      { filter: drop-shadow(0 0 30px rgba(255,215,0,.9)); }
}
.tn-hero-shake { animation: tn-shake .5s ease-in-out; }
@keyframes tn-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px) rotate(-3deg); }
    40%      { transform: translateX(6px) rotate(3deg); }
    60%      { transform: translateX(-4px) rotate(-2deg); }
    80%      { transform: translateX(4px) rotate(2deg); }
}

.tn-title {
    font-family: var(--font-title); font-size: 22px; font-weight: 900;
    color: #ffd88a; letter-spacing: 2px; text-align: center; margin-bottom: 6px;
}
.tn-sub { font-size: 12px; color: rgba(232,208,168,.65); text-align: center; margin-bottom: 18px; letter-spacing: .3px; }
.tn-hint { font-size: 12.5px; color: rgba(232,208,168,.55); text-align: center; line-height: 1.6; margin: 12px 0; }
.tn-lbl { font-size: 12.5px; color: rgba(232,208,168,.6); letter-spacing: .3px; }

.tn-plays-row {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(0,0,0,.28); border: 1px solid rgba(255,150,60,.15); border-radius: 10px;
    padding: 10px 16px; font-size: 12px; color: #e8d0a8; margin-bottom: 14px;
}
.tn-plays-row strong { font-size: 15px; color: #ff9d4d; }

.tn-pool-row { margin-bottom: 6px; }
.tn-pool-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tn-pool-item {
    width: 38px; height: 38px; border-radius: 9px;
    background: rgba(0,0,0,.3); border: 1px solid rgba(255,150,60,.2);
    display: flex; align-items: center; justify-content: center; font-size: 19px;
}

/* ── Cave map (pre-expedition briefing) — a vertical descending trail, one
   node per chamber joined by a torch-lit path line, read top-to-bottom as
   "further into the cave" — the risk climbing down the trail is the whole
   point of the briefing, meant to be read as a map, not a stat table. ───── */
.tn-map-row { margin: 16px 0 8px; }
.tn-map-list { position: relative; margin-top: 10px; max-height: 280px; overflow-y: auto; padding: 4px 4px 4px 2px; }
.tn-trail-node { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 9px 4px; }
.tn-trail-node:not(:last-child)::after {
    content: ''; position: absolute; left: 20px; top: 40px; bottom: -9px; width: 2px;
    background: linear-gradient(180deg, rgba(255,150,60,.4), rgba(255,150,60,.08));
}
.tn-trail-dot {
    position: relative; z-index: 1; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255,180,80,.3), rgba(0,0,0,.5));
    border: 1.5px solid rgba(255,150,60,.35);
    display: flex; align-items: center; justify-content: center; font-size: 16px;
    box-shadow: 0 0 8px rgba(0,0,0,.6);
}
.tn-trail-info { flex: 1; padding-top: 3px; min-width: 0; }
.tn-trail-name { font-size: 12px; font-weight: 700; color: #e8d0a8; }
.tn-trail-stats { display: flex; gap: 12px; margin-top: 3px; }
.tn-trail-max .tn-trail-dot { background: radial-gradient(circle at 35% 30%, rgba(255,215,0,.45), rgba(0,0,0,.5)); border-color: #ffd700; box-shadow: 0 0 14px rgba(255,215,0,.5); }
.tn-trail-max .tn-trail-name { color: #ffd700; }
.tn-risk-tag { font-size: 12px; font-weight: 700; color: #ff7b6b; }
.tn-reward-tag { font-size: 12px; font-weight: 700; color: #ffb347; }

.tn-start-btn, .tn-again-btn { width: 100%; margin-top: 12px; padding: 16px 12px; font-size: 13px; letter-spacing: .5px; }

/* ── Depth progress pips — mid-run, "how far in am I" replaces the repeated
   screen title (already read once on the briefing screen). ─────────────── */
.tn-depth-track { display: flex; justify-content: center; gap: 6px; margin: 2px 0 16px; }
.tn-pip { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,150,60,.25); }
.tn-pip-done { background: linear-gradient(180deg, #ffb347, #c8641a); border-color: #ffb347; box-shadow: 0 0 6px rgba(255,150,60,.6); }
.tn-pip-next { border-color: #ffd700; box-shadow: 0 0 6px rgba(255,215,0,.55); animation: tn-pip-pulse 1.2s ease-in-out infinite; }
@keyframes tn-pip-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ── In-expedition decision screen ───────────────────────────────────────── */
.tn-depth-row {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(0,0,0,.35); border: 1px solid rgba(255,150,60,.2); border-radius: 10px;
    padding: 12px 16px; margin-bottom: 10px;
}
.tn-depth-badge { font-family: var(--font-title); font-size: 15px; font-weight: 800; color: #ffd88a; }
.tn-bank-preview { font-size: 12.5px; color: rgba(232,208,168,.75); }
.tn-bank-preview strong { color: #ffd700; font-size: 14px; }

.tn-flavor {
    background: radial-gradient(ellipse at 50% -20%, rgba(255,150,60,.14), transparent 70%), rgba(0,0,0,.35);
    border: 1px solid rgba(255,150,60,.15); border-radius: 10px;
    padding: 16px 18px; margin-bottom: 14px; min-height: 50px;
    font-size: 12.5px; color: #e8d0a8; line-height: 1.7; font-style: italic; text-align: center;
}

.tn-next-card {
    background: rgba(0,0,0,.25); border: 1px dashed rgba(255,150,60,.35); border-radius: 10px;
    padding: 14px 16px; margin-bottom: 16px; text-align: center;
}
.tn-next-lbl { font-size: 11px; letter-spacing: 1px; color: rgba(232,208,168,.5); text-transform: uppercase; }
.tn-next-name { font-size: 15px; font-weight: 800; color: #ffd88a; margin-top: 4px; }
.tn-next-stats { display: flex; justify-content: center; gap: 14px; margin-top: 8px; }
.tn-next-stats .tn-risk-tag, .tn-next-stats .tn-reward-tag { font-size: 13px; }

.tn-choice-row { display: flex; gap: 10px; }
.tn-choice-row .ui-btn { flex: 1; padding: 16px 10px; font-size: 12px; letter-spacing: .3px; }
.tn-retreat-btn:disabled { opacity: .35; }

/* ── Footing skill-check ("MAJU" is now this, not a single click) — a
   marker sweeps a bar over a safe-footing zone (amber) with an inner
   precise-footing zone (gold); stopping it there genuinely changes the
   hazard odds server-side, not just the presentation. Same shaft-in-rock
   staging as Drill Strike's track, kept in this game's own dark/ember
   palette. ─────────────────────────────────────────────────────────────── */
.tn-attempt-track {
    position: relative;
    height: 52px; margin: 18px 0 14px;
    background: linear-gradient(180deg, #1c140c 0%, #120d08 100%);
    border: 2px solid rgba(255,150,60,.3);
    border-radius: 12px;
    box-shadow: inset 0 3px 10px rgba(0,0,0,.6);
    overflow: hidden;
}
.tn-attempt-zone-good {
    position: absolute; top: 0; bottom: 0;
    background: rgba(255,180,80,.22);
    border-left: 1px solid rgba(255,180,80,.65);
    border-right: 1px solid rgba(255,180,80,.65);
}
.tn-attempt-zone-precision {
    position: absolute; top: 0; bottom: 0;
    background: rgba(255,215,0,.4);
    border-left: 1px solid #ffd700;
    border-right: 1px solid #ffd700;
}
.tn-attempt-marker {
    position: absolute; top: -3px; bottom: -3px;
    width: 6px; margin-left: -3px;
    background: linear-gradient(180deg, #fff3d6, #ff9d4d);
    box-shadow: 0 0 10px rgba(255,150,60,.9), 0 0 3px rgba(0,0,0,.6);
    border-radius: 3px;
}
.tn-attempt-flash {
    position: absolute; inset: 0; z-index: 4;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.92);
    font-family: var(--font-title); font-weight: 800; font-size: 13px; color: #ffd88a;
    text-align: center; padding: 0 10px;
    opacity: 0; transition: opacity .12s;
}
.tn-attempt-flash-show { opacity: 1; }
.tn-attempt-flash-precision { color: #ffd700; background: rgba(80,60,10,.94); }
.tn-attempt-flash-miss { color: #ff6b5b; background: rgba(60,10,10,.94); }
.tn-attempt-stop-btn { width: 100%; margin-top: 4px; padding: 16px 12px; font-size: 13px; letter-spacing: .5px; }

/* ── Result states ────────────────────────────────────────────────────── */
.tn-result { text-align: center; font-family: var(--font-title); font-weight: 800; font-size: 19px; margin: 4px 0 6px; letter-spacing: .3px; line-height: 1.4; }
.tn-result-jackpot { color: #ffd700; text-shadow: 0 0 20px rgba(255,215,0,.55); }
.tn-result-banked  { color: #5fd97a; }
.tn-result-lost    { color: #ff6b5b; }

.tn-reward-box {
    display: flex; align-items: center; gap: 14px; justify-content: center;
    background: rgba(255,150,60,.08); border: 1px solid rgba(255,150,60,.28); border-radius: 12px;
    padding: 18px; margin: 12px 0;
}
.tn-reward-icon { font-size: 36px; }
.tn-reward-name { font-size: 13px; color: #e8d0a8; font-weight: 700; }
.tn-reward-qty { font-size: 18px; color: #ffb347; font-weight: 800; }

/* ── Per-node profile (lifetime stats + recent history) ─────────────────── */
.tn-profile { margin-top: 20px; padding-top: 16px; border-top: 1px dashed rgba(255,150,60,.2); }
.tn-profile-title { font-size: 12.5px; font-weight: 700; letter-spacing: 1px; color: rgba(232,208,168,.65); margin-bottom: 10px; }
.tn-profile-stats { display: flex; gap: 7px; margin-bottom: 12px; flex-wrap: wrap; }
.tn-profile-stat {
    flex: 1; min-width: 62px; text-align: center; background: rgba(0,0,0,.25); border: 1px solid rgba(255,150,60,.15);
    border-radius: 8px; padding: 8px 3px;
}
.tn-profile-stat strong { display: block; font-size: 14px; color: #e8d0a8; }
.tn-profile-stat span { font-size: 10px; color: rgba(232,208,168,.5); letter-spacing: .3px; }
.tn-profile-jackpot strong { color: #ffd700; }
.tn-profile-lost strong { color: #ff6b5b; }

.tn-hist-list { max-height: 170px; overflow-y: auto; }
.tn-hist-row {
    display: flex; align-items: center; gap: 8px; padding: 6px 2px;
    border-bottom: 1px solid rgba(255,150,60,.08); font-size: 11.5px;
}
.tn-hist-badge { flex: 0 0 auto; padding: 2px 7px; border-radius: 5px; font-weight: 800; font-size: 10px; letter-spacing: .5px; }
.tn-hist-jackpot { background: rgba(255,215,0,.2); color: #ffd700; }
.tn-hist-banked   { background: rgba(95,217,122,.15); color: #5fd97a; }
.tn-hist-lost      { background: rgba(255,107,91,.15); color: #ff8a7a; }
.tn-hist-reward { flex: 1; color: #e8d0a8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-hist-time { flex: 0 0 auto; color: rgba(232,208,168,.4); font-size: 10px; }

@container (max-width: 480px) {
    .tn-fullscreen { padding: 14px 10px; }
    .tn-fs-body { padding: 22px 16px 18px; border-radius: 14px; }
    .tn-hero { font-size: 38px; }
    .tn-title { font-size: 18px; }
}
