:root {
  --ink: #19182d;
  --muted: #6d6a80;
  --paper: #f7f3eb;
  --white: #fffefa;
  --coral: #ff6b57;
  --coral-dark: #e95140;
  --mint: #a9e8cf;
  --lavender: #d8d1ff;
  --yellow: #ffd96a;
  --line: rgba(25, 24, 45, .13);
  --shadow: 0 24px 60px rgba(31, 25, 58, .12);
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 50%; filter: blur(2px); pointer-events: none; z-index: -1; opacity: .75; }
.ambient-one { width: 420px; height: 420px; background: var(--lavender); top: -180px; right: -130px; }
.ambient-two { width: 330px; height: 330px; background: var(--mint); bottom: -180px; left: -120px; }

.site-header { height: 82px; max-width: 1240px; margin: auto; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; }
.brand { color: inherit; text-decoration: none; display: flex; gap: 11px; align-items: center; font: 700 18px "Space Grotesk", sans-serif; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--ink); border-radius: 10px 10px 10px 3px; }
.live-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; color: var(--muted); font-size: 13px; background: rgba(255,255,255,.45); }
.live-pill i, .connection-state i { width: 7px; height: 7px; background: #36ba7b; border-radius: 50%; box-shadow: 0 0 0 4px rgba(54,186,123,.12); }

.home-view { max-width: 1120px; margin: 55px auto 70px; padding: 0 28px; }
.hero { max-width: 850px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; color: var(--coral-dark); font-size: 12px; font-weight: 700; }
h1 { font: 700 clamp(46px, 7.3vw, 92px)/.95 "Space Grotesk", sans-serif; letter-spacing: -.055em; margin: 20px 0 28px; }
h1 span { color: transparent; -webkit-text-stroke: 2px var(--ink); }
.hero-copy { font-size: clamp(17px, 2vw, 21px); line-height: 1.55; color: var(--muted); max-width: 710px; }
.entry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 52px; }
.entry-card { position: relative; border: 1px solid var(--line); border-radius: 24px; padding: 30px; box-shadow: var(--shadow); }
.entry-card.warm { background: #fff4e6; }
.entry-card.cool { background: #edf9f4; }
.card-number { position: absolute; right: 25px; top: 22px; font: 700 48px "Space Grotesk"; color: rgba(25,24,45,.08); }
.entry-card h2 { font: 700 27px "Space Grotesk"; margin: 0 0 6px; }
.entry-card > p { color: var(--muted); margin: 0 0 25px; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; margin: 14px 0; }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.72); color: var(--ink); border-radius: 12px; padding: 13px 14px; outline: none; transition: .18s; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(25,24,45,.08); background: white; }
.code-input { text-transform: uppercase; letter-spacing: .25em; font-weight: 700; }
.button { border: 0; border-radius: 12px; padding: 14px 17px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 18px; }
.button.primary { color: white; background: var(--coral); }
.button.primary:hover { background: var(--coral-dark); }
.button.secondary { color: white; background: var(--ink); }
.button.secondary:hover { background: #302e4c; }
.button.ghost { border: 1px solid var(--line); background: white; color: var(--ink); justify-content: center; }
.button.small { width: auto; padding: 11px 16px; margin: 0; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.type-strip { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.type-strip span { padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; background: rgba(255,255,255,.45); }

.room-view { display: grid; grid-template-columns: 270px 1fr; min-height: calc(100vh - 82px); border-top: 1px solid var(--line); }
.room-sidebar { background: var(--ink); color: white; padding: 30px 25px; display: flex; flex-direction: column; gap: 34px; }
.sidebar-label { color: #aaa7bd; text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 700; display: flex; justify-content: space-between; }
.room-code { border: 0; background: none; color: white; padding: 0; text-align: left; }
.room-code span { display: block; font: 700 37px "Space Grotesk"; letter-spacing: .12em; }
.room-code small { color: #8f8ba8; }
.players { display: grid; gap: 10px; }
.player { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.avatar { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; color: var(--ink); font-weight: 800; }
.player small { color: #8f8ba8; }
.player.offline { opacity: .45; }
.sidebar-bottom { margin-top: auto; color: #aaa7bd; font-size: 13px; line-height: 1.5; }
.text-button { border: 0; background: none; color: #aaa7bd; padding: 0; text-decoration: underline; }
.game-stage { position: relative; min-width: 0; padding: 24px clamp(20px, 5vw, 70px) 60px; }
.game-topbar { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; max-width: 850px; margin: auto; }
.topbar-actions, .export-actions { display: flex; align-items: center; gap: 8px; }
.export-button { border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 8px; padding: 6px 9px; font-size: 11px; font-weight: 700; }
.export-button:hover { background: white; border-color: var(--ink); }
.connection-state { display: flex; align-items: center; gap: 8px; }
.game-panel { max-width: 850px; margin: 70px auto 0; }
.game-card { background: var(--white); border: 1px solid var(--line); border-radius: 26px; padding: clamp(24px, 5vw, 48px); box-shadow: var(--shadow); }
.stage-kicker { color: var(--coral-dark); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; }
.game-card h2 { font: 700 clamp(31px, 5vw, 54px)/1.06 "Space Grotesk"; letter-spacing: -.04em; margin: 15px 0 18px; }
.game-card .lead { color: var(--muted); font-size: 17px; line-height: 1.55; }
.waiting-art { height: 155px; position: relative; margin: 34px 0 14px; }
.waiting-art span { position: absolute; width: 96px; height: 96px; border-radius: 50% 50% 50% 12px; display: grid; place-items: center; font: 700 34px "Space Grotesk"; }
.waiting-art span:first-child { left: 28%; top: 8px; background: var(--yellow); transform: rotate(-8deg); }
.waiting-art span:last-child { right: 28%; bottom: 0; background: var(--mint); transform: rotate(9deg); }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 26px; }
.action-row .button { width: auto; min-width: 150px; justify-content: center; margin: 0; }
.player-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 25px 0; }
.player-chip { background: var(--paper); border: 1px solid var(--line); padding: 9px 12px; border-radius: 999px; font-size: 13px; }
.question-types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 24px 0; }
.type-button { border: 1px solid var(--line); border-radius: 12px; padding: 11px 7px; background: white; color: var(--muted); font-size: 12px; }
.type-button.active { background: var(--ink); color: white; border-color: var(--ink); }
.options-editor { display: grid; gap: 8px; }
.option-grid { display: grid; gap: 10px; margin-top: 25px; }
.option-button { border: 1px solid var(--line); border-radius: 14px; padding: 15px; text-align: left; background: var(--paper); font-weight: 600; }
.option-button:hover, .option-button.selected { border-color: var(--coral); background: #fff0ed; }
.scale-row { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 26px; }
.scale-row .option-button { padding: 12px 4px; text-align: center; }
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 8px; }
.question-display { padding-left: 22px; border-left: 5px solid var(--coral); }
.answer-reveal { margin-top: 30px; padding: 25px; border-radius: 18px; background: #edf9f4; }
.answer-reveal p { font: 600 clamp(22px, 4vw, 34px)/1.25 "Space Grotesk"; margin: 8px 0 0; }
.toast { position: fixed; bottom: 25px; right: 25px; max-width: 340px; background: var(--ink); color: white; border-radius: 12px; padding: 12px 15px; opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .site-header { height: 68px; padding: 0 18px; }
  .home-view { margin-top: 35px; padding: 0 18px; }
  .entry-grid { grid-template-columns: 1fr; }
  .room-view { display: block; min-height: calc(100vh - 68px); }
  .room-sidebar { padding: 15px 18px; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .room-sidebar > div:nth-child(2), .sidebar-bottom { display: none; }
  .room-code span { font-size: 24px; }
  .game-stage { padding: 18px 15px 45px; }
  .connection-state { display: none; }
  .export-actions > span { display: none; }
  .game-panel { margin-top: 38px; }
  .question-types { grid-template-columns: repeat(2, 1fr); }
  .scale-row { grid-template-columns: repeat(5, 1fr); }
  .waiting-art span:first-child { left: 16%; }
  .waiting-art span:last-child { right: 16%; }
}
