:root {
  --bg: #0a0c10;
  --panel: #11151c;
  --panel-2: #161b24;
  --line: #232c3a;
  --ink: #e6edf6;
  --dim: #8a97a8;
  --human: #ff7a59;   /* warm = human */
  --ai: #45d9c9;      /* cool = machine */
  --win: #7ee787;
  --lose: #ff6b6b;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(69,217,201,.10), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(255,122,89,.10), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  justify-content: center;
  padding: 28px 16px 60px;
}

.frame {
  width: 100%;
  max-width: 620px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  overflow: hidden;
}

/* topbar */
.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.logo { font-size: 22px; font-weight: 700; letter-spacing: 4px; }
.cursor { color: var(--ai); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tagline { color: var(--dim); font-size: 12px; letter-spacing: 1px; }

/* screens */
.screen { display: none; padding: 26px 22px 28px; }
.screen.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* intro */
.brief { line-height: 1.6; color: var(--dim); font-size: 14px; margin: 0 0 14px; }
.brief b { color: var(--ink); }

.role-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  margin: 20px 0 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  position: relative;
  overflow: hidden;
}
.role-card::before {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--dim);
}
.role-card.human::before { background: var(--human); }
.role-card.ai::before { background: var(--ai); }
.role-kicker { font-size: 11px; letter-spacing: 2px; color: var(--dim); }
.role-name { font-size: 38px; font-weight: 700; letter-spacing: 3px; }
.role-card.human .role-name { color: var(--human); }
.role-card.ai .role-name { color: var(--ai); }
.role-flavor { font-size: 13px; color: var(--dim); line-height: 1.5; }

/* buttons */
.btn {
  font-family: var(--mono);
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 14px;
  letter-spacing: 1px;
  transition: transform .08s ease, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--ai); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  width: 100%;
  background: linear-gradient(180deg, #1d2632, #141a23);
  border-color: #2c3a4d;
  font-weight: 700;
}
.btn.primary:hover { box-shadow: 0 0 0 1px var(--ai) inset; }

/* rounds */
.round-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.round-tag { font-weight: 700; letter-spacing: 2px; color: var(--ai); }
.mini-role { font-size: 12px; color: var(--dim); }
.mini-role b { color: var(--ink); }

.transcript {
  height: 340px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1016;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bubble {
  display: flex; flex-direction: column; gap: 4px;
  max-width: 85%;
  animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(5px); } }
.bubble .who { font-size: 10px; letter-spacing: 1.5px; color: var(--dim); }
.bubble .msg {
  padding: 10px 13px; border-radius: 12px; line-height: 1.5; font-size: 14px;
  border: 1px solid var(--line); background: var(--panel-2);
  white-space: pre-wrap; word-break: break-word;
}
.bubble.you { align-self: flex-end; align-items: flex-end; }
.bubble.you .msg { background: #182230; border-color: #2a3a4e; }
.bubble.opp { align-self: flex-start; }
.bubble.opp .msg { background: #131922; }
.bubble.opp.ask .msg { border-color: #3a3146; background: #181320; color: #e9ddff; }

.typing .msg { display: inline-flex; gap: 5px; padding: 13px; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--dim);
  animation: bounce 1s infinite;
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,80%,100% { opacity:.3; transform: translateY(0);} 40% { opacity:1; transform: translateY(-4px);} }

.composer { margin-top: 16px; }
.phase-prompt { display: block; font-size: 12px; color: var(--dim); margin-bottom: 8px; letter-spacing: 1px; }
.composer-row { display: flex; gap: 10px; }
#turn-input {
  flex: 1;
  font-family: var(--mono);
  font-size: 14px;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0c1016;
  color: var(--ink);
}
#turn-input:focus { outline: none; border-color: var(--ai); }
#turn-input:disabled { opacity: .5; }
.btn.send { font-weight: 700; }

/* guess */
.verdict-q { text-align: center; margin: 18px 0 6px; font-size: 22px; letter-spacing: 1px; }
.verdict-sub { text-align: center; color: var(--dim); margin: 0 0 26px; font-size: 14px; }
.verdict-sub b { color: var(--ink); }
.guess-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.guess-card {
  cursor: pointer; font-family: var(--mono);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  padding: 34px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  transition: transform .1s, border-color .15s, box-shadow .15s;
}
.guess-card:hover { transform: translateY(-3px); }
.guess-card.human:hover { border-color: var(--human); box-shadow: 0 12px 30px rgba(255,122,89,.18); }
.guess-card.ai:hover { border-color: var(--ai); box-shadow: 0 12px 30px rgba(69,217,201,.18); }
.g-big { font-size: 30px; font-weight: 700; letter-spacing: 3px; }
.guess-card.human .g-big { color: var(--human); }
.guess-card.ai .g-big { color: var(--ai); }
.g-sml { font-size: 12px; color: var(--dim); }

/* result */
.result-banner {
  text-align: center; font-size: 26px; font-weight: 700; letter-spacing: 4px;
  padding: 14px; border-radius: 12px; margin-bottom: 20px;
}
.result-banner.win { color: var(--win); border: 1px solid rgba(126,231,135,.4); background: rgba(126,231,135,.07); }
.result-banner.lose { color: var(--lose); border: 1px solid rgba(255,107,107,.4); background: rgba(255,107,107,.07); }

.reveal { border: 1px solid var(--line); border-radius: 12px; padding: 6px 16px; background: var(--panel-2); }
.reveal hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.reveal-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid rgba(35,44,58,.5);
}
.reveal-row:last-child { border-bottom: none; }
.reveal-row.sub { padding-top: 4px; border-bottom: none; }
.reveal-row span { color: var(--dim); font-size: 13px; flex: 1; }
.reveal-row b { font-size: 15px; letter-spacing: 1px; }
.reveal-row b.human { color: var(--human); }
.reveal-row b.ai { color: var(--ai); }
.reveal-row em { font-style: normal; font-size: 12px; }
.reveal-row em.ok { color: var(--win); }
.reveal-row em.no { color: var(--lose); }

.result-note {
  color: var(--dim); font-size: 13px; line-height: 1.6;
  margin: 18px 2px 22px; padding-left: 12px; border-left: 2px solid var(--line);
}
.result-foot { display: flex; align-items: center; gap: 14px; }
.streak { color: var(--dim); font-size: 13px; white-space: nowrap; }
.result-foot .btn { flex: 1; }

@media (max-width: 480px) {
  .transcript { height: 300px; }
  .role-name { font-size: 30px; }
}
