/* Troogue: DM Sans, Night Black #0C0C0C, Slate Blue #8670F7,
   Byzantine Blue #2E53ED, Mauve #F9A9FF, White Smoke #F2F2F2.
   One accent per surface; the gradient appears once, as the header rule. */
:root {
  --night: #0C0C0C;
  --slate: #8670F7;
  --byz: #2E53ED;
  --mauve: #F9A9FF;
  --smoke: #F2F2F2;
  --line: #dcdce0;
  --muted: #5c5c63;
  --font: "DM Sans", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55;
  color: var(--night); background: var(--smoke);
  display: flex; flex-direction: column;
}

/* ------------------------------------------------------------------ header */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1.25rem; background: #fff;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--byz), var(--mauve)) 1;
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.wordmark { font-weight: 700; letter-spacing: -.02em; font-size: 1.05rem; }
.wordmark .oo {
  background: linear-gradient(90deg, var(--byz), var(--mauve));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sep { width: 1px; height: 1.1rem; background: var(--line); }
.context { color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-right { display: flex; align-items: center; gap: 1rem; flex: 0 0 auto; }
.who { color: var(--muted); font-size: .875rem; }
.savestate { font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.inline { display: inline; margin: 0; }

/* ------------------------------------------------------------------ layout */
.wrap { max-width: 62rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; width: 100%; }
.bench {
  display: grid; grid-template-columns: 21rem minmax(0, 1fr); gap: 1.25rem;
  padding: 1.25rem; flex: 1 1 auto; min-height: 0;
}
@media (max-width: 60rem) { .bench { grid-template-columns: 1fr; } }
.panel { display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; min-height: 0; }
.editor { display: flex; flex-direction: column; min-height: 0; }

h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 1rem; }
h2 { font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .09em;
     color: var(--muted); margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .9em; }
.error { color: #b00020; font-weight: 500; }
.fineprint { font-size: .8125rem; color: var(--muted); margin: .75rem 0 0; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; }
.login { max-width: 24rem; margin: 3rem auto; }
.note { margin-top: 1.5rem; }
.note ul { margin: .5rem 0 .75rem; padding-left: 1.1rem; }
.note li { margin: .3rem 0; }

/* ----------------------------------------------------------------- controls */
button, select, input { font: inherit; }
.primary {
  background: var(--night); color: #fff; border: 0; border-radius: 7px;
  padding: .55rem 1.1rem; font-weight: 500; cursor: pointer; text-decoration: none;
  display: inline-block;
}
.primary:hover { background: var(--byz); }
.primary:disabled { background: var(--line); color: var(--muted); cursor: default; }
.primary.small { padding: .3rem .75rem; font-size: .875rem; }
.primary.wide { min-width: 7rem; }
.ghost {
  background: #fff; border: 1px solid var(--line); border-radius: 7px;
  padding: .55rem .9rem; cursor: pointer; font-variant-numeric: tabular-nums;
}
.ghost:hover { border-color: var(--slate); }
.link { background: none; border: 0; color: var(--byz); cursor: pointer; padding: 0;
        font-size: .875rem; text-decoration: none; }
.link:hover { text-decoration: underline; }

label { display: block; font-size: .8125rem; color: var(--muted); margin: .75rem 0 .2rem; }
.login input { width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 7px; }
.login button { margin-top: 1.1rem; width: 100%; }

/* ------------------------------------------------------------------ player */
.times { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums;
         font-size: 1.35rem; font-weight: 500; letter-spacing: -.01em; }
.times .muted { font-size: 1rem; font-weight: 400; }
.track { height: 8px; background: var(--smoke); border-radius: 4px; margin: .6rem 0 .9rem;
         cursor: pointer; overflow: hidden; }
.track:focus-visible { outline: 2px solid var(--byz); outline-offset: 2px; }
.track-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--byz), var(--mauve)); }
.transport { display: flex; gap: .5rem; align-items: center; }
.transport .primary { flex: 1 1 auto; }
.player .row { display: grid; grid-template-columns: auto 1fr; gap: .5rem 0.75rem;
               align-items: center; margin-top: .9rem; }
.player .row label { margin: 0; }
.player select, .player input[type=range] { width: 100%; }
.player select { padding: .35rem .4rem; border: 1px solid var(--line); border-radius: 6px; }

.keys dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .75rem; margin: 0; }
.keys dt { font-family: var(--mono); font-size: .8125rem; white-space: nowrap; }
.keys dd { margin: 0; font-size: .8125rem; color: var(--muted); }
.keys p { margin: .75rem 0 0; font-size: .8125rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { background: var(--smoke); border: 1px solid var(--line); border-radius: 999px;
        padding: .25rem .7rem; font-size: .8125rem; cursor: pointer; font-family: var(--mono); }
.chip:hover { border-color: var(--slate); background: #fff; }
#newanswer { font-family: var(--font); font-weight: 500; }
.marks p { margin: .7rem 0 0; font-size: .8125rem; }

.qs ol { margin: 0; padding-left: 1.1rem; font-size: .875rem; }
.qs li { margin: .35rem 0; }
.qs .cat { display: inline-block; font-size: .6875rem; text-transform: uppercase;
           letter-spacing: .06em; color: var(--byz); margin-right: .4rem; }
.qs p { margin: .7rem 0 0; font-size: .8125rem; }

/* ------------------------------------------------------------------ editor */
.editor-head { display: flex; justify-content: space-between; align-items: center;
               margin-bottom: .6rem; font-size: .875rem; }
#body {
  flex: 1 1 auto; min-height: 24rem; width: 100%; resize: none;
  padding: 1.25rem 1.4rem; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-family: var(--font); font-size: 16px; line-height: 1.85;
  color: var(--night);
}
#body:focus { outline: 2px solid var(--slate); outline-offset: -1px; border-color: transparent; }
#body[readonly] { background: var(--smoke); color: var(--muted); }

/* ------------------------------------------------------------------- table */
.grid { width: 100%; border-collapse: collapse; background: #fff;
        border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.grid th, .grid td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.grid th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
           color: var(--muted); font-weight: 500; }
.grid tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem;
        background: var(--smoke); border: 1px solid var(--line); }
.pill-submitted { background: var(--slate); border-color: var(--slate); color: var(--night); }
.pill-in_progress { background: #fff; border-color: var(--byz); color: var(--byz); }
