#title {
  position: absolute;
  inset: max(12%, calc(64px + var(--safe-top))) 0 max(5%, calc(12px + var(--safe-bottom)));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: 12px;
}
.title-brand {
  grid-area: 1 / 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: min(92%, 600px);
  min-height: 0;
  container-type: size;
  color: #fff1bc;
  font: 800 32px/1 var(--serif);
}

#title-menu {
  position: absolute;
  z-index: 4;
  top: calc(9px + var(--safe-top));
  right: max(12px, var(--kids-inset-right, 0px), env(safe-area-inset-right, 0px));
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid #ffce7b91;
  border-radius: 15px;
  background: #111e49e8;
  color: #fff0bf;
  box-shadow: 0 4px 10px #02081780;
}
#title-menu svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
#title-menu:focus-visible { outline-color: #fff1ac; }
#title-menu:active { background: #303964; }
#stall:has(#sheet[open]) #title-menu { visibility: hidden; }

#title-practice {
  position: relative;
  grid-area: 1 / 1;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
#title-swipe { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#title-practice[data-steady] #title-swipe { pointer-events: none; }
#title-tap, #title-swipe-hint {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #e6b9749c;
  border-radius: 26px;
  background: #111b44e8;
  color: #fff1cc;
}
#title-tap {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 52px;
  padding: 4px 13px 4px 6px;
  font-size: 14px;
  white-space: nowrap;
}
#title-tap img { width: 40px; height: 40px; object-fit: contain; }
#title-practice:not([data-steady]) #title-tap:not(:focus-visible) { opacity: 0; pointer-events: none; }
#title-tap:focus-visible { outline-color: #fff1ac; outline-offset: -3px; }
#title-practice:has(#title-tap:focus-visible) #title-swipe-hint { display: none; }
#title-swipe-hint { padding: 4px 10px; pointer-events: none; font-size: 13px; white-space: nowrap; }
.title-brand img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  filter: drop-shadow(0 9px 14px #020922a0);
}
#logo-replay {
  position: relative;
  z-index: 2;
  display: grid;
  place-self: center;
  width: min(100%, calc(100cqh * 1.516));
  aspect-ratio: 1040 / 686;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: none;
  touch-action: manipulation;
}
#logo-replay:focus-visible { outline: 3px solid #ffedaa; }
#logo-replay img { grid-area: 1 / 1; pointer-events: none; }
#title-opening {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#stall[data-title-opening] :is(#logo-art, #title-practice) { visibility: hidden; }
#stall[data-title-opening]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 41%, #200d1414 14%, #03081966 75%);
  pointer-events: none;
}
#stall[data-title-opening='slice']::before {
  background: radial-gradient(ellipse at 50% 43%, #ed8a2f26 0%, #070c3244 70%);
}
@media (prefers-reduced-motion: no-preference) {
  #stall[data-screen='loading']::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #03081ab3;
    pointer-events: none;
  }
}

/* The art supplies the peel and its edge. The live button supplies the label and hit area. */
.title-actions {
  grid-area: 2 / 1;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  width: min(92%, 412px);
}
.mode-choice {
  --skin: url('art/choice-orange.webp');
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 54px;
  padding: 8px 9px 12px;
  border: 0;
  border-radius: 20px;
  color: #2d1a14;
  background: none;
  font: 950 clamp(15px, 3.9vw, 18px)/1.12 var(--sans);
  transition: transform 115ms cubic-bezier(.23, 1, .32, 1);
}
.mode-choice::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--skin) center / 100% 100% no-repeat;
  filter: drop-shadow(0 5px 5px #080c21a0);
  pointer-events: none;
}
.mode-choice:active:not(:disabled) { transform: translateY(2px) scale(.985); }
.mode-choice:focus-visible { outline: 3px solid #ffedaa; outline-offset: 2px; }
#start { grid-column: 1 / -1; min-height: 64px; font-size: clamp(20px, 5.6vw, 25px); }
#christmas {
  --skin: url('art/choice-lime.webp');
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
  align-items: center;
  gap: 6px;
  color: #fff7dc;
}
#christmas::before { filter: brightness(.51) hue-rotate(35deg) saturate(.88) drop-shadow(0 4px 5px #080c21a0); }
#christmas img { width: 30px; height: 29px; object-fit: contain; transform: rotate(16deg); }
#shifts { --skin: url('art/choice-lime.webp'); color: #19240d; }
#daily { --skin: url('art/choice-plum.webp'); color: #fff4da; }
#daily::before { filter: brightness(.69) drop-shadow(0 5px 5px #080c21a0); }
#stall[data-still] .mode-choice { transition: none; }
#stall[data-still] .mode-choice:active { transform: none; }

#stall:has(#sheet[open]) .pk-bar { visibility: hidden; }
#stall:has(#sheet:is([data-kind='pause'], [data-round-options])[open]) #hint { visibility: hidden; }

#sheet[data-kind='pause'] {
  width: min(calc(100% - 32px), 295px);
  padding: 20px;
  border: 1px solid #dfb76a;
  color: #fff1cf;
  background: radial-gradient(ellipse at 50% -50%, #605075, #182446 72%);
  text-align: center;
}
#sheet[data-kind='pause']::backdrop { background: #070d2ba8; }
#sheet[data-kind='pause'] #sheet-title { margin: 0 0 15px; font-size: 31px; }
#sheet[data-kind='pause'] #sheet-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; margin: 0; }
#sheet[data-kind='pause'] .light {
  border-color: #ddc28c80;
  background: #fff1cf11;
  color: #fff1cf;
  box-shadow: none;
}
#sheet[data-kind='pause'] button:focus-visible { outline-color: #fff3c4; }
#sheet[data-kind='result'] { text-align: center; }
#sheet[data-kind='result'] #sheet-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#sheet[data-kind='result'] .primary { grid-column: 1 / -1; }
#sheet[data-kind='result'] .light { background: transparent; box-shadow: none; }
#sheet[data-kind='result'] button { padding-inline: 8px; }

#sheet[data-stall-menu][open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(calc(100% - 28px), 500px);
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px);
  overflow: hidden;
  padding: 0;
  border: 1px solid #e5b367;
  border-radius: 20px;
  background: #ffefd2;
  box-shadow: 0 16px 38px #080a24a0, 0 0 0 1px #513723;
}
#sheet[data-stall-menu]::backdrop { background: #0b1235aa; }
#sheet[data-stall-menu] #sheet-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 73px;
  align-items: end;
  padding: 3px 18px 13px;
  border-bottom: 1px solid #d49557;
  color: #fff2cc;
  background: radial-gradient(ellipse at 87% 75%, #52476b 0%, #253155 40%, #20274c 75%);
}
#sheet[data-stall-menu] #sheet-title {
  margin: 0;
  font-size: clamp(26px, 7vw, 37px);
  text-shadow: 0 2px #0b1536;
}
#menu-back {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-self: start;
  min-width: 66px;
  min-height: 52px;
  margin: 0 0 0 -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #ffdea2;
  font-size: 15px;
  font-weight: 880;
}
#menu-back:focus-visible { outline-color: #ffdea2; outline-offset: -4px; }
#menu-close {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #ffdea2;
}
#menu-close:focus-visible { outline-color: #ffdea2; outline-offset: -4px; }
#menu-emblem {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 100%;
  height: 73px;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px #11142c);
}
#sheet[data-stall-menu] #sheet-content {
  min-height: 0;
  max-height: none;
  padding: 14px 18px 18px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #ae8159 #ffefd2;
}
#sheet[data-stall-menu] #sheet-actions { display: none; }
#sheet[data-kind='shifts'][open] { width: min(calc(100% - 28px), 710px); grid-template-rows: auto minmax(0, 1fr) auto; }
#sheet[data-kind='shifts'] #sheet-heading { grid-template-columns: minmax(0, 1fr) 52px; align-items: center; padding-block: 5px; }
#sheet[data-kind='shifts'] #sheet-content { max-height: none; }
#sheet[data-kind='shifts'] #sheet-actions { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 7px 18px 10px; border-top: 1px solid #d2aa7d; }
#sheet[data-kind='options'][open] { grid-template-rows: auto minmax(0, 1fr) auto; }
#sheet[data-kind='options'] #sheet-heading {
  grid-template-columns: minmax(0, 1fr) 55px 52px;
  align-items: center;
  gap: 8px;
  padding-block: 8px;
}
#sheet[data-kind='options'] #menu-emblem { height: 55px; grid-row: 1; }
#sheet[data-round-options][open] { grid-template-rows: auto minmax(0, 1fr); }
#sheet[data-round-options] #sheet-heading { grid-template-columns: minmax(0, 1fr) 55px; row-gap: 0; }
#sheet[data-round-options] #menu-emblem { grid-row: 1 / 3; }
#sheet[data-kind='options'] #sheet-actions {
  display: flex;
  justify-content: flex-start;
  margin: 0;
  padding: 0 18px 2px;
  border-top: 1px solid #d2aa7d;
}
#sheet[data-kind='options'] #sheet-actions .menu-exit {
  flex: 0 1 auto;
  min-height: 52px;
  padding: 4px 8px;
  border: none;
  border-radius: 7px;
  background: none;
  color: #763923;
  font-weight: 900;
}
#sheet[data-round-options] #sheet-actions { display: none; }
.menu-exit:hover { text-decoration: underline; text-underline-offset: .17em; }
#sheet[data-kind='settings'] .stall-menu-group h3 { display: none; }
.stall-menu-columns, .stall-guide { display: grid; align-items: start; gap: 15px; }
.stall-menu-group { min-width: 0; }
.stall-menu-group h3 {
  margin: 0 0 3px;
  color: #734423;
  font: 800 17px/1.2 var(--serif);
}
.stall-menu-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 6px 3px;
  border: 0;
  border-bottom: 1px solid #d2aa7d;
  background: transparent;
  color: #322820;
  text-align: left;
}
.stall-menu-row:has(> img) { grid-template-columns: 44px minmax(0, 1fr) auto; }
.stall-menu-row > img { width: 44px; height: 42px; object-fit: contain; }
.stall-menu-row:focus-visible { outline-offset: -2px; border-radius: 7px; }
button.stall-menu-row:active { background: #ecca9470; }
.stall-menu-copy { display: grid; gap: 2px; }
.stall-menu-copy strong { font-size: 16px; font-weight: 900; }
.stall-menu-copy span { color: #634b38; font-size: 13px; }
.stall-menu-copy span:empty { display: none; }
.stall-menu-value {
  min-width: 45px;
  padding: 4px 8px;
  border: 1px solid #b59169;
  border-radius: 11px;
  color: #443223;
  background: #f3deb6;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}
.stall-menu-row[aria-pressed='true'] .stall-menu-value { border-color: #8b9c68; background: #e0e9bf; color: #2e4427; }
.stall-menu-arrow {
  width: 8px;
  height: 8px;
  margin: 0 6px 0 1px;
  border: solid #8b542d;
  border-width: 2px 2px 0 0;
  transform: rotate(45deg);
}
#menu-settings > .pk-hold-ring { inset: 6px 8px 6px auto; width: 40px; }
#menu-settings[data-pk-holding] > .stall-menu-arrow { visibility: hidden; }
.stall-guide .stall-menu-group p { margin-top: 6px; }
.stall-guide .stall-menu-group + .stall-menu-group { padding-top: 10px; border-top: 1px solid #d2aa7d; }
.guide-disclosure {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  margin-top: 7px;
  padding: 0 9px;
  border: 1px solid #cfad7b;
  border-radius: 8px;
  background: #f0d9ad;
  color: #543921;
}
.guide-disclosure::after {
  content: '';
  width: 7px;
  height: 7px;
  margin: 0 4px 4px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.guide-disclosure[aria-expanded='true']::after { transform: rotate(225deg); }
#sheet[data-kind='book'] .menu-list > li { gap: 6px; }

.blade-case {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.blade-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.blade-tab {
  min-height: 52px;
  padding: 5px 2px;
  border: 1px solid #b68b56;
  border-radius: 9px;
  color: #503323;
  background: #f6dfb8;
  font-size: clamp(13px, 3.4vw, 15px);
  font-weight: 900;
}
.blade-tab[aria-pressed='true'] { color: #fff0c4; background: #233453; border-color: #9e7049; }
.blade-record { margin-top: 8px; color: #513b28; font-size: 14px; }
.blade-choice {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  min-width: 0;
  min-height: 116px;
  padding: 5px 5px 7px;
  border: 1px solid #98784d;
  border-radius: 10px;
  background: radial-gradient(ellipse at 50% 25%, color-mix(in srgb, var(--blade-hue), #182444 72%), #1b2545 78%);
  color: #fff3cf;
  text-align: center;
  line-height: 1.15;
}
.blade-choice[aria-pressed='true'] { border-color: #ffe3a0; box-shadow: inset 0 0 0 2px #edba62; }
.blade-choice:disabled { border-color: #a7957c; }
.blade-choice:focus-visible { outline-offset: 1px; }
.blade-choice img { width: min(100%, 132px); height: 57px; object-fit: contain; filter: drop-shadow(0 4px 4px #100f296e); }
.blade-choice strong { font-size: clamp(13px, 3.7vw, 16px); }
.blade-detail { color: #ece2cd; font-size: 11px; }
.blade-rule { color: #ffdb90; font-size: 12px; font-weight: 900; }
.blade-choice[aria-pressed='true'] .blade-rule { color: #fff2be; }

@media (min-width: 700px) {
  #sheet[data-kind='options'][open] { width: min(calc(100% - 56px), 640px); }
  .stall-menu-columns { grid-template-columns: 1.12fr 1fr; gap: 22px; }
  .stall-menu-columns > :nth-child(2) { padding-left: 20px; border-left: 1px solid #d2aa7d; }
  #sheet[data-kind='blades'][open] { width: min(calc(100% - 56px), 640px); }
  .blade-case { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (orientation: landscape) and (max-height: 480px) {
  #title {
    inset: calc(60px + var(--safe-top)) 7% max(14px, var(--safe-bottom));
    grid-template: minmax(0, 1fr) / minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
  }
  .title-brand { height: 100%; }
  .title-actions { grid-area: 1 / 2; gap: 7px; width: 100%; }
  #title-swipe-hint { left: auto; right: 8px; transform: none; }
  #start { min-height: 60px; }
  #sheet[data-stall-menu] #sheet-heading { padding-bottom: 8px; }
  #menu-emblem { height: 58px; }
  #sheet[data-kind='blades'] #sheet-heading {
    grid-template-columns: auto minmax(0, 1fr) 70px;
    align-items: center;
    gap: 12px;
    padding-block: 6px;
  }
  #sheet[data-kind='blades'] #menu-emblem { grid-area: 1 / 3; height: 52px; }
  #sheet[data-kind='blades'] #sheet-content { padding-block: 9px 11px; }
  .blade-choice { min-height: 92px; }
  .blade-choice img { height: 39px; }
}
@media (orientation: landscape) and (max-height: 480px) and (min-width: 700px) {
  #sheet[data-kind='blades'] #sheet-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
  }
  .blade-record { margin: 0; font-size: 13px; }
  .blade-case { grid-column: 1 / -1; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mode-choice:active { transform: none !important; }
}
