.lights-room {
  --lamp-coal: #272f2a;
  --lamp-frame: #535d4e;
  --lamp-olive: #aab784;
  --lamp-paper: #edf0df;
  --lamp-ink: #35402e;
  width: min(100%, 1260px);
  margin-inline: auto;
  color: var(--lamp-ink);
  text-align: left;
}
.lights-room .session-banner { text-align: left; margin: 0 0 20px; }
.game-shell .lights-room .lights-instruction,
.game-shell .lights-room .lights-rule {
  text-align: left; font-size: .95rem; line-height: 1.7;
  max-width: 65rem; margin: 18px 0 24px; color: #626d55;
}
.lights-console {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px;
  align-items: start; padding: 25px; background: var(--lamp-coal);
  border: 4px solid var(--lamp-frame); border-radius: 10px;
  box-shadow: inset 0 1px 0 #929a7b55, 0 5px 0 #17201726;
}
.lights-board {
  display: grid; grid-template-columns: 22px repeat(4, minmax(0, 1fr));
  gap: 10px; width: 100%; max-width: 650px; justify-self: center;
  padding: 0; color: #d4ddbf;
}
.lights-axis {
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; line-height: 1.3; min-width: 0;
}
.lights-switch {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; aspect-ratio: 1; min-width: 0; min-height: 72px;
  border: 2px solid #66715b; border-radius: 7px; padding: 9px 5px;
  background: #343d33; color: #bdc8ab; font: inherit;
  box-shadow: inset 0 1px 2px #8d967422, 0 3px 0 #151c15;
  cursor: pointer; position: relative;
}
.lights-address { font-size: .75rem; line-height: 1.25; font-weight: 750; }
.lights-lens {
  display: flex; align-items: center; justify-content: center;
  width: 45%; aspect-ratio: 1; flex: none; border: 2px solid #7f8a6e;
  border-radius: 50%; background: #1f271f;
  box-shadow: inset 0 3px 6px #0c140b88;
}
.lights-lens>span { font-size: clamp(1rem, 2.7vw, 2.2rem); line-height: 1; color: #8e9b7e; }
.lights-state { font-size: .73rem; line-height: 1.2; }
.lights-switch[data-lights-on="true"] {
  background: #a9b783; border-color: #d9e3b6; color: #2d3925;
  box-shadow: inset 0 2px 2px #f1f4d377, 0 3px 0 #172014;
}
.lights-switch[data-lights-on="true"] .lights-lens {
  border-color: #ebedc8; background: #eee9b3;
  box-shadow: inset 0 2px 4px #ffffff9c, 0 0 9px #dce4ac70;
}
.lights-switch[data-lights-on="true"] .lights-lens>span { color: #fffbea; }
.lights-switch[data-lights-preview="true"] { outline: 2px solid #d9d59b; outline-offset: 2px; }
.lights-switch[data-lights-hint="true"] .lights-address { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
button.lights-switch:focus-visible { outline: 3px solid #f2d991; outline-offset: 3px; }
.lights-controls {
  min-width: 0; padding: 20px; background: var(--lamp-paper);
  border: 1px solid #95a27c; border-radius: 6px; color: var(--lamp-ink);
}
.lights-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin: 0 0 20px; }
.lights-stats>div { display: grid; align-content: start; gap: 9px; min-width: 0; }
.lights-stats dt { font-size: .73rem; line-height: 1.45; color: #5e6852; }
.lights-stats dd { margin: 0; font-size: 2rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.game-shell .lights-room .lights-preview-note,
.game-shell .lights-room .lights-last-empty { text-align: left; margin: 15px 0; font-size: .83rem; line-height: 1.65; color: #5c684f; }
.lights-last-action { border-top: 1px solid #b7c1a1; padding-top: 16px; margin: 18px 0; }
.lights-last-action h3 { margin: 0 0 10px; font-size: .93rem; line-height: 1.6; }
.game-shell .lights-room .lights-last-action p { text-align: left; font-size: .79rem; line-height: 1.7; margin: 9px 0; color: #5c684f; }
.lights-primary-actions { display: grid; gap: 12px; margin: 20px 0 0; }
.lights-primary-actions .button { min-height: 49px; padding: 11px 13px; font-size: .86rem; line-height: 1.5; box-shadow: none; background: #63714a; color: #fffef0; }
.lights-primary-actions .button.secondary { background: #f7f8ec; color: #5e6c48; border: 1px solid #9eac87; }
.lights-room button:disabled { opacity: .5; cursor: default; }
.lights-hint { background: #f8f6dc; border-left: 4px solid #aa9b50; padding: 14px 16px; margin-top: 22px; }
.lights-hint h3 { font-size: .88rem; line-height: 1.6; margin: 0 0 10px; }
.game-shell .lights-room .lights-hint p { text-align: left; font-size: .8rem; line-height: 1.65; margin: 9px 0; }
.lights-room>.actions { justify-content: flex-start; }
.lights-room>.actions .button { min-height: 48px; background: #64714b; color: #fffef0; box-shadow: none; }
.lights-room>.actions .button.secondary { background: #f1f3e6; color: #5d6b47; border: 1px solid #a6b28f; }
.game-shell .lights-room .lights-comparison { text-align: left; font-size: 1rem; line-height: 1.7; color: #637651; margin: 20px 0; }
.lights-replay { background: var(--lamp-coal); border: 3px solid var(--lamp-frame); border-radius: 8px; padding: 24px; margin: 28px 0; }
.lights-replay>h3 { color: #e1e8ce; font-size: 1.1rem; margin: 0 0 15px; }
.game-shell .lights-room [data-lights-replay-index] { text-align: left; color: #a9b893; font-size: .9rem; line-height: 1.6; margin: 14px 0 22px; }
.lights-replay>.lights-board { width: min(100%, 520px); margin: 0 auto; }
.lights-replay .lights-switch { cursor: default; }
.lights-replay-controls { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 24px 0 0; }
.lights-replay-controls .button { min-height: 47px; background: #edf0df; border: 1px solid #a3af8c; color: #53633e; font-size: .88rem; box-shadow: none; }
.lights-trace-section { border-top: 2px solid #a8b894; margin-top: 28px; padding-top: 20px; }
.lights-trace-section>h3 { font-size: 1.08rem; margin: 0 0 20px; }
.lights-trace { list-style: none; padding: 0; margin: 0; }
.lights-trace>li { display: grid; grid-template-columns: 145px minmax(0, 1fr) auto; align-items: center; gap: 8px 24px; border-top: 1px solid #d5ddc8; padding: 15px 0; }
.lights-trace>li>strong { font-size: .91rem; }
.lights-trace>li>span { font-size: .82rem; line-height: 1.65; color: #70805e; }
.lights-trace>li>span:nth-of-type(2) { grid-column: 2; }
.lights-trace button { grid-column: 3; grid-row: 1/3; min-height: 45px; padding: 10px 14px; border: 1px solid #acb89b; background: #f2f5e8; color: #53633e; border-radius: 4px; font: inherit; font-size: .8rem; cursor: pointer; }
@media(min-width:1100px) {
  .game-shell.wide .lights-console>.lights-board { width: min(100%, calc(100dvh - 255px)); }
}
@media(max-width:999px) {
  .lights-console { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 18px; }
  .lights-console>.lights-board { max-width: 560px; }
  .lights-controls { padding: 20px; }
  .lights-switch { min-height: 75px; }
  .lights-stats dd { font-size: 1.8rem; }
}
@media(max-width:499px) {
  .lights-console { padding: 8px; border-width: 2px; gap: 18px; }
  .lights-board { grid-template-columns: 16px repeat(4, minmax(0, 1fr)); gap: 5px; }
  .lights-axis { font-size: .65rem; }
  .lights-switch { min-height: 64px; gap: 4px; padding: 6px 3px; border-radius: 5px; }
  .lights-address { font-size: .62rem; }
  .lights-state { font-size: .65rem; }
  .lights-lens { width: 46%; border-width: 1px; }
  .lights-lens>span { font-size: 1.2rem; }
  .lights-controls { padding: 17px 14px; }
  .lights-stats { gap: 10px; }
  .lights-stats dt { font-size: .69rem; }
  .lights-stats dd { font-size: 1.6rem; }
  .lights-trace>li { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .lights-trace>li>span:nth-of-type(2),.lights-trace button { grid-column: 1; grid-row: auto; }
  .lights-trace button { justify-self: start; }
  .lights-replay { padding: 13px 9px; }
  .lights-replay-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lights-replay-controls .button { font-size: .76rem; padding: 10px 6px; }
}
@media(prefers-reduced-motion:reduce) {
  .lights-room * { animation: none!important; transition: none!important; }
}
.lights-retry-controls>.actions { justify-content: flex-start; }
.lights-retry-controls .button { min-height: 48px; background: #64714b; color: #fffef0; box-shadow: none; }
.lights-retry-controls .button.secondary { background: #f1f3e6; color: #5d6b47; border: 1px solid #a6b28f; }
.lights-stats dt { min-height: 2.8em; }
.lights-hint { background: transparent; border: 0; border-top: 1px solid #b7c1a1; padding: 12px 0 0; margin-top: 15px; }
.lights-replay { scroll-margin-top: 65px; }
.page-game .game-shell.theme-lights:has(.lights-room) {
  --light-stage:#e2f0ec;
  --light-ink:#1a3545;
  background:radial-gradient(ellipse at 35% 10%,#eff8f3,var(--light-stage) 70%);
  color:var(--light-ink);
}
.page-game .game-shell.theme-lights:has(.lights-room) .game-toolbar {
  background:var(--light-stage);color:var(--light-ink);border-color:#a1beb9;
}
.page-game .game-shell.theme-lights:has(.lights-room) .game-toolbar .button {
  background:#f4faf2;color:#244c52;border-color:#8ba9a5;
}
.game-shell .play .lights-room {
  --lamp-coal:#203d4d;--lamp-frame:#627f87;--lamp-ink:var(--light-ink);
  width:min(100%,1200px);
}
.game-shell .play .lights-room .session-banner {text-align:left;margin:0 0 .45rem;max-width:none}
.game-shell .play .lights-room .session-banner h2 {
  color:var(--light-ink);text-align:left;margin:0;
  font-size:clamp(1.85rem,4vw,3.45rem);line-height:1.08;letter-spacing:-.035em;
}
.game-shell .play .lights-room :is(.lights-instruction,.lights-rule) {
  color:#3c5d5b;margin:.75rem 0 1rem;
}
.game-shell .play .lights-room .lights-console {
  width:100%;grid-template-columns:minmax(0,min(540px,57%)) minmax(0,1fr);
  align-items:center;gap:clamp(20px,4vw,55px);
  padding:0;border:0;background:transparent;box-shadow:none;
}
.lights-room .lights-board {
  box-sizing:border-box;width:100%;max-width:none;
  padding:clamp(9px,1.3vw,17px);
  border:1px solid #738c91;border-radius:12px;
  background:repeating-linear-gradient(130deg,#ffffff05 0 1px,transparent 1px 4px),linear-gradient(140deg,#2c4b59,#132d3a);
  color:#eff3e2;box-shadow:inset 0 0 0 3px #c1d0c02b,0 5px 0 #263e49,0 15px 24px #203e4b30;
}
.lights-room .lights-switch {
  background-color:#1c3544;background-image:linear-gradient(145deg,#304f5f,#1c3544);color:#f4f4e8;
  border-color:#67818c;border-radius:9px;box-shadow:inset 0 1px 0 #ffffff24,0 3px 0 #101d27;
}
.lights-room .lights-lens {
  width:44%;border-color:#6c8490;background:radial-gradient(circle at 45% 70%,#273d4a,#071824 75%);
  box-shadow:inset 0 3px 7px #0009,0 1px 1px #c1ddde55;
}
.lights-room .lights-lens>span {font-size:clamp(.8rem,2vw,1.55rem);color:#92acb9}
.lights-room .lights-switch[data-lights-on=true] {
  background-color:#91bab0;background-image:linear-gradient(145deg,#e2ebcb,#91bab0);border-color:#e9efd4;color:#193e43;
}
.lights-room .lights-switch[data-lights-on=true] .lights-lens {
  border-color:#ffd27d;background:radial-gradient(circle,#fff3bc 12%,#ffc755 48%,#b65a13 98%);
  box-shadow:inset 0 2px 3px #fff1ac,0 0 .85rem #f09c3cbb;
}
.lights-room .lights-switch[data-lights-on=true] .lights-lens>span {color:#fff7ce}
.lights-room .lights-switch[data-lights-preview=true] {outline:2px solid #62e8f1;outline-offset:1px}
.lights-room .lights-switch[data-lights-hint=true] {box-shadow:inset 0 0 0 2px #ffba59,0 3px 0 #101d27}
.lights-room button.lights-switch:focus-visible {outline:3px solid #fff49e;outline-offset:2px}
.game-shell .play .lights-room .lights-controls {padding:0;border:0;background:transparent;color:var(--light-ink)}
.game-shell .play .lights-room .lights-stats {
  padding:0 0 .8rem;margin:0 0 1rem;border-bottom:1px solid #a3c1ba;
  gap:0;
}
.game-shell .play .lights-room .lights-stats>div {padding:0 .7rem;border-inline-start:1px solid #a3c1ba;gap:.25rem}
.game-shell .play .lights-room .lights-stats>div:first-child {padding-inline-start:0;border:0}
.game-shell .play .lights-room .lights-stats dt {color:#3d5f60;font-size:.81rem;min-height:0;overflow-wrap:anywhere}
.game-shell .play .lights-room .lights-stats dd {font-size:clamp(1.6rem,4.1vw,3.15rem);line-height:1.1}
.game-shell .play .lights-room .lights-primary-actions {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;
}
.game-shell .play .lights-room .button {min-height:44px;white-space:normal;border-color:#355c66;background:#1f4654;color:white}
.game-shell .play .lights-room .button.secondary {border-color:#8ba9a5;background:#f4faf2;color:#244c52}
.game-shell .play .lights-room .button:disabled {opacity:.68}
.game-shell .play .lights-room .lights-preview-note {color:#36575b;margin:1rem 0 0}
.lights-room .lights-replay {background:#244550;border-color:#648a90}
.lights-room .lights-trace>li>span {color:#3f6060}
.game-shell.wide .play:has(>.lights-room) {width:100%;margin:auto;min-height:0;padding:clamp(16px,3vw,38px) clamp(12px,4vw,55px)}
.game-shell.wide .play .lights-room .lights-console>.lights-board {width:100%}
.game-shell.wide .play .lights-room[data-lights-phase=play] {display:block;width:min(100%,1200px)}
@media(min-width:800px) {
  .game-shell.wide .play .lights-room .lights-console {
    grid-template-columns:minmax(0,min(550px,56%,max(350px,calc(100dvh - 255px)))) minmax(0,1fr);
  }
}
@media(max-width:799px) {
  .game-shell .play .lights-room .lights-console {grid-template-columns:minmax(0,1fr);gap:1.35rem}
  .game-shell.wide .play:has(>.lights-room) {margin-block:0}
  .lights-room .lights-board {width:min(100%,480px);margin-inline:auto}
}
@media(max-width:400px) {
  .lights-room .lights-switch {min-height:51px;border-radius:6px}
  .lights-room .lights-board {gap:5px;padding:8px}
  .game-shell .play .lights-room .lights-stats dt {font-size:.71rem}
}
