:root {
  color-scheme:dark;
  --canvas:#111129;
  --shell:#16162e;
  --panel:#1c1c3b;
  --well:#0a0d24;
  --muted:#abadcc;
  --rail:248px;
  --line:#ffffff14;
  font:16px/1.45 "Match Proxima",system-ui,sans-serif;
  color:#fff;
  background:var(--canvas);
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
}
a,button {
  color:inherit;
  font:inherit;
}
a {
  text-decoration:none;
}
button {
  border:0;
  background:none;
  cursor:pointer;
  padding:0;
}
button:disabled {
  cursor:default;
  opacity:.42;
}
button:not(:disabled):hover,a:hover {
  filter:brightness(1.12);
}
:focus-visible {
  outline:2px solid #a38aff;
  outline-offset:2px;
}
.sr,.skip:not(:focus) {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
}
.skip:focus {
  position:fixed;
  z-index:8;
  top:4px;
  left:8px;
  background:#222;
}
.icon {
  display:block;
  width:22px;
  height:22px;
  flex:none;
}
.mast {
  height:64px;
  position:sticky;
  top:0;
  margin-left:var(--rail);
  padding:0 32px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:var(--shell);
  z-index:3;
}
.mast nav {
  display:flex;
  gap:8px;
}
.brand {
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.brand img:first-child {
  width:28px;
  height:28px;
  object-fit:contain;
}
.brand img+img {
  width:150px;
  height:34px;
  object-fit:contain;
}
.chip,.purple {
  background:#302e54;
  border-radius:11px;
  color:white;
  font-weight:700;
  box-shadow:inset 0 1px 1px #ffffff16;
}
.mast .chip {
  padding:0 16px;
  height:40px;
  display:grid;
  place-items:center;
  font-size:14px;
  color:var(--muted);
}
.purple,.mast .purple {
  background:linear-gradient(#3212b0,#6340ee);
  box-shadow:inset 0 0 0 1px #ffffff32,inset 0 2px 3px #9278ff52;
  color:white;
}
#navigation {
  position:fixed;
  inset:0 auto 0 0;
  width:var(--rail);
  background:var(--shell);
  padding:0 12px;
  z-index:3;
  box-shadow:inset -1px 0 var(--line);
}
#navigation>a,#navigation>button,.rail-modes a {
  display:flex;
  gap:12px;
  align-items:center;
  min-height:44px;
  padding:0 14px;
  border-radius:12px;
  color:var(--muted);
  font-size:15px;
  font-weight:600;
  margin:4px 0;
  width:100%;
  text-align:left;
}
#navigation .menu {
  width:44px;
  margin:10px 0 18px 4px;
  justify-content:center;
  padding:0;
}
.match-event:not(:empty) { margin-bottom:12px; }
.rail-modes a {
  width:100%;
}
.rail-modes img {
  width:24px;
  height:24px;
  object-fit:contain;
}
.rail-modes [aria-current] {
  background:#2d2d54;
  color:white;
}
#modes::after {
  content:'⌃';
  margin-left:auto;
}
#modes[aria-expanded=false]::after {
  content:'⌄';
}
#modes[aria-expanded=false]+.rail-modes {
  display:none;
}
main {
  margin-left:var(--rail);
}
.game {
  display:grid;
  grid-template-columns:340px minmax(0,1fr);
  grid-template-areas:'controls board' 'foot foot';
  max-width:1216px;
  margin:16px auto 56px;
  background:var(--panel);
  border-radius:20px;
  overflow:hidden;
  box-shadow:inset 0 0 0 1px var(--line);
}
main {
  padding:0 32px;
}
.controls {
  grid-area:controls;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:16px;
}
.amount label,.value small,.mode>small {
  display:block;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}
.amount label {
  margin-bottom:6px;
}
.stepper {
  height:44px;
  display:flex;
  align-items:center;
  gap:4px;
  padding:4px;
  background:#0004;
  border-radius:12px;
}
.stepper button {
  width:36px;
  height:36px;
  border-radius:9px;
  font-size:18px;
  color:var(--muted);
  font-weight:700;
}
.stepper button:first-child,.stepper button:last-child {
  background:#27284d;
  font-size:13px;
}
.stepper output {
  flex:1;
  text-align:center;
  font-size:17px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
.category {
  min-height:52px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 12px;
  text-align:left;
  font-size:15px;
}
.category small {
  display:none;
}
.chevron {
  display:inline-block;
  width:8px;
  height:8px;
  border-right:1.5px solid;
  border-bottom:1.5px solid;
  transform:rotate(45deg);
  margin:0 5px 4px auto;
  color:var(--muted);
}
.values {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px 8px;
}
.value,.mode>div>button {
  padding:7px 12px;
  border-radius:12px;
  background:#0004;
  text-align:left;
}
.value {
  min-height:55px;
}
.value strong,.mode button {
  font-size:17px;
  font-weight:700;
}
.mode {
  grid-column:1/-1;
  grid-row:1;
}
.mode>small {
  margin-bottom:6px;
}
.mode>div {
  display:flex;
  gap:8px;
}
.mode>div>button {
  flex:1;
  display:flex;
  align-items:center;
  min-height:44px;
  font-size:14px;
}
.mode button[role=switch] {
  font-weight:600;
  color:var(--muted);
}
button[role=switch]::before {
  content:'';
  display:inline-grid;
  place-content:center;
  width:16px;
  height:16px;
  border:1px solid #575778;
  border-radius:5px;
  margin-right:7px;
}
button[aria-checked=true]::before {
  content:'✓';
  background:#6340ee;
  color:white;
}
.start {
  min-height:56px;
  font-weight:700;
}
.mobile-help {
  display:none;
}
#board {
  grid-area:board;
  min-width:0;
  height:max(592px,calc(100dvh - 160px));
  background:var(--well);
  border:1px solid var(--line);
  border-radius:0 20px 0 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:20px;
  gap:12px;
}
.tiers {
  height:36px;
  flex:none;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
}
.tiers span {
  display:flex;
  gap:4px;
}
.tiers i {
  width:12px;
  height:18px;
  border:1px solid var(--tier);
  border-radius:3px;
}
.board-space {
  display:grid;
  place-items:center;
  width:100%;
  min-height:0;
  flex:1;
  container-type:size;
}
.tiles {
  width:min(100cqw,calc(100cqh * 25 / 28));
  aspect-ratio:25/28;
  display:grid;
  grid-template:repeat(4,minmax(0,1fr))/repeat(5,minmax(0,1fr));
  gap:10px;
}
.tile {
  display:grid;
  place-items:center;
  min-width:0;
  background:#3b3590;
  color:#5e58ab;
  border-radius:12px;
  transition:translate .125s,filter .125s;
}
.tile:hover {
  translate:0 -2px;
}
.tile:active {
  translate:0 0;
  filter:brightness(.95);
}
.tile .icon {
  width:56%;
  height:56%;
}
.game-foot {
  grid-area:foot;
  display:grid;
  grid-template-columns:340px 1fr;
  align-items:center;
  height:48px;
  border-top:1px solid var(--line);
}
.game-foot>img {
  width:132px;
  height:22px;
  object-fit:contain;
  justify-self:center;
  filter:grayscale(1) brightness(2);
  opacity:.21;
}
.tools {
  display:flex;
  gap:4px;
  padding-left:12px;
}
.tools button {
  width:36px;
  height:36px;
  display:grid;
  place-content:center;
  color:var(--muted);
}
.tools .icon {
  width:19px;
  height:19px;
}
.match-footer {
  margin-left:var(--rail);
  padding-top:24px;
}

dialog {
  border:1px solid #ffffff1a;
  border-radius:20px;
  padding:24px;
  background:#20203c;
  color:#fff;
  width:min(400px,calc(100% - 24px));
  max-height:90dvh;
  overflow:auto;
  font:inherit;
}
dialog::backdrop {
  background:#080814b8;
  backdrop-filter:blur(6px);
}
dialog h2 {
  margin:0 36px 16px 0;
  font-size:22px;
}
dialog .close {
  position:absolute;
  right:12px;
  top:8px;
  width:40px;
  height:40px;
  font-size:24px;
  color:var(--muted);
}
.dialog-action {
  display:grid;
  place-items:center;
  min-height:46px;
  width:100%;
  margin-top:12px;
  border-radius:12px;
}
.picker {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.picker>a,.picker>button {
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:end;
  position:relative;
  border:1px solid var(--ring,#5e5d81);
  border-radius:12px;
  padding:8px 3px;
  background:linear-gradient(155deg,#313051,#101025);
  text-align:center;
  font-size:13px;
  font-weight:700;
}
.picker img {
  width:100%;
  height:58px;
  object-fit:contain;
}
.picker small {
  font-size:11px;
  color:#c1bfcd;
}
.picker [aria-pressed=true]::after,.picker [aria-current=page]::after {
  content:'✓';
  position:absolute;
  right:5px;
  top:5px;
  border-radius:50%;
  background:white;
  color:#171732;
  width:18px;
  height:18px;
}
.picker+.picker-title {
  margin:18px 0 10px;
}
.panel-switch {
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  padding:10px 0;
}
.panel-switch::before {
  order:2;
}
.sheet-tabs {
  display:flex;
  gap:4px;
  margin:0 36px 16px 0;
}
.sheet-tabs button {
  flex:1;
  min-height:40px;
  border-radius:8px;
}
.sheet-tabs [aria-pressed=true] {
  background:#6945f2;
}
dialog input:not([type=checkbox]) {
  display:block;
  width:100%;
  padding:12px;
  background:#111129;
  border:1px solid #494968;
  color:white;
  border-radius:8px;
  font:inherit;
  margin-top:4px;
}
dialog label,dialog p {
  font-size:14px;
}
.notice {
  color:#c4c2d8;
}
.hint {
  font-size:12px;
}
kbd {
  border:1px solid #59586f;
  border-radius:4px;
  padding:2px 7px;
  margin-right:8px;
}
.rail-collapsed {
  --rail:76px;
}
.rail-collapsed #navigation a,.rail-collapsed #navigation button {
  font-size:0;
  justify-content:center;
}
.rail-collapsed .limited-miami-copy,.rail-collapsed #modes::after {
  display:none;
}
.rail-collapsed .limited-miami-sidebar { justify-content:center; padding-inline:0; }
.rail-collapsed .rail-modes a {
  margin-left:0;
  width:100%;
}
[hidden] {
  display:none!important;
}
@media(max-width:1023px) {
  :root {
    --rail:0px;
  }
  .mast {
    padding:0 12px;
  }
  .brand img+img,.game-foot,.match-footer {
    display:none;
  }
  main {
    padding:0;
  }
  .game {
    height:calc(100dvh - 128px - env(safe-area-inset-bottom));
    min-height:365px;
    margin:0;
    padding:8px 0;
    display:flex;
    flex-direction:column;
    gap:8px;
    overflow:visible;
    background:none;
    box-shadow:none;
  }
  .controls {
    order:2;
    flex:none;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-areas:'amount amount' 'values values' 'category start' 'help help';
    gap:8px 12px;
    padding:0 16px;
  }
  .amount {
    grid-area:amount;
  }
  .amount label {
    display:none;
  }
  .values {
    grid-area:values;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:0;
    height:41px;
  }
  .value,.mode {
    grid-row:auto;
    grid-column:auto;
    text-align:center;
    background:none;
    border-radius:0;
    padding:0;
    min-height:0;
  }
  .value+.value,.mode {
    border-left:1px solid #ffffff1a;
  }
  .mode>small {
    margin:0;
  }
  .mode>div {
    display:block;
  }
  .mode>div>button {
    display:inline-flex;
    gap:6px;
    background:none;
    min-height:0;
    padding:0;
    font-size:17px;
  }
  .mode #auto-desktop {
    display:none;
  }
  .mode .chevron {
    margin:0 0 4px;
  }
  .category {
    grid-area:category;
    min-height:48px;
    align-self:start;
  }
  .category small {
    display:block;
    color:var(--muted);
    font-size:12px;
    font-weight:400;
  }
  .category strong {
    font-size:15px;
  }
  .start {
    grid-area:start;
    min-height:52px;
    font-size:15px;
  }
  .mobile-help {
    grid-area:help;
    display:flex;
    align-items:center;
    gap:6px;
    justify-self:center;
    height:26px;
    margin-top:-4px;
    color:var(--muted);
    font-size:12px;
  }
  .mobile-help .icon {
    width:14px;
    height:14px;
  }
  #board {
    height:auto;
    min-height:0;
    flex:1;
    margin:0 16px;
    border-radius:26px;
    padding:8px;
    gap:4px;
  }
  .tiers {
    height:28px;
    gap:10px;
  }
  .tiers span {
    gap:2px;
  }
  .tiers i {
    width:8px;
    height:14px;
    border-radius:2px;
  }
  .tiles {
    gap:6px;
  }
  #navigation,.rail-collapsed #navigation {
    width:100%;
    inset:auto 0 0;
    display:flex;
    height:calc(64px + env(safe-area-inset-bottom));
    padding:0 0 env(safe-area-inset-bottom);
    align-items:center;
    justify-content:space-around;
    background:var(--shell);
    border:none;
  }
  #navigation>:not([data-tab]) {
    display:none;
  }
  #navigation a[data-tab],.rail-collapsed #navigation a[data-tab] {
    display:flex;
    position:relative;
    isolation:isolate;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:7px;
    margin:0;
    padding:0;
    width:20%;
    font-size:12px;
    height:60px;
    border-radius:0;
  }
  #navigation [data-tab] .icon {
    width:22px;
    height:22px;
  }
  #navigation [data-tab=Packs] {
    color:white;
  }
  #navigation [data-tab=Packs]::before {
    content:'';
    position:absolute;
    z-index:-1;
    top:4px;
    width:54px;
    height:32px;
    border-radius:20px;
    background:linear-gradient(145deg,#464461,#27263f 60%,#493f65);
  }
  dialog {
    margin:auto 0 0;
    width:100%;
    max-width:100%;
    max-height:94dvh;
    border-radius:20px 20px 0 0;
    padding:20px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .picker img {
    height:75px;
  }
  .picker>a,.picker>button {
    min-height:108px;
  }
}
@media(max-width:1023px) and (min-height:800px) {
  #board {
    padding-bottom:36px;
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before {
    animation-duration:0s!important;
    transition:none!important;
  }
}
#category-icon img {
  width:23px;
  height:23px;
  object-fit:contain;
}
#sound[aria-pressed=true] {
  opacity:.55;
}
#sound[aria-pressed=true]::after {
  content:'×';
  position:absolute;
  margin-left:13px;
}
.consent {
  display:flex;
  align-items:start;
  gap:8px;
  margin:16px 0;
  color:var(--muted);
}
.consent input {
  margin-top:3px;
  accent-color:#6746e8;
}
.consent a {
  color:white;
  text-decoration:underline;
}
.notice:empty {
  display:none;
}
#quote-info {
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height:1.3;
}
.tiers .matched {background:var(--tier);}
.tile[data-tier] {
  background-size:100% 100%;
  background-position:center;
  opacity:1;
  translate:none;
}
.tile[data-tier] svg {visibility:hidden;}
#board {position:relative;}
#prize {
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:16px;
  overflow:auto;
  border-radius:inherit;
  background:#171730f5;
  text-align:center;
}
#prize img {width:min(68%,240px);height:min(42%,280px);object-fit:contain;}
#prize h2 {font-size:clamp(16px,3vw,24px);margin:0;line-height:1.15;}
#prize span {font-size:13px;color:var(--muted);}
#prize button {width:min(100%,240px);min-height:40px;margin:0;}
#content select,.mode-choice {
  min-height:42px;
  padding:6px 12px;
  background:#302e54;
  border-radius:8px;
  color:white;
  font:inherit;
}
#content select {width:100%;margin-top:6px;}
.mode-choice {margin:0 6px 6px 0;}
.mode-choice[aria-pressed=true] {background:#6440ef;}
@media(max-width:1023px) {
  .controls:has(#quote-info:not([hidden])) {
    grid-template-areas:'amount amount' 'values values' 'quote quote' 'category start' 'help help';
  }
  #quote-info {grid-area:quote;text-align:center;font-size:12px;}
}
@media (min-width:1024px) {
  .rail-collapsed .match-event .limited-miami-sidebar { min-height:52px; }
  .rail-collapsed .mast { padding-left:74px; }
}
