/* Achievements, the Bear Den and the 90s sound toggle (fun.js). Kept apart from styles.css so these can change on
   their own; they use the same tokens. */

/* The speaker toggle in the header. Off by default; lit yellow when on. */
.snd { flex: none; display: grid; place-content: center; width: 40px; height: 40px; padding: 0; border-radius: 999px; cursor: pointer;
  color: var(--soft); background: transparent; border: 2px solid rgba(195, 195, 238, .35); }
.snd:hover { color: var(--label); border-color: var(--label); }
.snd[aria-pressed="true"] { color: var(--sticker); border-color: var(--sticker); box-shadow: 0 0 10px rgba(255, 216, 58, .35); }
.snd:focus-visible { outline: 3px solid var(--sticker); outline-offset: 2px; }
@media (max-width: 860px) {
  .bar > .snd { margin-left: auto; width: 36px; height: 36px; }
  .bar > .snd + .btn { margin-left: 0; }
}

/* ---- The Bear Den: open short interest per stock, a pink meter each. */
.den:empty, .ach:empty { display: none; }
.den { margin-top: 22px; padding: 18px 22px 16px; border-radius: 10px; background: var(--tape); color: var(--label);
  box-shadow: inset 0 0 0 1px var(--tape-edge), 0 6px 0 rgba(0, 0, 0, .28); }
.den-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.den-head h2 { margin: 0; font-size: 24px; }
.den-sub { color: var(--soft); font-size: 15px; }
.den-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.den-row { display: grid; grid-template-columns: 62px minmax(90px, 1fr) minmax(0, auto) minmax(0, auto); gap: 6px 16px; align-items: center; font-variant-numeric: tabular-nums; }
.den-row.none { opacity: .45; }
.den-tk { font: 22px VT323, ui-monospace, monospace; letter-spacing: .05em; }
.den-meter { display: block; height: 10px; border-radius: 5px; background: #2b2b36; overflow: hidden; }
.den-meter > i { display: block; height: 100%; border-radius: inherit; background: var(--neon); box-shadow: 0 0 10px rgba(255, 79, 154, .7); }
.den-line { font-size: 15px; font-weight: 600; white-space: nowrap; }
.den-flow { color: var(--soft); font-size: 13px; white-space: nowrap; text-align: right; }
.den-foot { margin: 12px 0 0; color: var(--soft); font-size: 13px; }
.den-none { color: var(--soft); font-size: 14px; padding-top: 2px; }
.den-quiet { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.den-quiet p { margin: 0; font-family: var(--hand); font-size: 24px; color: var(--sticker); }
.den-empty { margin: 12px 0 0; color: var(--soft); }
.den-more { margin-top: 10px; padding: 0; background: none; border: 0; color: var(--sticker); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.den-compact { margin-top: 18px; }
.den-compact .den-row { grid-template-columns: 56px minmax(70px, 1fr) minmax(0, auto); }
.den-compact .den-flow { display: none; }
@media (max-width: 620px) {
  .den { padding: 16px; }
  .den-row { grid-template-columns: 56px minmax(0, 1fr); }
  .den-line, .den-flow { grid-column: 2; text-align: left; white-space: normal; }
  .den-compact .den-row { grid-template-columns: 56px minmax(0, 1fr); }
}

/* The Terminal watchlist's bear tag and bar, under each row. */
#tWatch li { position: relative; }
#tWatch li.has-bears { padding-bottom: 17px; }
#tWatch .tw-bear { position: absolute; left: 12px; bottom: 2px; font: 13px VT323, ui-monospace, monospace; font-style: normal; letter-spacing: .04em; color: var(--t-down, #ff4f9a); white-space: nowrap; }
#tWatch .tw-bar { position: absolute; left: 112px; right: 12px; bottom: 7px; height: 2px; }
#tWatch .tw-bar > i { display: block; height: 100%; background: var(--t-down, #ff4f9a); box-shadow: 0 0 6px rgba(255, 79, 154, .7); }
@media (max-width: 1100px) {
  #tWatch li.has-bears { padding-bottom: 18px; }
  #tWatch .tw-bar { left: 10px; right: 10px; bottom: 2px; }
  #tWatch .tw-bear { left: 10px; bottom: 5px; }
}

/* The Terminal's badge row on the Positions tab. */
.t-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--t-line, #23233a); }
.t-badges-k, .t-badges-none, .t-badge { font: 16px VT323, ui-monospace, monospace; letter-spacing: .06em; }
.t-badges-k { color: var(--t-dim, #8d8ab0); margin-right: 4px; }
.t-badges-none { color: var(--t-dim, #8d8ab0); }
.t-badge { color: var(--sticker); background: #12121f; border: 1px solid var(--t-line, #23233a); border-radius: 4px; padding: 1px 8px; cursor: pointer; }
.t-badge:hover { border-color: var(--sticker); }

/* ---- Achievements: a shelf of tapes, each badge a label. Lit when unlocked, grey and dim when locked. */
.ach { margin-top: 26px; padding: 20px 22px 18px; border-radius: 10px; background: var(--tape); color: var(--label); box-shadow: inset 0 0 0 1px var(--tape-edge), 0 6px 0 rgba(0, 0, 0, .28); }
.ach-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.ach-head h2 { margin: 0; font-size: 24px; }
.ach-head .hand { font-size: 22px; color: var(--sticker); }
.ach-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tape-badge { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px; border-radius: 6px; background: #1b1b24; box-shadow: inset 0 0 0 1px #2b2b36; }
.tb-label { position: relative; display: grid; gap: 2px; padding: 16px 12px 10px; border-radius: 3px; background: var(--label); color: var(--ink); min-height: 118px; }
.tb-label::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 7px; border-radius: 3px 3px 0 0; background: var(--neon); }
.tape-badge.s1 .tb-label::before { background: var(--mint); }
.tape-badge.s2 .tb-label::before { background: var(--sticker); }
.tb-emoji { font-size: 30px; line-height: 1.1; }
.tb-label b { font-size: 17px; font-weight: 800; }
.tb-label small { font-size: 13px; line-height: 1.3; color: #55557a; }
.tape-badge.off .tb-label { filter: grayscale(1); opacity: .5; }
.tape-badge.on { box-shadow: inset 0 0 0 1px var(--sticker), 0 0 14px rgba(255, 216, 58, .18); }
.tb-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tb-tx { color: var(--soft); font-size: 13px; }
.ach-note { margin: 14px 0 0; color: var(--soft); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
@media (max-width: 980px) { .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .ach { padding: 16px 14px; } .ach-grid { gap: 8px; } .tb-label { padding: 14px 10px 8px; min-height: 0; } }
