:root {
  /* Grape Fizz */
  --bg: #110D17;
  --panel: #19141F;
  --panel-line: rgba(255,255,255,.07);
  --text: #C0B8CF;
  --muted: #7D7390;
  --accent: #B69CFF;
  --title: #7CF5C8;
  --focus: #B69CFF;
  --on-accent: #110D17;
  --inset: #0C0911;
  --line: #352C42;
  --line-soft: #251F2E;
  --ok: #5EF2B8; --upd: #FFD166; --down: #FF5C7A;
  --r-card: 2px; --r-input: 2px; --r-btn: 3px; --r-pill: 3px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inconsolata', monospace;
  font-size: clamp(13px, 1.9vh, 16px);
}

.center {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; height: 100vh; height: 100dvh; padding: 12px; overflow: hidden;
}
.columns {
  display: flex; flex-wrap: wrap; gap: 28px; align-items: stretch; justify-content: center;
  width: 90%; max-width: 880px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--panel-line); border-radius: var(--r-card);
  padding: 1.8em 1.4em; min-width: 0;
}

.login { flex: 3 1 360px; display: flex; flex-direction: column; justify-content: center; }
.login.solo { flex: 0 1 480px; }
.side  { flex: 2 1 280px; }

/* Content is visible by default; no fill-mode, so a frozen animation never hides anything. */
@keyframes fadeInUp   { from { opacity: 0; transform: translate3d(0,60px,0) } to { opacity: 1; transform: none } }
/* 0.2s start delay baked into the keyframes because a real delay would need fill-mode backwards */
@keyframes fadeInLeft {
  0%, 16.667% { opacity: 0; transform: translate3d(-60px,0,0) }
  100% { opacity: 1; transform: none }
}
.fadeInUp   { animation: fadeInUp 1s; }
.fadeInLeft { animation: fadeInLeft 1.2s; }
.anim-done .fadeInUp, .anim-done .fadeInLeft { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .fadeInUp,.fadeInLeft { animation: none; }
}

h3.title { color: var(--title); font-size: 1.6em; margin: .2em 0 .5em; letter-spacing: .1em; font-weight: bold; }
.login p { margin: .3em 0; font-size: .9em; }
#date { color: var(--accent); }

.pills { margin: 1em 0 1.5em; line-height: 2; }
.pills a {
  display: inline-block; color: var(--on-accent); background: var(--accent);
  padding: 3px 9px; margin: 0 2px; text-decoration: none; font-weight: bold; font-size: .82em; line-height: 1.4; border-radius: var(--r-pill);
}
.pills a:hover { filter: brightness(1.08); }
svg.ico { width: 1em; height: 1em; vertical-align: -.12em; fill: currentColor; }
.pills svg.ico { vertical-align: -.2em; }

input:focus { border: solid 1px var(--focus) !important; outline: none; }
.form-control {
  display: block; width: 85%; margin: 0 auto 1.2em; padding: .6em .7em;
  background: var(--inset); color: var(--text); border: 1px solid var(--panel-line);
  text-align: center; font: inherit; border-radius: var(--r-input);
}
.form-control::placeholder { color: var(--muted); }
.btn-soren {
  width: 100%; height: 3.4em; font: inherit; font-weight: bold; cursor: pointer;
  color: var(--accent); background: var(--inset); border: 1px solid var(--accent); border-radius: var(--r-btn);
  transition: background-color .2s, color .2s;
}
.btn-soren:hover, .btn-soren:focus, .btn-soren:active, .btn-soren.active {
  color: var(--on-accent); background: var(--accent); border-color: var(--accent); outline: none;
}
.btn-soren:disabled { cursor: wait; opacity: .85; }
.link-btn {
  display: block; margin: .9em auto 0; padding: 0; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: .85em; color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover, .link-btn:focus-visible { color: var(--accent); outline: none; }
#msg { min-height: 1.4em; margin-top: .6em; font-size: .85em; color: var(--accent); }
.spin { display: inline-block; width: .9em; height: .9em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.1em; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

.stats { display: flex; gap: .7em; }
.tile {
  flex: 1; padding: .7em .5em; border: 1px dashed var(--line); background: rgba(255,255,255,.03); border-radius: 2px;
  display: flex; flex-direction: column; align-items: center; gap: .2em;
}
.tile-num { font-size: 1.7em; font-weight: bold; color: var(--title); line-height: 1.2; }
.tile-label { font-size: .8em; color: var(--muted); }
.board {
  margin: 1.2em 0; padding: .7em .9em; border: 1px dashed var(--line); background: rgba(255,255,255,.03); border-radius: 2px;
  font-size: .85em; color: var(--muted); text-align: left;
}
.board-head { display: flex; justify-content: space-between; margin-bottom: .5em; color: var(--text); }
.board-row { display: flex; justify-content: space-between; align-items: center; gap: .8em; padding: .45em 0; border-top: 1px dashed var(--line-soft); }
.board-row b { color: var(--text); font-weight: bold; }
.board-row small { display: block; font-size: .85em; }
.tag { flex: none; padding: 1px 7px; border-radius: var(--r-pill); font-size: .85em; font-weight: bold; color: var(--on-accent); }
.tag.ok   { background: var(--ok); }
.tag.upd  { background: var(--upd); }
.tag.down { background: var(--down); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.changelog { font-size: .9em; line-height: 1.7; }
.changelog h4 { margin: 0 0 .5em; font-size: 1.2em; }
.changelog .ver { color: var(--muted); }
.c-grape { color: #B69CFF; }

.tabs { display: none; }
@media (max-width: 760px) {
  .columns { width: 100%; max-width: 440px; gap: 0; }
  .login, .side { flex-basis: 100%; }
  .tabs { display: flex; gap: 6px; width: 100%; max-width: 440px; margin-bottom: 10px; }
  .tab {
    flex: 1; padding: .55em 0; font: inherit; font-size: .9em; font-weight: bold; cursor: pointer;
    color: var(--accent); background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-btn);
  }
  .tab[aria-selected="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
  .columns[data-view="login"] .side, .columns[data-view="side"] .login { display: none; }
}
@media (max-width: 420px) { .card { padding: 1.6em 1em; } .form-control { width: 92%; } }
