:root { color-scheme: light; --pine: #173a36; --ink: #1c3531; --sand: #f8f4e7; --line: #c6ccba; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #e8e9da; font-family: 'Trebuchet MS', system-ui, sans-serif; }
main { margin: 0 auto; width: min(100%, 845px); padding: clamp(12px, 3vw, 30px); }
header a { font-size: .83rem; font-weight: bold; color: #28594d; text-underline-offset: .2em; }
h1, h2, p { margin: 0; }
h1 { margin-top: .25em; font: bold clamp(2.3rem, 6vw, 4.2rem)/1 Georgia, serif; letter-spacing: -.065em; }
h1 em { color: #8a382f; }
header p { margin-top: .42rem; font-size: .97rem; line-height: 1.35; }
fieldset { min-width: 0; }
.game-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .8rem; }
#share-game { font-size: .86rem; min-height: 44px; }
.game-share-feedback:not(:has([role=status]:empty)) { margin: 0 0 .6rem; }
.modes { width: fit-content; max-width: 100%; display: flex; flex-wrap: wrap; padding: 3px; margin: 1rem 0; background: #d3d9c9; border: 0; border-radius: .55rem; }
.modes label { position: relative; display: grid; cursor: pointer; text-align: center; }
.modes input, .sr { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.modes span { padding: .65rem .95rem; border-radius: .36rem; font-size: .88rem; font-weight: bold; }
.modes input:checked + span { color: #fff9e8; background: var(--pine); }
:focus-visible, .modes input:focus-visible + span { outline: 3px solid #99451e; outline-offset: 3px; }
.play-area { display: grid; grid-template-columns: minmax(0, .96fr) minmax(0, 1fr); gap: clamp(.65rem, 2vw, 1.25rem); align-items: start; }
.rink { min-width: 0; padding: 8px clamp(9px, 2vw, 18px) 12px; background: var(--pine); border: 1px solid #14332e; border-radius: .68rem; }
.rink-top { display: flex; justify-content: space-between; color: #f6f3dc; font-size: .77rem; font-weight: bold; line-height: 1.9; padding-bottom: .25em; gap: .4em; }
canvas { display: block; background: #e1eeee; border-radius: 3px; width: 100%; height: auto; aspect-ratio: 244 / 350; }
.desk { color: var(--ink); border: 1px solid var(--line); border-radius: .68rem; background: var(--sand); }
.desk-inner, details { padding: clamp(12px, 2.2vw, 22px); }
h2 { font: bold clamp(1.5rem, 3.2vw, 2rem)/1.1 Georgia, serif; letter-spacing: -.025em; }
#status { margin-top: .45rem; font-size: .97rem; line-height: 1.38; }
#placement, .record, details p { font-size: .85rem; line-height: 1.4; color: #3c564e; }
#placement { margin: .5rem 0 1.05rem; }
.range-label { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .15em .35em; font-weight: bold; }
.range-label output { color: #3e5b51; font-size: .8rem; font-weight: normal; }
input[type=range] { accent-color: #277061; width: 100%; margin: 0 0 .45rem; height: 34px; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
button { cursor: pointer; border-radius: .4rem; border: 1px solid #728578; background: transparent; color: var(--pine); min-height: 42px; line-height: 1.1; font-family: inherit; font-size: .95rem; font-weight: bold; padding: .58rem .9rem; }
.primary { background: #a64235; color: white; border-color: #8b352a; }
.primary[aria-pressed=true] { background: #18634e; border-color: #175540; }
.record:not(:empty) { display: block; margin-top: .7rem; }
details { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-size: .86rem; font-weight: bold; }
details p { margin-top: .6rem; }
textarea { width: 100%; margin-top: .7rem; height: 5em; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  main { padding: 8px 12px 12px; max-width: 490px; }
  .play-area { grid-template-columns: 1fr; gap: 8px; }
  .rink { padding: 5px 9px 9px; }
  .rink-top { font-size: .76rem; line-height: 1.5; }
  canvas { aspect-ratio: 350 / 244; }
  .desk-inner { padding: 10px 15px; }
  details { padding: 10px 15px; }
  h2 { font-size: 1.35rem; }
  #status { font-size: .9rem; margin-top: .23rem; }
  #placement { margin: .2rem 0 .35rem; font-size: .8rem; }
  .actions button { min-height: 44px; }
  h1 { margin-top: .08em; }
  header p { margin-top: .2rem; }
  .modes { margin: .45rem 0; }
  .modes span { padding-inline: .85rem; }
  #settings { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  #settings label { grid-row: 1; font-size: .88rem; }
  #settings input { grid-row: 2; margin: 0 0 .3rem; height: 32px; }
  .range-label output { font-size: .75rem; }
}
@media (forced-colors: active) {
  .modes input:checked + span { text-decoration: underline .18em; text-underline-offset: .2em; }
  .modes input:focus-visible + span { outline: 3px solid Highlight; outline-offset: 1px; }
}
