/* REDSHIFT // THE DAILY DIVE (static/js/games/redshift.js). Krillion's layout in BruNet's holo:
   the canvas is the water column, everything over it is HTML. No backdrop-filter, no looping
   animation on big surfaces (the canvas already repaints). */
.rsh-root { --fc: #4fe3ff; --fa: var(--amber, #ffb020); }
.rsh-stage { position: relative; height: clamp(480px, calc(100vh - var(--nav-h, 48px) - 150px), 820px); border: 1px solid rgba(79, 227, 255, .35);
  border-radius: 10px; overflow: hidden; background: #03060d; isolation: isolate;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 0 40px rgba(79, 227, 255, .08) inset; }
.rsh-sea { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rsh-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px); }

/* HUD */
.rsh-hud { position: absolute; z-index: 2; top: 10px; left: 12px; right: 46px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.rsh-gauge { min-width: 104px; padding: 6px 12px 7px; background: rgba(4, 10, 20, .82); border: 1px solid rgba(79, 227, 255, .45);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); font-family: var(--mono); }
.rsh-gauge small { display: block; font-size: 9px; letter-spacing: .3em; color: rgba(160, 210, 235, .7); }
.rsh-gauge b { font-size: 20px; color: var(--fc); text-shadow: 0 0 10px rgba(79, 227, 255, .5); font-variant-numeric: tabular-nums; }
.rsh-gauge.r { text-align: right; } .rsh-gauge.r b { color: var(--fa); text-shadow: 0 0 10px rgba(255, 176, 32, .45); }
.rsh-pips { text-align: center; font-family: var(--mono); }
.rsh-pips > div { display: flex; gap: 4px; justify-content: center; }
.rsh-pips i { width: 14px; height: 14px; border: 1px solid rgba(79, 227, 255, .5); background: rgba(4, 10, 20, .8); }
.rsh-pips i.now { border-color: var(--fa); box-shadow: 0 0 8px var(--fa); }
.rsh-pips i.t0 { background: #2a3442; } .rsh-pips i.t1 { background: #a9bdd2; } .rsh-pips i.t2 { background: #4fe3ff; }
.rsh-pips i.t3 { background: #3fe0a0; } .rsh-pips i.t4 { background: #ffb020; } .rsh-pips i.t5 { background: #ff7a3d; }
.rsh-pips i.t6 { background: #ff4fa3; box-shadow: 0 0 8px #ff4fa3; }
.rsh-pips small { display: block; margin-top: 4px; font-size: 9px; letter-spacing: .3em; color: rgba(160, 210, 235, .75); }

/* the middle */
.rsh-center { position: absolute; z-index: 3; left: 0; right: 40px; top: 70px; bottom: 96px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 0 16px; font-family: var(--mono); pointer-events: none; }
.rsh-center > * { pointer-events: auto; }
.rsh-lobby { text-align: center; max-width: 560px; height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
.rsh-sky { padding-top: 2%; }
.rsh-deep { padding-bottom: 4px; }
.rsh-title { position: relative; margin: 0; font: 900 clamp(46px, 9vw, 92px)/1 var(--mono) !important; letter-spacing: .14em; color: #e9fbff;
  text-shadow: -3px 0 rgba(255, 79, 163, .75), 3px 0 rgba(79, 227, 255, .8), 0 0 24px rgba(79, 227, 255, .35); }
.rsh-sub { margin-top: 8px; color: var(--fc); letter-spacing: .5em; font-size: 14px; }
.rsh-tag { color: rgba(200, 225, 240, .8); font-size: 12px; letter-spacing: .08em; margin: 10px 0; }
.rsh-cats { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 6px 0 10px; }
.rsh-cats span { font-size: 9px; letter-spacing: .18em; padding: 3px 7px; border: 1px solid rgba(79, 227, 255, .35); color: rgba(190, 230, 245, .9); background: rgba(4, 10, 20, .6); }
.rsh-how { margin: 8px auto; text-align: left; max-width: 460px; font-size: 11px; color: rgba(210, 230, 245, .85); }
.rsh-how summary { cursor: pointer; letter-spacing: .2em; color: rgba(160, 210, 235, .8); text-align: center; list-style: none; }
.rsh-how ul { margin: 8px 0; padding: 10px 14px 10px 26px; background: rgba(4, 10, 20, .85); border: 1px solid rgba(79, 227, 255, .3); }
.rsh-how li { margin: 3px 0; text-transform: uppercase; letter-spacing: .06em; }
.rsh-tiers { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.rsh-tiers span { font-size: 9px; padding: 2px 6px; border: 1px solid var(--c); color: var(--c); letter-spacing: .12em; }
.rsh-begin, .rsh-next { display: block; margin: 14px auto 8px; padding: 16px 34px; min-width: min(420px, 90%); cursor: pointer;
  font: 700 17px var(--mono) !important; letter-spacing: .3em; color: #e9fbff; background: rgba(6, 16, 30, .92);
  border: 2px solid var(--fc); box-shadow: 0 0 0 3px rgba(79, 227, 255, .15), 0 0 22px rgba(79, 227, 255, .35); }
.rsh-begin:hover, .rsh-next:hover { background: rgba(14, 40, 60, .95); }
.rsh-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; letter-spacing: .2em; color: rgba(160, 210, 235, .7); max-width: 420px; margin: 0 auto; }

.rsh-card { width: min(560px, 100%); padding: 18px 22px 16px; background: rgba(6, 14, 26, .92); border: 1px solid rgba(79, 227, 255, .5);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); animation: rsh-in .35s ease-out; }
.rsh-kicker { font-size: 10px; letter-spacing: .35em; color: #ff4fa3; }
.rsh-q { margin: 10px 0 8px; font-size: clamp(20px, 3.4vw, 28px); font-weight: 700; color: #f2fcff; line-height: 1.25; }
.rsh-dim { color: rgba(160, 210, 235, .4); }
.rsh-hint { font-size: 10px; letter-spacing: .2em; color: rgba(160, 210, 235, .6); }
.rsh-status { padding: 8px 16px; font-size: 11px; letter-spacing: .14em; color: rgba(200, 230, 245, .85); background: rgba(4, 10, 20, .85); border: 1px solid rgba(79, 227, 255, .3); }
.rsh-status b { color: var(--fc); }

.rsh-chip { padding: 8px 18px; font-size: 18px; font-weight: 700; letter-spacing: .1em; color: var(--c); background: rgba(6, 14, 26, .9);
  border: 1px solid var(--c); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 40%, transparent); text-transform: uppercase; animation: rsh-sink 1.9s ease-in forwards; }
.rsh-reveal { text-align: center; color: var(--c); animation: rsh-in .4s ease-out; }
.rsh-beast { width: 84px; height: 84px; margin: 0 auto; filter: drop-shadow(0 0 10px var(--c)); }
.rsh-beast svg { width: 100%; height: 100%; }
.rsh-tier { position: relative; font-size: clamp(30px, 6vw, 48px); font-weight: 900; letter-spacing: .18em; color: var(--c);
  text-shadow: 0 0 18px var(--c); animation: rsh-glitch .6s steps(6) 1; }
.rsh-said { margin-top: 6px; font-size: 17px; color: #f2fcff; letter-spacing: .06em; }
.rsh-pts { margin-top: 10px; font-size: 15px; color: #f2fcff; } .rsh-pts::first-letter { color: var(--c); }
.rsh-line { margin-top: 6px; font-size: 11px; letter-spacing: .1em; color: rgba(200, 225, 240, .7); }
.rsh-reveal .rsh-next { min-width: 200px; padding: 12px 24px; font-size: 14px !important; border-color: var(--c); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 45%, transparent); }

.rsh-results { width: min(620px, 100%); max-height: 100%; overflow: auto; padding: 16px 18px; background: rgba(6, 14, 26, .93);
  border: 1px solid rgba(79, 227, 255, .5); text-align: center; animation: rsh-in .4s ease-out; }
.rsh-big { font-size: clamp(40px, 8vw, 64px); font-weight: 900; color: var(--fa); text-shadow: 0 0 20px rgba(255, 176, 32, .5); }
.rsh-zone { font-size: 11px; letter-spacing: .3em; color: var(--fc); margin-bottom: 10px; }
.rsh-picks { list-style: none; margin: 0; padding: 0; text-align: left; }
.rsh-picks li { display: grid; grid-template-columns: 1fr auto auto 34px; gap: 8px; align-items: baseline; padding: 5px 4px; border-bottom: 1px dashed rgba(79, 227, 255, .15); font-size: 12px; }
.rsh-picks .q { color: rgba(190, 215, 230, .7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rsh-picks .a { color: #f2fcff; } .rsh-picks b { color: var(--c); font-size: 10px; letter-spacing: .12em; } .rsh-picks em { color: var(--c); font-style: normal; text-align: right; }
.rsh-share { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 12px; }
.rsh-share code { font-size: 12px; color: rgba(220, 240, 250, .9); text-align: left; }
.rsh-share button, .rsh-unk button { font: 700 11px var(--mono) !important; letter-spacing: .2em; padding: 6px 12px; color: var(--fc); background: transparent; border: 1px solid var(--fc); cursor: pointer; }

/* the dock */
.rsh-dock { position: absolute; z-index: 4; left: 0; right: 34px; bottom: 0; display: flex; gap: 10px; align-items: center; justify-content: center;
  flex-wrap: wrap; padding: 14px 16px 16px; background: linear-gradient(transparent, rgba(2, 5, 10, .92) 35%); font-family: var(--mono); }
.rsh-dock.hidden { display: none; }
.rsh-clock { position: relative; width: 48px; height: 48px; flex: none; }
.rsh-clock svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rsh-clock circle { stroke-width: 3; fill: rgba(4, 10, 20, .9); }
.rsh-clock .bg { stroke: rgba(79, 227, 255, .2); }
.rsh-clock .fg { fill: none; stroke: var(--fc); stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke .3s; }
.rsh-clock .fg.low { stroke: var(--alert, #ff5a4a); }
.rsh-clock b { position: absolute; inset: 0; display: grid; place-items: center; color: var(--fc); font-size: 15px; }
.rsh-field { position: relative; flex: 1; max-width: 440px; min-width: 160px; }
.rsh-field input { width: 100%; box-sizing: border-box; padding: 13px 14px; font: 16px var(--mono); color: #f2fcff; background: rgba(4, 10, 20, .92);
  border: 1px solid rgba(79, 227, 255, .7); outline: none; }
.rsh-field input:focus { box-shadow: 0 0 0 2px rgba(79, 227, 255, .2), 0 0 16px rgba(79, 227, 255, .25); }
.rsh-field i { position: absolute; left: 0; right: 0; bottom: -5px; height: 3px; background: var(--fc); transform-origin: left; }
.rsh-go { flex: none; padding: 13px 20px; font: 700 14px var(--mono) !important; letter-spacing: .25em; color: #fff; cursor: pointer;
  background: #8a2456; border: 1px solid #ff4fa3; box-shadow: 0 0 14px rgba(255, 79, 163, .35); }
.rsh-go:disabled { opacity: .5; }
.rsh-note { flex-basis: 100%; text-align: center; min-height: 14px; font-size: 11px; letter-spacing: .14em; color: rgba(190, 220, 235, .7); }
.rsh-note.bad { color: #ff7a8a; }

/* below the stage */
.rsh-below { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 10px; }
.rsh-panel h3 { margin: 0 0 8px; font: 700 11px var(--mono); letter-spacing: .3em; color: var(--fc); }
.rsh-wide { grid-column: 1 / -1; }
.rsh-board { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 12px; }
.rsh-board li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 4px 2px; border-bottom: 1px dashed rgba(79, 227, 255, .12); }
.rsh-board li.me span { color: var(--fa); }
.rsh-board s { text-decoration: none; color: var(--c); }
.rsh-board b { color: var(--fc); }
.rsh-chart { border-bottom: 1px dashed rgba(79, 227, 255, .15); padding: 6px 0; font-family: var(--mono); font-size: 12px; }
.rsh-chart summary { cursor: pointer; }
.rsh-chart summary span { font-size: 9px; letter-spacing: .2em; color: #ff4fa3; margin-right: 6px; }
.rsh-chart summary b { color: var(--c); margin-left: 6px; }
.rsh-chart-b { display: grid; gap: 6px; padding: 8px 0 4px 10px; }
.rsh-chart-b small { display: block; font-size: 9px; letter-spacing: .25em; color: rgba(160, 210, 235, .6); margin-bottom: 3px; }
.rsh-chart-b span { display: inline-block; margin: 0 4px 4px 0; padding: 2px 7px; border: 1px solid rgba(79, 227, 255, .25); }
.rsh-chart-b .dc { border-color: #ff4fa3; color: #ffc2e0; }
.rsh-chart-b .sq { border-color: var(--c); color: var(--c); }
.rsh-unk { list-style: none; margin: 0; padding: 0; font: 12px var(--mono); }
.rsh-unk li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dashed rgba(79, 227, 255, .12); }
.rsh-unk span { color: rgba(190, 215, 230, .7); } .rsh-unk b { color: #f2fcff; } .rsh-unk em { color: rgba(160, 210, 235, .6); font-style: normal; }
.rsh-unk select { font: 11px var(--mono); background: #06101d; color: #e9fbff; border: 1px solid rgba(79, 227, 255, .4); }

@keyframes rsh-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rsh-sink { 0% { transform: translateY(-30px); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(60px); opacity: .9; } }
@keyframes rsh-glitch { 0% { transform: translateX(-4px); opacity: .2; clip-path: inset(40% 0 30% 0); } 33% { transform: translateX(3px); clip-path: inset(10% 0 60% 0); }
  66% { transform: translateX(-2px); clip-path: inset(60% 0 5% 0); opacity: .8; } 100% { transform: none; clip-path: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rsh-card, .rsh-reveal, .rsh-results, .rsh-chip, .rsh-tier { animation: none; } }
@media (max-width: 620px) {
  .rsh-stage { height: clamp(480px, calc(100vh - var(--nav-h, 48px) - 120px), 760px); }
  .rsh-gauge { min-width: 76px; padding: 5px 8px; } .rsh-gauge b { font-size: 16px; }
  .rsh-hud { flex-wrap: wrap; row-gap: 6px; }
  .rsh-pips { order: 3; flex-basis: 100%; }
  .rsh-pips i { width: 10px; height: 10px; }
  .rsh-picks li { grid-template-columns: 1fr auto 34px; }
  .rsh-picks .q { grid-column: 1 / -1; white-space: normal; font-size: 11px; }
  .rsh-center { top: 96px; bottom: 120px; right: 34px; padding: 0 10px; }
  .rsh-go { padding: 13px 14px; }
}
