:root{
  color-scheme:dark;
  --bg:#08090d;
  --text:#f7f8fb;
  --muted:#b9bbc4;
  --silver:#bcc0c8;
  --red:#ca101b;
  --blue:#164df4;
  font-family:Arial,Helvetica,sans-serif;
  background:var(--bg);
  color:var(--text)
}
*{
  box-sizing:border-box
}
body{
  margin:0;
  min-height:100svh;
  background:radial-gradient(ellipse at 5% 5%,#950b1699,transparent 60%),radial-gradient(ellipse at 100% 85%,#a70a1899,transparent 60%),var(--bg)
}
[hidden]{
  display:none!important
}
button,input{
  font:inherit
}
button,a,input{
  touch-action:manipulation
}
button{
  min-height:52px;
  padding:12px 18px;
  border:1.5px solid var(--silver);
  border-radius:9px;
  background:linear-gradient(#35363a,#141519);
  color:var(--text);
  font-weight:700;
  cursor:pointer;
  transition:filter .12s,transform .12s
}
button:hover:enabled{
  filter:brightness(1.2)
}
button:active:enabled{
  transform:translateY(1px)
}
button:disabled{
  opacity:.38;
  cursor:default
}
a{
  color:var(--text);
  text-underline-offset:4px
}
a:focus-visible,button:focus-visible,input:focus-visible{
  outline:3px solid #ffc85a;
  outline-offset:4px
}
input[type=number],input[type=password],input[type=text]{
  width:100%;
  min-height:52px;
  border:1.5px solid #898d96;
  border-radius:8px;
  background:#17181b;
  color:var(--text);
  padding:10px 14px;
  font-size:22px
}
input[type=radio],input[type=checkbox]{
  accent-color:var(--blue);
  width:23px;
  height:23px;
  flex-shrink:0
}
h1,h2,p{
  margin-top:0
}
.primary{
  background:linear-gradient(#e41522,#790008);
  border-color:#ff5261
}
.wide{
  width:100%
}
.projection{
  height:calc(100svh - 44px);
  min-height:460px;
  max-width:2100px;
  margin:auto;
  padding:4vh 3vw;
  display:grid;
  grid-template-columns:minmax(0,.8fr) minmax(0,1.15fr);
  align-items:center;
  gap:5vw
}
.brand-art{
  border:2px solid var(--silver);
  box-shadow:0 0 40px #9e040c40;
  max-height:85vh;
  aspect-ratio:1;
  width:100%;
  overflow:hidden
}
.brand-art img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain
}
.game-display{
  height:100%;
  max-height:1000px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0
}
.display-heading{
  text-align:center;
  margin-bottom:2.5vh
}
.display-heading h1{
  font-size:clamp(36px,5vw,108px);
  font-weight:900;
  font-style:italic;
  letter-spacing:-.04em;
  line-height:1;
  margin-bottom:10px;
  text-shadow:0 2px 0 #777,0 0 25px #ffffff20
}
.display-heading p{
  font-size:clamp(16px,2.1vw,42px);
  font-weight:700;
  font-style:italic;
  margin:0
}
.board{
  position:relative;
  --row-height:clamp(34px,7.2vh,84px);
  width:100%;
  padding-bottom:2.8em
}
.steps{
  position:relative;
  border:0;
  clip-path:polygon(0 0,100% 0,73% 100%,27% 100%);
  box-shadow:0 0 20px #0009
}
.board-frame{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  fill:none;
  stroke:var(--silver);
  stroke-width:2px
}
.board-row{
  height:var(--row-height);
  display:flex;
  align-items:center;
  justify-content:center;
  border-bottom:2px solid var(--silver);
  background:linear-gradient(110deg,#080d16,#0c1017);
  transition:background .18s;
  color:#fff;
  overflow:hidden
}
.board-row:last-of-type{
  border-bottom:0
}
.board-row.pursued{
  background:linear-gradient(#ee000a,#b0000b 45%,#650005)
}
.board-row.wager-marker{
  background:linear-gradient(#1a5cff,#0639e2 45%,#00248d);
  box-shadow:inset 0 0 14px #6d9bff80
}
.row-label{
  font-size:clamp(22px,4.5vw,90px);
  font-weight:800;
  white-space:nowrap;
  padding:0 8px;
  line-height:1
}
.pursued:not(.wager-marker) .row-label{
  font-size:clamp(12px,1.6vw,30px);
  letter-spacing:.07em
}
.long-amount .row-label{
  font-size:clamp(14px,2.2vw,42px)
}
.offer-marker{
  background:linear-gradient(#154cb9,#061b41)
}
.offer-marker .row-label{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  font-size:clamp(20px,3.2vw,60px)
}
.offer-marker.long-amount .row-label{
  font-size:clamp(14px,2.2vw,42px)
}
.offer-name{
  font-size:clamp(9px,.9vw,16px);
  letter-spacing:.12em
}
.home-line{
  min-height:1.2em;
  max-width:95%;
  width:max-content;
  min-width:45%;
  margin:-1px auto 0;
  padding:4px 22px;
  border:2px solid var(--silver);
  border-top:0;
  text-align:center;
  font-size:clamp(20px,2.7vw,52px);
  font-weight:800;
  line-height:1.1;
  background:#11151b;
  overflow-wrap:anywhere
}
.is-home .home-line{
  background:#134b26;
  border-color:#7ceda0
}
.board-result{
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  text-align:center;
  font-weight:800;
  letter-spacing:.12em;
  font-size:clamp(16px,1.8vw,32px);
  color:#ffa8ad
}
.is-home .board-result{
  color:#8af5ac
}
.is-caught .wager-marker{
  box-shadow:inset 0 0 0 4px #ff4657,inset 0 0 22px #f001
}
.display-tools{
  height:44px;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:20px;
  padding:0 24px;
  font-size:14px;
  color:var(--muted)
}
.display-tools button{
  min-height:32px;
  padding:5px 14px;
  font-size:13px
}
.display-tools #connection:not(.offline){
  opacity:.6
}
#connection{
  color:#9bebad;
  font-size:14px;
  white-space:nowrap
}
.offline,#connection.offline{
  color:#ffbc70
}
:fullscreen .display-tools button{
  display:none
}
.controller-shell{
  max-width:620px;
  margin:0 auto;
  padding:22px 18px max(24px,env(safe-area-inset-bottom))
}
.controller-header{
  border-bottom:1px solid #6c6b70;
  padding-bottom:18px;
  margin-bottom:16px
}
.controller-header h1{
  font-size:clamp(24px,6.5vw,36px);
  margin-bottom:12px;
  letter-spacing:-.025em
}
.controller-header p{
  font-size:14px;
  line-height:1.5;
  color:var(--muted);
  margin-bottom:16px
}
.controller-links{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px
}
.controller-links a{
  font-size:16px;
  min-height:32px;
  display:inline-flex;
  align-items:center
}
.controller-icons{
  display:flex;
  gap:10px
}
.mode-switch,.timer-buttons,.timer-fields{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px
}
.mode-switch{
  margin-bottom:18px;
  grid-template-columns:repeat(3,minmax(0,1fr))
}
.mode-switch button{
  padding:10px 4px;
  font-size:15px
}
.mode-switch [aria-pressed=true]{
  background:linear-gradient(#c70512,#5b0008);
  border-color:#ff6572;
  opacity:1
}
.timer-panel{
  padding:36px 20px;
  text-align:center;
  border:2px solid var(--silver);
  background:linear-gradient(135deg,#131922,#080b12);
  border-radius:8px
}
.timer-heading{
  font-size:clamp(16px,1.6vw,30px);
  letter-spacing:.1em;
  margin-bottom:14px
}
.timer-clock{
  font-size:clamp(60px,10vw,180px);
  font-weight:800;
  font-variant-numeric:tabular-nums;
  line-height:1.1
}
.timer-status{
  color:var(--muted);
  font-size:clamp(16px,1.6vw,30px);
  margin:10px 0 28px
}
.timer-total{
  font-size:clamp(25px,4.6vw,84px);
  font-weight:800;
  color:#8ab9ff;
  overflow-wrap:anywhere
}
.timer-correct{
  font-size:clamp(16px,1.7vw,32px);
  margin:18px 0 10px
}
.timer-rate{
  font-size:clamp(13px,1.3vw,24px);
  margin:0;
  color:var(--muted)
}
.timer-expired .timer-clock{
  color:#ff7b88
}
.timer-preview{
  max-width:420px;
  margin:0 auto 18px;
  padding:18px 12px
}
.timer-preview .timer-heading{
  font-size:12px;
  margin-bottom:6px
}
.timer-preview .timer-clock{
  font-size:64px
}
.timer-preview .timer-status{
  font-size:14px;
  margin:4px 0 12px
}
.timer-preview .timer-total{
  font-size:30px
}
.timer-preview .timer-correct{
  font-size:14px;
  margin:12px 0 6px
}
.timer-preview .timer-rate{
  font-size:12px
}
.timer-fields label{
  font-size:14px;
  font-weight:700;
  min-width:0
}
.timer-fields input{
  margin-top:8px;
  font-size:19px;
  padding:10px 8px
}
#timer-setup-form>.wide{
  margin-top:12px
}
.timer-buttons{
  margin:16px 0
}
.clock-start{
  background:linear-gradient(#14713d,#084126);
  border-color:#6fdb9b
}
.clock-stop{
  background:linear-gradient(#bb1627,#740c17);
  border-color:#ff7181
}
.timer-buttons span{
  display:inline-block;
  margin-right:5px
}
.correct-answer{
  min-height:64px;
  font-size:20px;
  background:linear-gradient(#1758ee,#072b83);
  border-color:#739fff
}
.value-buttons,.final-turn-buttons,.final-counter-controls,.final-counter-controls section>div{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px
}
.value-buttons button{
  min-height:64px;
  font-size:19px
}
.value-buttons{
  margin-bottom:22px
}
.value-input{
  display:flex;
  align-items:center;
  border:1.5px solid #898d96;
  border-radius:8px;
  background:#17181b;
  margin-top:8px;
  padding:0 10px;
  min-width:0
}
.value-input input{
  min-width:0;
  width:100%;
  border:0;
  margin:0;
  padding:10px 4px
}
.value-input span{
  font-size:17px;
  color:var(--muted)
}
.settings-form.units-only{
  grid-template-columns:1fr
}
.settings-form.units-only fieldset{
  flex-direction:row;
  gap:24px
}
.final-track{
  display:flex;
  min-height:100px;
  border:3px solid var(--silver);
  border-radius:16px;
  overflow:hidden;
  margin-bottom:18px;
  background:#063080
}
.final-beast-score,.final-team-score{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:100px;
  padding:8px
}
.final-beast-score{
  background:linear-gradient(#fa3b25,#a9070b)
}
.final-team-score{
  background:linear-gradient(#b0ecff,#68b5ef);
  color:#071c4a
}
.final-track strong{
  font-size:48px;
  line-height:1
}
.final-track small{
  font-size:13px;
  font-weight:700;
  margin-bottom:7px
}
.final-segments{
  display:flex;
  flex:1;
  min-width:0
}
.final-segment{
  flex:1;
  border-left:2px solid #07316b;
  background:linear-gradient(#2386ff,#075bc8)
}
.final-segment.caught{
  background:linear-gradient(#f7492c,#bd0716)
}
.final-outcome{
  font-weight:800;
  color:#ffc07b;
  font-size:24px;
  margin:0 0 12px
}
.final-outcome:empty{
  display:none
}
.is-final .timer-clock{
  font-size:clamp(60px,8vw,145px)
}
.is-final .timer-status{
  margin-bottom:15px
}
.is-final .timer-total{
  font-size:clamp(22px,3.5vw,60px)
}
.timer-preview .final-track{
  min-height:58px;
  border-width:2px;
  border-radius:10px
}
.timer-preview .final-beast-score,.timer-preview .final-team-score{
  min-width:58px;
  padding:6px 4px
}
.timer-preview .final-track strong{
  font-size:25px
}
.timer-preview .final-track small{
  font-size:8px;
  margin-bottom:3px
}
.timer-preview.is-final .timer-clock{
  font-size:60px
}
.timer-preview.is-final .timer-total{
  font-size:28px
}
.timer-preview .final-outcome{
  font-size:16px
}
.final-counter-controls{
  margin:0 0 18px
}
.final-turn-buttons{
  margin-bottom:18px
}
.final-setup-panel{
  margin-top:18px
}
.final-counter-controls section{
  text-align:center;
  border:1px solid var(--silver);
  border-radius:9px;
  padding:12px 8px
}
.final-counter-controls h2{
  font-size:14px;
  margin:0 0 10px
}
.final-counter-controls strong{
  display:block;
  font-size:32px;
  margin-bottom:12px
}
.final-counter-controls button{
  padding:8px 2px;
  font-size:22px
}
#final-setup-form label{
  display:block;
  font-weight:700;
  font-size:14px;
  margin-bottom:8px
}
#final-setup-form button{
  margin:12px 0 18px
}
.controller-links .icon-button{
  display:inline-flex;
  justify-content:center;
  align-items:center;
  min-width:48px;
  width:48px;
  min-height:48px;
  height:48px;
  padding:0;
  font-size:26px;
  border:1px solid #656770;
  border-radius:8px;
  text-decoration:none;
  background:linear-gradient(#24252b,#111216)
}
.preview{
  --row-height:25px;
  padding-bottom:24px;
  max-width:420px;
  margin:0 auto 18px
}
.preview .steps{
  border-width:2px
}
.preview .board-row{
  border-bottom-width:1px
}
.preview .row-label{
  font-size:20px
}
.preview .long-amount .row-label{
  font-size:12px
}
.preview.is-offering{
  --row-height:34px
}
.preview .offer-marker .row-label{
  font-size:18px;
  gap:1px
}
.preview .offer-marker.long-amount .row-label{
  font-size:12px
}
.preview .offer-name{
  font-size:7px
}
.preview .pursued:not(.wager-marker) .row-label{
  font-size:11px
}
.preview .home-line{
  font-size:18px;
  padding:3px 15px
}
.preview .board-result{
  font-size:13px
}
.control-columns{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px
}
.move-group{
  border:1.5px solid var(--silver);
  border-radius:9px;
  overflow:hidden;
  padding-bottom:10px
}
.move-group h2{
  font-size:18px;
  text-align:center;
  line-height:1;
  margin:0 0 10px;
  padding:14px 4px;
  background:linear-gradient(#c70512,#5b0008);
  border-bottom:1px solid #555
}
.wager-controls h2{
  background:linear-gradient(#124df0,#071856)
}
.move-group button{
  display:block;
  width:calc(100% - 18px);
  margin:8px 9px 0;
  padding:12px 4px;
  font-size:17px;
  min-height:56px
}
.undo{
  margin:14px 0 26px
}
.settings-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:16px 12px;
  align-items:start
}
.amount-field label{
  display:block;
  font-weight:700;
  font-size:16px;
  margin-bottom:10px
}
.settings-form fieldset{
  display:flex;
  flex-direction:column;
  gap:0;
  align-items:flex-start;
  min-width:0;
  border:0;
  padding:0;
  margin:0
}
.settings-form legend{
  float:none;
  font-weight:700;
  padding:0;
  font-size:16px;
  margin-bottom:4px
}
.settings-form fieldset label,.check-label{
  display:flex;
  align-items:center;
  gap:7px;
  min-height:36px
}
.settings-form .primary{
  grid-column:1/-1
}
.reset{
  margin-top:22px;
  background:transparent;
  border-color:#eb3f4d
}
.text-button{
  display:block;
  margin:auto;
  border:0;
  background:transparent;
  font-weight:400;
  text-decoration:underline;
  min-height:48px
}
.notice:empty{
  display:none
}
.notice{
  font-size:14px;
  line-height:1.5;
  padding:10px 12px;
  background:#112a19;
  border-left:3px solid #8fdfa3;
  border-radius:3px
}
.notice.error{
  background:#34191b;
  border-color:#fc7983
}
.login-section{
  text-align:center;
  padding-top:12px
}
.login-section img{
  border:1px solid var(--silver);
  border-radius:8px
}
.login-section h2{
  font-size:22px;
  margin:20px 0
}
.login-section form{
  text-align:left;
  max-width:380px;
  margin:auto
}
.login-section form>label:first-child{
  display:block;
  margin-bottom:8px
}
.login-section .primary{
  width:100%;
  margin-top:10px
}
.check-label{
  font-size:14px;
  margin-top:8px
}
dialog{
  background:#15151b;
  color:var(--text);
  border:1px solid var(--silver);
  border-radius:12px;
  width:min(90vw,440px);
  padding:24px
}
dialog::backdrop{
  background:#000b
}
dialog h2{
  font-size:24px
}
dialog p{
  line-height:1.6;
  color:var(--muted)
}
.dialog-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap
}
.dialog-actions button{
  flex:1
}
.offers-panel{
  margin:0 0 18px;
  border:1px solid #696b74;
  border-radius:8px;
  padding:0 12px
}
.offers-panel summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
  min-height:48px;
  cursor:pointer;
  font-weight:700;
  list-style:none
}
.offers-panel summary::after{
  content:'⌄';
  font-size:22px
}
.offers-panel[open] summary::after{
  transform:rotate(180deg)
}
.offers-panel form{
  padding:8px 0 12px
}
.offer-fields,.offer-choice-buttons{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px
}
.offer-fields label{
  min-width:0;
  font-size:14px;
  font-weight:700
}
.offer-fields input{
  margin-top:8px;
  padding:10px 6px;
  font-size:16px
}
.offer-choice-buttons button{
  padding:10px 3px;
  font-size:14px
}
#hide-offers{
  margin-bottom:12px
}
#configuration-dialog{
  width:min(92vw,520px);
  max-height:90svh;
  overflow-y:auto
}
#configuration-form>label{
  display:block;
  margin:20px 0 9px;
  font-weight:700;
  font-size:15px
}
#configuration-form input[type=text]{
  font-size:18px
}
.configuration-image-preview{
  display:block;
  max-width:100%;
  object-fit:contain;
  background:#08090d;
  border:1px solid #696b74;
  margin-bottom:12px
}
#display-image-input{
  width:100%;
  min-height:48px;
  font-size:12px;
  padding:8px 0;
  overflow:hidden
}
.field-hint{
  font-size:12px;
  line-height:1.5
}
#use-original-image{
  margin:0 0 24px;
  font-size:14px
}
@media(min-width:900px){
  .controller-shell{
    max-width:800px
  }
  .controller-header h1{
    text-align:center
  }
  .controller-header p{
    text-align:center
  }
  .preview{
    --row-height:29px;
    max-width:450px
  }
  .move-group button{
    font-size:20px
  }
  .settings-form fieldset{
    flex-direction:row;
    gap:16px
  }
}
@media(max-width:700px){
  .projection{
    height:auto;
    min-height:calc(100svh - 44px);
    padding:20px 18px;
    grid-template-columns:1fr;
    gap:20px
  }
  .brand-art{
    width:140px;
    margin:auto
  }
  .game-display{
    min-height:460px
  }
  .display-heading h1{
    font-size:44px
  }
  .display-heading p{
    font-size:18px
  }
  .board:not(.preview){
    --row-height:50px
  }
  .board:not(.preview) .row-label{
    font-size:32px
  }
  .board:not(.preview) .home-line{
    font-size:24px
  }
  .board:not(.preview) .pursued:not(.wager-marker) .row-label{
    font-size:16px
  }
  .display-tools{
    justify-content:space-between
  }
  .controller-shell{
    padding-left:14px;
    padding-right:14px
  }
}
@media(max-width:370px){
  .controller-header p{
    font-size:12px
  }
  .move-group h2{
    font-size:16px
  }
  .move-group button{
    font-size:15px
  }
  .settings-form fieldset label{
    font-size:14px
  }
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    transition:none!important;
    animation:none!important
  }
}
