/* AFTERGLOW // THE DAILY COLOUR (static/js/games/afterglow.js). BruNet's holo look round a dark stage; the only
   colour that matters is the body's, so everything near it is greys and the holo line. No backdrop-filter, no
   looping animation (the memorise clock is one transition). */
.ag-root { --ac: var(--holo, #4fe3ff); --aa: var(--amber, #ffb020); }
.ag-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 12px 18px;
  min-height: clamp(460px, calc(100vh - var(--nav-h, 48px) - 150px), 760px); border: 1px solid rgba(79, 227, 255, .35); border-radius: 10px;
  background: radial-gradient(120% 80% at 50% 0%, #0a1424 0%, #03060d 70%); box-shadow: 0 0 40px rgba(79, 227, 255, .06) inset; font-family: var(--mono); }
.ag-stage .hidden { display: none !important; }

/* HUD */
.ag-hud { width: 100%; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ag-gauge { min-width: 84px; 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)); }
.ag-gauge small { display: block; font-size: 9px; letter-spacing: .3em; color: rgba(160, 210, 235, .7); }
.ag-gauge b { font-size: 20px; color: var(--aa); font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(255, 176, 32, .45); }
.ag-gauge.r { text-align: right; } .ag-gauge.r b { color: var(--ac); text-shadow: 0 0 10px rgba(79, 227, 255, .45); }
.ag-pips { text-align: center; flex: 1; }
.ag-pips > div { display: flex; gap: 6px; justify-content: center; }
.ag-pips i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(79, 227, 255, .5); background: rgba(4, 10, 20, .8); }
.ag-pips i.now { border-color: var(--aa); box-shadow: 0 0 8px var(--aa); }
.ag-pips i.done { border-color: rgba(255, 255, 255, .5); background: linear-gradient(90deg, var(--t) 50%, var(--g) 50%); }
.ag-pips small { display: block; margin-top: 5px; font-size: 9px; letter-spacing: .25em; color: rgba(160, 210, 235, .75); }

/* the middle */
.ag-view { width: 100%; display: flex; justify-content: center; }
.ag-cap { font-size: 11px; letter-spacing: .3em; color: rgba(200, 230, 245, .85); text-align: center; }
.ag-lobby { text-align: center; max-width: 560px; padding: 10px 0; }
.ag-title { font: 900 clamp(40px, 9vw, 84px)/1 var(--mono) !important; letter-spacing: .12em; color: #f4fbff;
  text-shadow: -3px 0 rgba(255, 79, 163, .7), 3px 0 rgba(79, 227, 255, .75), 0 0 26px rgba(255, 176, 32, .25); }
.ag-sub { margin-top: 8px; color: var(--ac); letter-spacing: .5em; font-size: 13px; }
.ag-spectrum { height: 6px; margin: 14px auto 4px; width: min(420px, 90%); border-radius: 3px;
  background: linear-gradient(90deg, #ff3b3b, #ffb020, #fff36a, #4fff9a, #4fe3ff, #6b7bff, #ff4fd8); box-shadow: 0 0 18px rgba(255, 255, 255, .15); }
.ag-tag { color: rgba(200, 225, 240, .8); font-size: 12px; letter-spacing: .08em; margin: 10px 0; }
.ag-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 6px 0 10px; }
.ag-chips span, .ag-grades 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); }
.ag-grades { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.ag-how { margin: 8px auto; text-align: left; max-width: 460px; font-size: 11px; color: rgba(210, 230, 245, .85); }
.ag-how summary { cursor: pointer; letter-spacing: .2em; color: rgba(160, 210, 235, .8); text-align: center; list-style: none; padding: 6px; }
.ag-how ul { margin: 8px 0; padding: 10px 14px 10px 26px; background: rgba(4, 10, 20, .85); border: 1px solid rgba(79, 227, 255, .3); }
.ag-how li { margin: 3px 0; letter-spacing: .04em; }
.ag-begin, .ag-next, .ag-go { display: block; margin: 14px auto 8px; padding: 16px 30px; min-width: min(380px, 92%); min-height: 52px; cursor: pointer;
  font: 700 16px var(--mono) !important; letter-spacing: .28em; color: #e9fbff; background: rgba(6, 16, 30, .92);
  border: 2px solid var(--ac); box-shadow: 0 0 0 3px rgba(79, 227, 255, .15), 0 0 22px rgba(79, 227, 255, .3); touch-action: manipulation; }
.ag-begin:hover, .ag-next:hover, .ag-go:hover { background: rgba(14, 40, 60, .95); }
.ag-go { border-color: var(--aa); box-shadow: 0 0 0 3px rgba(255, 176, 32, .15), 0 0 22px rgba(255, 176, 32, .3); }
.ag-go:disabled { opacity: .5; cursor: default; }
.ag-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 10px; letter-spacing: .2em; color: rgba(160, 210, 235, .7); max-width: 420px; margin: 0 auto; }
.ag-log { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 46px; width: min(320px, 90%); margin: 14px auto 0; padding-bottom: 14px; }
.ag-log i { flex: 1; background: linear-gradient(0deg, rgba(79, 227, 255, .25), var(--ac)); min-width: 4px; }
.ag-log small { position: absolute; bottom: 0; left: 0; right: 0; font-size: 8px; letter-spacing: .3em; color: rgba(160, 210, 235, .6); }

/* the dial: the hue ring round the body */
.ag-dial { position: relative; width: min(80vw, 340px); aspect-ratio: 1; border-radius: 50%; touch-action: none; user-select: none; outline: none; }
.ag-dial:focus-visible { box-shadow: 0 0 0 2px var(--aa); }
.ag-ring { position: absolute; inset: 0; border-radius: 50%; opacity: 0; transition: opacity .25s;
  background: conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 24px), #000 calc(100% - 23px));
  mask: radial-gradient(circle closest-side, transparent calc(100% - 24px), #000 calc(100% - 23px)); }
.ag-dial.on { cursor: grab; }
.ag-dial.on .ag-ring { opacity: 1; }
.ag-thumb { position: absolute; inset: 0; pointer-events: none; display: none; }
.ag-dial.on .ag-thumb { display: block; }
.ag-thumb::after { content: ""; position: absolute; left: 50%; top: -2px; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%;
  background: var(--c, #f00); border: 3px solid #fff; box-shadow: 0 0 0 1px #000, 0 2px 8px rgba(0, 0, 0, .6); }
.ag-clock { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.ag-dial.on .ag-clock { display: none; }
.ag-clock circle { fill: none; stroke-width: 2.4; }
.ag-clock .bg { stroke: rgba(79, 227, 255, .15); }
.ag-clock .fg { stroke: var(--aa); stroke-dasharray: 295.3; stroke-dashoffset: 0; filter: drop-shadow(0 0 4px rgba(255, 176, 32, .7)); }
.ag-body { position: absolute; inset: 30px; width: calc(100% - 60px); height: calc(100% - 60px); border-radius: 50%; display: block;
  box-shadow: 0 0 0 1px rgba(79, 227, 255, .25); }

.ag-controls { width: min(440px, 100%); display: flex; flex-direction: column; gap: 10px; }
.ag-slide { display: grid; grid-template-columns: 96px 1fr 34px; align-items: center; gap: 10px; font-size: 10px; letter-spacing: .2em; color: rgba(190, 225, 240, .85); }
.ag-slide b { text-align: right; color: #e9fbff; font-variant-numeric: tabular-nums; font-size: 13px; letter-spacing: 0; }
.ag-slide input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; margin: 10px 0; padding: 0; border-radius: 9px; flex: none;
  border: 1px solid rgba(255, 255, 255, .25); background: #333; touch-action: pan-y; cursor: pointer; }
.ag-slide input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff;
  border: 3px solid #0a1424; box-shadow: 0 0 0 1px #fff, 0 2px 8px rgba(0, 0, 0, .6); }
.ag-slide input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid #0a1424; }
.ag-slide input[type=range]::-moz-range-track { background: transparent; }
.ag-read { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11px; letter-spacing: .14em; color: rgba(190, 225, 240, .8); }
.ag-read i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, .4); }

/* the reveal */
.ag-reveal { text-align: center; width: min(520px, 100%); }
.ag-split { display: grid; grid-template-columns: 1fr 1fr; height: clamp(150px, 34vh, 240px); border: 1px solid rgba(255, 255, 255, .25); border-radius: 10px; overflow: hidden; }
.ag-split > div { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 10px; }
.ag-split small, .ag-split b { align-self: flex-start; padding: 2px 6px; background: rgba(3, 6, 13, .78); color: #e9fbff; font-size: 10px; letter-spacing: .14em; }
.ag-split small { color: rgba(160, 210, 235, .85); }
.ag-sc { margin-top: 12px; font: 900 64px/1 var(--mono) !important; color: var(--c); text-shadow: 0 0 22px var(--c); }
.ag-grade { margin-top: 4px; letter-spacing: .4em; font-size: 14px; color: #f2fcff; }
.ag-line { margin-top: 6px; font-size: 11px; color: rgba(190, 225, 240, .75); letter-spacing: .06em; }

/* results */
.ag-results { width: min(560px, 100%); text-align: center; }
.ag-kicker { font-size: 10px; letter-spacing: .35em; color: #ff4fa3; }
.ag-big { margin: 8px 0; font: 900 clamp(44px, 9vw, 72px)/1 var(--mono) !important; color: var(--aa); text-shadow: 0 0 22px rgba(255, 176, 32, .45); }
.ag-big small { font-size: .4em; color: rgba(160, 210, 235, .7); }
.ag-pairs { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ag-pairs li { display: grid; grid-template-columns: 34px 34px 1fr auto 40px; gap: 8px; align-items: center; padding: 5px 8px;
  background: rgba(4, 10, 20, .7); border: 1px solid rgba(79, 227, 255, .2); font-size: 11px; letter-spacing: .1em; text-align: left; }
.ag-pairs .sw { height: 28px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .3); }
.ag-pairs .nm { color: rgba(190, 225, 240, .8); }
.ag-pairs b { color: #e9fbff; font-weight: 600; }
.ag-pairs em { font-style: normal; text-align: right; color: var(--aa); font-weight: 700; }
.ag-share { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.ag-share code { padding: 6px 10px; background: rgba(4, 10, 20, .85); border: 1px solid rgba(79, 227, 255, .3); color: #e9fbff; font-size: 12px; text-align: left; }
.ag-share button { padding: 10px 16px; min-height: 40px; }

/* below the stage */
.ag-below { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.ag-wide { grid-column: 1 / -1; }
.ag-panel h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .3em; }
.ag-board { list-style: none; margin: 0; padding: 0; counter-reset: ag; }
.ag-board li { display: grid; grid-template-columns: 1fr auto 56px; gap: 8px; align-items: center; padding: 5px 4px; border-bottom: 1px solid rgba(79, 227, 255, .12); font-family: var(--mono); font-size: 12px; }
.ag-board li.me { background: rgba(255, 176, 32, .08); }
.ag-board li span::before { counter-increment: ag; content: counter(ag) ". "; color: rgba(160, 210, 235, .6); }
.ag-board i { font-style: normal; letter-spacing: 1px; color: var(--ac); }
.ag-board s { text-decoration: none; }
.ag-board b { text-align: right; color: var(--aa); }
.ag-sq { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; padding: 6px 0; border-bottom: 1px solid rgba(79, 227, 255, .12); }
.ag-sq .lab { width: 70px; font-size: 10px; letter-spacing: .2em; color: rgba(160, 210, 235, .75); align-self: center; }
.ag-sq .sw { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); }
.ag-sq .sw.big { width: 44px; height: 44px; box-shadow: 0 0 0 2px var(--aa); margin-right: 6px; }
.ag-sq .sw small { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-size: 8px; color: rgba(190, 225, 240, .7); white-space: nowrap; }
.ag-sq { padding-bottom: 16px; }

@media (max-width: 520px) {
  .ag-stage { padding: 10px 8px 14px; }
  .ag-gauge { min-width: 64px; padding: 5px 8px; }
  .ag-gauge b { font-size: 17px; }
  .ag-pips i { width: 18px; height: 18px; }
  .ag-slide { grid-template-columns: 80px 1fr 30px; }
  .ag-dial { width: min(78vw, 300px); }
}

/* touch: the saturation and brightness sliders a fingertip tall */
@media (pointer: coarse) { #tab-afterglow input[type="range"] { min-height: 34px; } }
