/* Don't — shared between the app and the /fell pages. */

:root {
  --ground:    #C8CEC3;
  --panel:     #D4D9CD;
  --ink:       #1E2418;
  --ink-soft:  #5C6353;
  --rule:      #9BA393;
  --signal:    #B32414;
  --signal-lo: #7E1508;
  --signal-hi: #D8462F;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:    #171B14;
    --panel:     #1F241B;
    --ink:       #C8CEC3;
    --ink-soft:  #848C7C;
    --rule:      #3B4235;
    --signal:    #C02A16;
    --signal-lo: #6E1206;
    --signal-hi: #E85238;
  }
}
:root[data-theme="dark"] {
  --ground:    #171B14;
  --panel:     #1F241B;
  --ink:       #C8CEC3;
  --ink-soft:  #848C7C;
  --rule:      #3B4235;
  --signal:    #C02A16;
  --signal-lo: #6E1206;
  --signal-hi: #E85238;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
  max-width: 36rem;
  margin: 0 auto;
}

/* ---- the button ---- */

#btn {
  appearance: none;
  display: block;
  border: 0;
  padding: 0;
  width: 148px;
  height: 148px;
  flex: 0 0 auto;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 38% 30%, var(--signal-hi) 0%, var(--signal) 42%, var(--signal-lo) 100%);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,.30),
    inset 0 -6px 10px rgba(0,0,0,.42),
    0 10px 0 var(--signal-lo),
    0 14px 22px rgba(0,0,0,.30);
  transition: transform .06s linear, box-shadow .06s linear;
}
#btn:focus-visible,
.btn-link:focus-visible #btn { outline: 3px solid var(--ink); outline-offset: 10px; }

#btn:active,
#btn.is-down,
.btn-link:active #btn {
  transform: translateY(8px);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,.18),
    inset 0 -3px 8px rgba(0,0,0,.50),
    0 2px 0 var(--signal-lo),
    0 3px 8px rgba(0,0,0,.28);
}

.btn-link { display: block; margin-top: 3rem; outline: none; }

/* ---- slots ---- */

#above, #below { width: 100%; }
#above:not(:empty) { margin-bottom: 2.75rem; }
#below:not(:empty) { margin-top: 3.25rem; }

.stack { display: block; transition: opacity .45s ease; }
.draining { opacity: 0; }

/* ---- your standing ---- */

.standing { text-align: center; }

.standing-label {
  font-size: .8125rem;
  color: var(--ink-soft);
  margin: 0 0 .5rem;
}

.clock {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 11vw, 3.25rem);
  line-height: 1;
  letter-spacing: -.02em;
  margin: 0;
}
.clock .u {
  font-weight: 500;
  font-size: .42em;
  letter-spacing: 0;
  color: var(--ink-soft);
  margin: 0 .38em 0 .06em;
}
.clock .u:last-child { margin-right: 0; }

.standing-meta {
  font-family: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .8125rem;
  color: var(--ink-soft);
  margin: .9rem 0 0;
}
.standing-meta b { font-weight: 500; color: var(--ink); }

.linkish {
  background: none;
  border: 0;
  padding: 0 0 1px;
  margin: 0;
  font: inherit;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.linkish:hover { color: var(--ink); border-bottom-color: var(--ink); }
.linkish:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---- ledgers ---- */

.ledger + .ledger { margin-top: 2.5rem; }

.ledger h2 {
  font-size: .9375rem;
  font-weight: 600;
  margin: 0 0 .625rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.ledger h2 span {
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  font-size: .75rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.rows {
  font-family: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .8125rem;
}
.row {
  display: grid;
  grid-template-columns: 2.25rem 1fr auto;
  gap: .5rem;
  padding: .3125rem 0;
  align-items: baseline;
}
.row + .row { border-top: 1px solid color-mix(in srgb, var(--rule) 40%, transparent); }
.row .n { color: var(--ink-soft); }
.row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t { font-variant-numeric: tabular-nums; }
.row.me {
  background: var(--panel);
  margin-inline: -.625rem;
  padding-inline: .625rem;
  border-radius: 2px;
}
.row.me .who { font-weight: 500; }

.feed {
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  font-size: .8125rem;
  color: var(--ink-soft);
}
.feed p { margin: 0; padding: .3125rem 0; }
.feed p + p { border-top: 1px solid color-mix(in srgb, var(--rule) 40%, transparent); }
.feed b { font-weight: 500; color: var(--ink); }

.empty {
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  font-size: .8125rem;
  color: var(--ink-soft);
  padding: .3125rem 0;
  margin: 0;
}

.warning {
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  font-size: .75rem;
  color: var(--ink-soft);
  text-align: center;
  margin: 2.5rem 0 0;
  opacity: .7;
}

/* ---- epitaph ---- */

.epitaph { text-align: center; max-width: 26rem; }
.epitaph h1 {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 2rem;
}
    .epitaph .clock {
        opacity: .92;
        margin: 2rem 0 0;
    }
    .epitaph p:not(.clock) {
        font-family: "DM Mono", ui-monospace, Menlo, monospace;
        font-size: .8125rem;
        line-height: 1.7;
        color: var(--ink-soft);
        margin: 2rem 0 0;
    }
.epitaph p b { font-weight: 500; color: var(--ink); }
.epitaph .final { margin-top: 3rem; opacity: .55; }
.epitaph a { color: var(--ink-soft); }

/* ---- rename dialog ---- */

dialog {
  border: 1px solid var(--rule);
  background: var(--panel);
  color: var(--ink);
  padding: 1.25rem;
  border-radius: 2px;
  max-width: 22rem;
  width: calc(100% - 2.5rem);
}
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog p { margin: 0 0 .75rem; font-size: .875rem; }

.candidates { display: flex; flex-direction: column; gap: .375rem; }
.candidates button {
  font: 500 .875rem "DM Mono", ui-monospace, Menlo, monospace;
  text-align: left;
  padding: .5rem .625rem;
  background: var(--ground);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 2px;
  cursor: pointer;
}
.candidates button:hover { border-color: var(--ink); }
.candidates button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.dialog-actions { display: flex; gap: .5rem; justify-content: space-between; margin-top: .875rem; }
.dialog-actions button {
  font: 500 .875rem "Archivo", Helvetica, Arial, sans-serif;
  padding: .4375rem .875rem;
  border-radius: 2px;
  border: 1px solid var(--rule);
  background: var(--ground);
  color: var(--ink);
  cursor: pointer;
}
.dialog-actions button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
