.game-app {
  background: radial-gradient(ellipse at 75% -25%, #352940, transparent 39rem), var(--ui-bg);
}
.game-shell { max-width: 66rem; }
.game-intro { padding: clamp(1.4rem, 4vw, 3.25rem) 0 1rem; }
#game-menu { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .76rem; margin-bottom: 1.2rem; }
.game-entry {
  --game-tone: #d7b9fc;
  display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: .88rem;
  min-width: 0; min-height: 8rem; text-align: start;
  border: 1px solid var(--ui-stroke); border-radius: var(--ui-radius);
  background: var(--ui-surface); color: var(--ui-text); padding: 1.05rem;
  transition: border-color .18s ease, background-color .18s ease;
}
.game-entry:hover { border-color: var(--game-tone); background: var(--ui-raised); }
.game-entry[data-family=dog] { --game-tone: #ff9a85; }
.game-entry[data-family=cards] { --game-tone: #efca9d; }
.game-entry[data-family=truth-dare] { --game-tone: #f5a7c4; }
.game-entry strong { display: block; font-size: 1.21rem; font-weight: 710; line-height: 1.25; }
.game-entry small { display: block; color: var(--ui-muted); font-size: .94rem; line-height: 1.55; margin-top: .42rem; overflow-wrap: anywhere; }
.game-glyph {
  display: grid; place-items: center; position: relative;
  font-size: 0;
  width: 3.15rem; height: 3.15rem; border-radius: .95rem;
  color: var(--game-tone);
  background: color-mix(in srgb,var(--game-tone),var(--ui-surface) 88%);
  border: 1px solid color-mix(in srgb,var(--game-tone),var(--ui-stroke) 79%);
}
.game-glyph::before, .game-glyph::after { content: ""; position: absolute; }
[data-family=flight] .game-glyph::before { width: 1.13rem; height: 1.13rem; border: 1.5px solid; border-radius: .24rem; transform: rotate(-14deg); }
[data-family=flight] .game-glyph::after { width: .22rem; height: .22rem; border-radius: 50%; background: currentColor; box-shadow: -.27rem -.23rem currentColor, .27rem .23rem currentColor; }
[data-family=dog] .game-glyph::before { width: 1.12rem; height: .76rem; border: 1.5px solid; border-radius: .16rem .16rem .16rem .45rem; transform: rotate(-37deg); }
[data-family=dog] .game-glyph::after { width: .23rem; height: .23rem; border-radius: 50%; background: currentColor; transform: translate(.23rem,-.18rem); }
[data-family=cards] .game-glyph::before { width: .8rem; height: 1.14rem; border: 1.5px solid; border-radius: .19rem; transform: translate(-.2rem,.05rem) rotate(-19deg); }
[data-family=cards] .game-glyph::after { width: .8rem; height: 1.14rem; border: 1.5px solid; border-radius: .19rem; background: #363038; transform: translate(.18rem,-.04rem) rotate(12deg); }
[data-family=truth-dare] .game-glyph::before { width: 1.18rem; height: .9rem; border: 1.5px solid; border-radius: .31rem; }
[data-family=truth-dare] .game-glyph::after { width: .3rem; height: .3rem; bottom: .9rem; left: 1.16rem; transform: rotate(45deg); border: solid; border-width: 0 1.5px 1.5px 0; background: #393037; }

#modes { max-width: 48rem; }
.play-main, .session-panel, .board-panel {
  border: 1px solid var(--ui-stroke); background: var(--ui-surface); border-radius: var(--ui-radius);
  min-width: 0;
}
.mode-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.mode-entry {
  position: relative;
  min-width: 0; min-height: 4.85rem;
  padding: .75rem 2rem .75rem .85rem;
  border: 1px solid var(--ui-stroke); border-radius: var(--ui-radius);
  background: var(--ui-surface); color: var(--ui-text);
  text-align: start; overflow-wrap: anywhere;
}
.mode-entry:hover { border-color: var(--ui-accent); background: var(--ui-raised); }
.mode-entry::after {
  content: ""; position: absolute; inset-inline-end: .9rem; top: 50%;
  width: .42rem; height: .42rem;
  border: solid var(--ui-accent); border-width: 1.5px 1.5px 0 0;
  transform: translateY(-50%) rotate(45deg);
}
.mode-info { display: grid; gap: .3rem; }
.mode-info strong { line-height: 1.3; }
.mode-info small, .mode-note { color: var(--ui-muted); font-size: .85rem; }
.mode-note { margin: .75rem 0 1.1rem; }
.party-options {
  margin-top: .8rem; padding: 0 .85rem;
  border: 1px solid var(--ui-stroke); border-radius: var(--ui-radius);
  background: var(--ui-surface);
}
.party-options[open] { padding-bottom: .7rem; }
.party-options summary { cursor: pointer; padding-block: .73rem; font-weight: 620; }
.party-options .people { display: flex; align-items: center; gap: .7rem; margin: .1rem 0 .65rem; }
.party-options input[type=number] {
  width: 5.5rem; min-height: 2.75rem; padding: .35rem .55rem;
  border: 1px solid var(--ui-stroke); border-radius: .6rem;
  background: var(--ui-bg); color: inherit;
}
.party-options fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
.party-options fieldset label { display: inline-flex; align-items: center; gap: .28rem; min-height: 2.75rem; margin-inline-end: .7rem; }
.party-options input[type=checkbox] { accent-color: var(--ui-accent); }

.play { margin: clamp(.8rem,3vw,1.65rem) 0 1rem; }
.play-header { padding: .65rem 0 .95rem; }
.run-header { display: flex; justify-content: space-between; align-items: start; gap: .6rem 1.3rem; flex-wrap: wrap; }
.run-header .ui-display { font-size: clamp(1.58rem,4.7vw,2.65rem); }
#round-count { padding: .33rem .68rem; min-height: 2rem; border-radius: .52rem; font: 650 .85rem var(--ui-font); background: #35272b; color: var(--ui-accent); white-space: nowrap; }
#roles, #play-state { margin: .36rem 0 0; font-size: .9rem; }
#play-state:not(:empty) { color: #d9c5d7; }
.play-grid { display:grid; grid-template-columns: minmax(0, 1.55fr) minmax(15rem, 1fr); align-items: start; gap: .76rem; }
.play-main, .session-panel, .board-panel { padding: clamp(.8rem,2.3vw,1.28rem); }
.play-side { display:grid; min-width:0; gap:.7rem; }
.game-task {
  background: linear-gradient(145deg,#33242c,#2b2531 72%); border: 1px solid #61434e;
  border-radius: .84rem; padding: clamp(.8rem,2.5vw,1.45rem); overflow-wrap: anywhere;
}
.game-task h2 { margin: .43rem 0; font-size: clamp(1.15rem,2.75vw,1.58rem); line-height: 1.55; font-weight: 650; }
.game-task p { margin: .28rem 0; color: var(--ui-muted); white-space: pre-line; }
#task-meta { font-weight: 650; font-size: .835rem; color: var(--ui-accent); }
#task-detail { font-size: .93rem; }
#task-hint { margin-top: .72rem; padding-top: .62rem; border-top: 1px solid #5a424f; font-size: .86rem; }
.turn-actions { gap: .46rem; margin-top: .75rem; }
.turn-actions:first-child { margin-top: 0; }
#draw:not([hidden]), #draw-truth:not([hidden]), #draw-dare:not([hidden]) { flex: 1 1 8rem; }
.turn-actions #complete, .turn-actions #skip, .turn-actions #pause { flex: 1 1 5.25rem; }
.board-panel h2 { margin: 0 0 .56rem; font-size: 1rem; }
.track { display:grid; grid-template-columns:repeat(9,minmax(0,1fr)); gap: .2rem; }
.track span {
  display:grid; place-content:center; min-height:1.66rem; border-radius:.32rem;
  background: #2c2932; color: #c6bac7; font-size: .76rem; font-variant-numeric: tabular-nums;
}
.track .position { background: var(--ui-accent); color: var(--ui-accent-ink); font-weight: 760; }
.cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap: .5rem; margin-bottom: .66rem; }
.cards .action {
  min-height: 6rem; padding-inline:.35rem;
  background: repeating-linear-gradient(-37deg,#352c43 0 10px,#383047 10px 20px);
  border-color: #51445f;
}
.session-panel summary { font-size: .92rem; font-weight: 650; cursor:pointer; }
.session-panel .actions { margin-top: .7rem; }
#history { overflow-wrap: anywhere; padding-inline-start: 1.45rem; margin-block: .55rem; color: var(--ui-muted); font-size: .9rem; }
#history li { margin-block: .34rem; }
#notice { color: var(--ui-muted); margin: 1rem 0 1.35rem; }
#notice:empty { display:none; }
@media(max-width:740px) {
  .play-grid { grid-template-columns: minmax(0,1fr); }
  .play-side { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .play-side:has(#board-panel[hidden]) { grid-template-columns: minmax(0,1fr); }
}
@media(max-width:540px) {
  #game-menu { grid-template-columns: minmax(0,1fr); gap: .56rem; }
  .game-entry { min-height: 4.9rem; padding: .76rem; gap: .72rem; }
  .game-glyph { width: 2.8rem; height: 2.8rem; border-radius: .76rem; }
  .game-entry strong { font-size: 1.09rem; }
  .game-entry small { margin-top: .28rem; font-size: .87rem; }
  .play-side { grid-template-columns: minmax(0,1fr); }
  .track { grid-template-columns: repeat(12,minmax(0,1fr)); }
  .track span { min-height:1.55rem; font-size:.73rem; }
}
@media(max-width:355px) {
  .track { grid-template-columns:repeat(9,minmax(0,1fr)); }
  .turn-actions .action { padding-inline:.55rem; }
}
