/* mindmate — noční inkoust. Lidé svítí jantarem, stroj mátou. */

:root {
  --bg: #14121C;
  --bg-deep: #0E0C14;
  --surface: #1D1A28;
  --surface-2: #262234;
  --line: #322D44;
  --ink: #EDEAF4;
  --ink-dim: #9A93AE;
  --ink-faint: #6A6480;
  --human: #E8A34C;        /* jantar — lidský hlas, svíčka */
  --human-soft: #f2c185;
  --machine: #7BD9C0;      /* máta — hlas stroje */
  --machine-dim: #4a8a7a;
  --danger: #E07A7A;
  --radius: 18px;
  --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
}

* { margin: 0; box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(60vmax 60vmax at 18% -10%, #241d38 0%, transparent 60%),
    radial-gradient(50vmax 50vmax at 100% 110%, #10201d 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
#app {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

/* ─── Hlavička ─── */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 2px 10px;
}
.wordmark {
  font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: baseline;
}
.wordmark em { font-style: italic; font-weight: 500; color: var(--human); }
.orb {
  width: 7px; height: 7px; border-radius: 50%; margin-left: 5px; align-self: center;
  background: var(--machine);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--machine) 60%, transparent);
}
.scorebar {
  font-family: var(--mono); font-size: 0.82rem; color: var(--ink-dim);
  display: flex; gap: 7px; align-items: baseline;
}
.scorebar b { font-weight: 500; font-size: 1rem; }
.sc.human b { color: var(--human); }
.sc.machine b { color: var(--machine); }
.sc-sep { color: var(--ink-faint); }

/* ─── Domů ─── */
.hero { text-align: center; padding: 34px 0 26px; position: relative; }
.hero h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--human); }
.tagline { margin-top: 8px; font-size: 1.12rem; color: var(--ink); font-weight: 600; }
.sub { margin-top: 10px; color: var(--ink-dim); line-height: 1.55; font-size: 0.95rem; }
.hero-orbs { position: absolute; inset: 0; pointer-events: none; }
.hero-orbs i {
  position: absolute; border-radius: 50%; filter: blur(2px); opacity: 0.85;
  animation: float 7s ease-in-out infinite;
}
.hero-orbs .o1 { width: 10px; height: 10px; background: var(--human); left: 16%; top: 22%; box-shadow: 0 0 14px 2px color-mix(in srgb, var(--human) 55%, transparent); }
.hero-orbs .o2 { width: 8px; height: 8px; background: var(--machine); right: 14%; top: 34%; animation-delay: -2.4s; box-shadow: 0 0 12px 2px color-mix(in srgb, var(--machine) 55%, transparent); }
.hero-orbs .o3 { width: 5px; height: 5px; background: var(--human-soft); right: 30%; top: 8%; animation-delay: -4.8s; }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-9px) } }

.card {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 14px 0;
  backdrop-filter: blur(6px);
}
.card h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; }
form label { display: block; font-size: 0.88rem; color: var(--ink-dim); margin-bottom: 12px; }
input, textarea {
  width: 100%; margin-top: 5px;
  background: var(--bg-deep); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; font: inherit; font-size: 1rem;
  outline: none; resize: none;
}
input:focus, textarea:focus { border-color: var(--human); box-shadow: 0 0 0 3px color-mix(in srgb, var(--human) 18%, transparent); }
.form-hint { font-size: 0.82rem; color: var(--ink-faint); margin: 2px 0 14px; }

.btn-solid, .btn-ghost, .btn-ink {
  font: inherit; font-weight: 700; font-size: 0.95rem;
  border-radius: 999px; padding: 12px 20px; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; display: inline-block; text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s;
}
.btn-solid { background: var(--human); color: #241703; width: 100%; }
.btn-solid:active { transform: scale(0.985); }
.btn-solid:disabled { opacity: 0.35; cursor: default; }
.btn-ghost { background: transparent; color: var(--ink-dim); border-color: var(--line); }
.btn-ghost:active { transform: scale(0.985); }
.btn-ghost.small { padding: 8px 14px; font-size: 0.85rem; font-weight: 600; }
.btn-ink { background: var(--surface-2); color: var(--ink); }

.share-note { color: var(--ink-dim); font-size: 0.92rem; line-height: 1.5; margin-bottom: 10px; }
.share-note.small { font-size: 0.82rem; }
.share-row { margin: 10px 0; }
.share-row code {
  display: block; font-family: var(--mono); font-size: 0.78rem; color: var(--machine);
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; word-break: break-all;
}
.share-actions { display: flex; gap: 10px; margin: 10px 0 4px; }
.share-actions > * { flex: 1; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0 12px; }

.feed-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); margin: 22px 0 8px; }
#mygames-list { list-style: none; padding: 0; }
#mygames-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 16px; margin-bottom: 8px; color: var(--ink); text-decoration: none;
}
#mygames-list .mg-names { font-weight: 700; }
#mygames-list .mg-meta { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-faint); }

/* ─── Vlákno hry ─── */
#game { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.thread { flex: 1; overflow-y: auto; padding: 8px 0 16px; scroll-behavior: smooth; }

.rnd { margin: 26px 0; }
.rnd:last-child { animation: rise 0.35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } }
.rnd-meta {
  font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.08em; text-align: center; margin-bottom: 10px;
}
.q {
  max-width: 86%;
  background: var(--surface-2); border-radius: 16px 16px 16px 5px;
  padding: 12px 15px; font-weight: 600; line-height: 1.45;
}
.q.mine { margin-left: auto; border-radius: 16px 16px 5px 16px; background: #2c2440; }
.q-who { display: block; font-family: var(--mono); font-size: 0.7rem; font-weight: 400; color: var(--ink-faint); margin-bottom: 3px; }

.answers { display: grid; gap: 8px; margin-top: 10px; }
.ans {
  border-radius: 14px; padding: 11px 14px; line-height: 1.5; font-size: 0.97rem;
  border: 1px solid var(--line); background: var(--surface);
  animation: flipin 0.5s ease both;
}
@keyframes flipin { from { transform: rotateX(70deg); opacity: 0 } }
.ans-who { display: flex; align-items: baseline; gap: 6px; font-family: var(--mono); font-size: 0.72rem; margin-bottom: 4px; }
.ans.human { border-color: color-mix(in srgb, var(--human) 45%, var(--line)); }
.ans.human .ans-who { color: var(--human); }
.ans.machine { border-color: color-mix(in srgb, var(--machine) 35%, var(--line)); background: color-mix(in srgb, var(--machine) 4%, var(--surface)); }
.ans.machine .ans-who { color: var(--machine); }
.ans .picked { margin-left: auto; color: var(--ink-faint); }

.verdict {
  text-align: center; margin-top: 12px; font-weight: 700; font-size: 0.95rem;
}
.verdict.ok { color: var(--human); }
.verdict.ko { color: var(--machine); }
.ai-note {
  margin: 8px auto 0; max-width: 90%; text-align: center;
  font-family: var(--mono); font-size: 0.82rem; color: var(--machine-dim); line-height: 1.5;
}
.ai-note::before { content: '✳ '; color: var(--machine); }

/* ─── Dock (spodní panel) ─── */
.dock {
  border-top: 1px solid var(--line);
  padding: 14px 0 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; bottom: 0;
}
.dock-label { font-size: 0.9rem; color: var(--ink-dim); margin-bottom: 9px; }
.dock-label b { color: var(--ink); }
.dock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; }
.dock-row .btn-solid { width: auto; flex: 0 0 auto; padding: 11px 22px; }
.dock-hint { font-size: 0.76rem; color: var(--ink-faint); line-height: 1.35; }

.wait-line { display: flex; align-items: center; gap: 10px; color: var(--ink-dim); font-size: 0.92rem; padding: 4px 2px; }
.pulse {
  width: 9px; height: 9px; border-radius: 50%; background: var(--machine); flex: 0 0 auto;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.35; transform: scale(0.8) } 50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--machine) 50%, transparent) } }

/* ─── Pár karet (hádání) ─── */
.pair { display: grid; gap: 9px; margin: 4px 0 12px; }
.pcard {
  font: inherit; text-align: left; color: var(--ink);
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 13px 14px; cursor: pointer; line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.pcard:active { transform: scale(0.99); }
.pcard.sel {
  border-color: var(--human);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--human) 20%, transparent);
}
.pcard-tag {
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; flex: 0 0 auto;
}
.pcard.sel .pcard-tag { color: #241703; background: var(--human); border-color: var(--human); }
.pair.readonly .pcard { cursor: default; opacity: 0.85; }

/* ─── Drobnosti ─── */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 18px; font-size: 0.9rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.45); z-index: 50;
}
main[hidden], section[hidden], div[hidden] { display: none !important; }

@media (min-width: 560px) {
  .pair { grid-template-columns: 1fr 1fr; }
  .answers.duo { grid-template-columns: 1fr 1fr; }
}
