:root { color-scheme: dark; --bg: #121218; --panel: #1c1c26; --line: #2e2e3c;
  --text: #e8e8f0; --muted: #9a9ab0; --accent: #ff7ab8; --danger: #d64545; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, sans-serif; background: var(--bg);
  color: var(--text); display: flex; flex-direction: column; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; background: #262634;
  border: 1px solid var(--line); border-radius: 6px; padding: .35rem .7rem; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: #6b3aa0; border-color: #6b3aa0; }
button.big { font-size: 1.3rem; padding: .7rem 2.5rem; margin-top: .8rem; }
.bar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
  padding: .5rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.bar label { display: inline-flex; gap: .3rem; align-items: center; font-size: 13px; }
#stop { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 700; }
.spacer { flex: 1; }
.low, #lock { color: #ff6b6b; font-weight: 700; }
.hint { color: var(--muted); font-size: 13px; }
.val { display: inline-block; min-width: 2.2em; text-align: right;
  font-variant-numeric: tabular-nums; }
.clock, .ind { font-size: 13px; font-variant-numeric: tabular-nums; }
body:not(.playing) .play-only { display: none !important; }
.view { flex: 1; min-height: 0; }

/* Setup */
#setup { overflow-y: auto; padding: 1rem 1.5rem; }
.setup { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem 1.1rem; }
.panel.wide { grid-column: 1 / -1; }
.panel h3 { margin: .2rem 0 .6rem; }
.panel label { display: flex; gap: .5rem; align-items: center; margin: .45rem 0;
  flex-wrap: wrap; }
.panel input[type=range] { flex: 1; min-width: 120px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: .3rem 1rem; margin-top: .5rem; }
.checks.pats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.chk { align-items: flex-start !important; flex-wrap: nowrap !important; }
.chk small { color: var(--muted); display: block; }

/* Play layout */
#play { display: grid; grid-template-columns: 1fr 1fr; }
#left { position: relative; background: #000; overflow: hidden; }
#ph, #pic { position: absolute; inset: 0; width: 100%; height: 100%; }
#pic { object-fit: contain; opacity: 0; transition: opacity .4s ease; }
#pic.on { opacity: 1; }
#right { display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
  padding: 1rem 1.5rem; border-left: 1px solid var(--line); }
#game { flex: 1; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: .6rem; }
.gtitle { margin: .3rem 0 0; font-size: 1.8rem; color: var(--accent); }
.rules { color: var(--muted); max-width: 36rem; margin: 0; }
.gbody { display: flex; flex-direction: column; align-items: center; gap: 1rem;
  margin-top: 1rem; width: 100%; }
.gmsg { font-size: 1.25rem; min-height: 1.8em; margin: .5rem 0; }
.countdown { font-size: 2rem; font-weight: 700; }
.opts { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }
.opt { font-size: 1.15rem; padding: .6rem 1.4rem; min-width: 7rem;
  background: #3a2550; border-color: #6b3aa0; }
.opt:hover:not(:disabled) { background: #4c3168; }
.tbar { width: min(28rem, 90%); height: 6px; background: #333; border-radius: 3px;
  overflow: hidden; }
.tbar i { display: block; height: 100%; background: var(--accent);
  animation: shrink linear forwards; }
@keyframes shrink { from { width: 100%; } to { width: 0; } }
.waiting { align-self: center; padding: .45rem 1.4rem; border-radius: 999px;
  font-weight: 700; background: var(--accent); color: #1a0f18; margin-bottom: .4rem;
  animation: waitpulse 1.4s ease-in-out infinite; }
@keyframes waitpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 184, .6); }
  50% { box-shadow: 0 0 0 12px rgba(255, 122, 184, 0); }
}
.toast { min-height: 1.4em; color: #f0c060; font-size: 13px; text-align: center; }
.stimbox { margin-top: .6rem; padding: .6rem 1rem; border-radius: 10px;
  background: #16161e; border: 1px solid var(--line); }
.stimbox .sl { font-weight: 600; }
.stimbox .sbar { height: 8px; background: #333; border-radius: 4px; overflow: hidden;
  margin: .4rem 0; }
.stimbox .sf { height: 100%; background: #7fd6a0; transition: width .1s linear; }
.stimbox.medium .sf { background: #f0c060; }
.stimbox.intense .sf, .stimbox.shock .sf { background: #ff5f6d; }
.stimbox .st { font-variant-numeric: tabular-nums; color: var(--muted); }
.results { text-align: left; font-size: 1.1rem; }

/* Game pieces */
.cardrow { display: flex; gap: 2rem; justify-content: center; perspective: 1000px; }
.pcard { width: 170px; height: 250px; position: relative; transform-style: preserve-3d;
  transition: transform .6s; cursor: pointer; }
.pcard:hover:not(.flipped) { transform: translateY(-6px); }
.pcard.flipped { transform: rotateY(180deg); cursor: default; }
.pcard.picked .front { outline: 4px solid var(--accent); }
.pcard .face { position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 14px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; font-size: 1.5rem; font-weight: 800; }
.pcard .back { background: repeating-linear-gradient(45deg, #4b2a7a 0 10px,
  #3a1f60 10px 20px); border: 3px solid #a78bfa; font-size: 3rem; color: #d9c8f5; }
.pcard .front { transform: rotateY(180deg); color: #1a1a22; }
.pcard .front.light { background: #d9f5e3; }
.pcard .front.intense { background: #ffc9c9; }
.pcard .front small { font-size: .9rem; font-weight: 600; }
.bigcard { width: 130px; height: 180px; background: #f4f0ff; color: #222;
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 4rem; font-weight: 800; }
.status { color: var(--muted); margin: 0; }
.dicerow { display: flex; gap: 3rem; justify-content: center; }
.dice { text-align: center; }
.dfaces { font-size: 4.5rem; line-height: 1; }
.dsum { font-size: 1.4rem; font-weight: 700; }
.dlabel { color: var(--muted); }
.react { width: min(26rem, 90%); height: 9rem; font-size: 1.6rem; font-weight: 700;
  border-radius: 14px; }
.react.wait { background: #5a2a2a; border-color: #8a3a3a; }
.react.go { background: #2e9e5b; border-color: #3fd07a; }
.holdpad { width: 14rem; height: 14rem; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; background: #3a2550;
  border: 4px solid #6b3aa0; font-size: 1.3rem; font-weight: 700; user-select: none;
  touch-action: none; cursor: pointer; padding: 1rem; }
.holdpad.held { background: #2e7d4f; border-color: #3fd07a; }
.coin { width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe9a0, #c9962e); color: #5a3d00;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  font-weight: 800; }
.coin.spin { animation: flip .3s linear infinite; }
@keyframes flip { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.simon { display: grid; grid-template-columns: repeat(2, 120px); gap: 14px; }
.pad { height: 120px; border-radius: 16px; opacity: .45; border: 0; }
.pad.red { background: #e0474c; }
.pad.green { background: #3fbf6e; }
.pad.blue { background: #3f7fe0; }
.pad.yellow { background: #e8c93f; }
.pad:disabled { cursor: default; opacity: .45; }
.pad.lit, .pad.lit:disabled { opacity: 1; filter: brightness(1.3);
  box-shadow: 0 0 28px rgba(255, 255, 255, .5); }
.question { font-size: 2.4rem; font-weight: 700; }
.question.small { font-size: 1.35rem; max-width: 34rem; }
.wheel { display: grid; grid-template-columns: repeat(4, minmax(7rem, 1fr)); gap: .6rem;
  width: min(36rem, 100%); }
.seg { padding: .9rem .4rem; border-radius: 10px; background: #262634;
  border: 2px solid var(--line); font-weight: 600; transition: transform .08s; }
.seg.hot { background: #6b3aa0; border-color: var(--accent); transform: scale(1.06); }
