.board {
  --ink-0:    #0b0b0d;
  --muted-0:  rgba(11, 11, 13, .55);
  --key-r:    clamp(12px, min(1.1vw, 1.9svh), 18px);
  --focus:    3px solid #0b0b0d;

  --nav-c:    rgb(255, 92, 196);
  --more-c:   rgb(20, 205, 150);

  --back-c:   rgb(80, 180, 255);
  --done-c:   rgb(40, 226, 20);
  --sweet-c:  var(--done-c);

  --deck-vpd:   rgb(0, 205, 215);
  --deck-ec:    rgb(60, 130, 255);
  --deck-ph:    rgb(170, 90, 255);
  --deck-light: rgb(255, 184, 0);

  --lift:     0 1px 0 rgba(255, 255, 255, .95) inset, 0 0 0 1px rgba(255, 255, 255, .55) inset, 0 -2px 0 rgba(11, 11, 13, .045) inset,
              0 0 0 1px rgba(11, 11, 13, .035), 0 22px 36px -22px rgba(11, 11, 13, .38), 0 8px 14px -8px rgba(11, 11, 13, .16);
  --lift-hi:  0 1px 0 rgba(255, 255, 255, .95) inset, 0 0 0 1px rgba(255, 255, 255, .75) inset, 0 -2px 0 rgba(11, 11, 13, .045) inset,
              0 0 0 1px rgba(11, 11, 13, .035), 0 30px 44px -24px rgba(11, 11, 13, .42), 0 10px 18px -8px rgba(11, 11, 13, .18);
  --pressed:  0 2px 5px rgba(11, 11, 13, .22) inset, 0 1px 0 rgba(255, 255, 255, .9);
  --engaged:  linear-gradient(180deg, rgba(226, 226, 222, .92) 0%, rgba(238, 238, 234, .84) 100%);
  --glass:    linear-gradient(165deg, rgba(255, 255, 255, .86) 0%, rgba(255, 255, 255, .62) 46%, rgba(255, 255, 255, .74) 100%);
  --sq:       linear-gradient(180deg, #ffffff 0%, #f7f6f2 100%);
  --sq-shadow: 0 1px 0 #fff inset, 0 0 0 1px rgba(11, 11, 13, .05),
               0 22px 36px -18px rgba(11, 11, 13, .5), 0 4px 8px -4px rgba(11, 11, 13, .2);
  --sq-active: 0 1px 0 #fff inset, 0 0 0 2px #0b0b0d, 0 26px 40px -18px rgba(11, 11, 13, .55);
  color: var(--ink-0);
}
.board .sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.board__safe {
  position: fixed;
  inset: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
}

.board {
  position: fixed;
  z-index: 1;
  left: var(--bx, 12px);
  top: var(--by, 12px);
  width: var(--bw, calc(100vw - 24px));
  height: var(--bh, calc(100svh - 24px));
}
.board:not(.is-ready) .board__plate:empty { visibility: hidden; }
.board .board__plate {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--C, 6), minmax(0, 1fr));
  grid-template-rows: repeat(var(--R, 4), var(--ch, 1fr));
  grid-auto-rows: var(--ch, 1fr);
  align-content: start;
  gap: var(--p, 16px);
  padding: var(--p, 16px);

  background: none;
  outline: none;
}
.board.is-scroll .board__plate { overflow-y: auto; overscroll-behavior: contain; }

.board .tile {
  container: tile / size;
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: var(--tp, 12px);
  border: 0;
  border-radius: var(--key-r);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: var(--lift);
  isolation: isolate;
  color: var(--ink-0);
  font: inherit;
  text-align: center;
  transition: transform .18s var(--snap), box-shadow .22s var(--ease);
}
.board .tile[hidden] { display: none !important; }
.board :is(img, canvas) { -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; }

@media (hover: hover) {
  .board .tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(240px circle at var(--hx, 50%) var(--hy, 0%), rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, 0) 65%);
    transition: opacity .35s var(--ease);
  }
  .board .tile:hover::after { opacity: 1; }
}

.board .tile > .tile__boot {
  position: absolute;
  inset: 0;
  z-index: -1;
  grid-area: auto;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, 0) 42%),
    radial-gradient(125% 120% at 50% 50%, color-mix(in srgb, var(--boot-c, #fff) 46%, #fff) 0%, color-mix(in srgb, var(--boot-c, #fff) 18%, #fff) 100%);
  box-shadow: inset 0 0 30px color-mix(in srgb, var(--boot-c, #fff) 45%, transparent),
              0 0 46px -6px color-mix(in srgb, var(--boot-c, #fff) 75%, transparent);
}
.board .tile__label {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--lab, 12px);
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted-0);
}
.board .tile__sub {
  max-width: 100%;
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: clamp(9px, min(7.5cqw, 9cqh), 15px);
  line-height: 1.2;
  letter-spacing: .02em;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
  color: var(--muted-0);
}

.board .tile--blank {
  padding: 0;
  background: linear-gradient(165deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, .22) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 0 0 1px rgba(255, 255, 255, .5) inset, 0 12px 24px -18px rgba(11, 11, 13, .2);
}

.board .tile--press {
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .board .tile--press:hover { box-shadow: var(--lift-hi); transform: translateY(-1px); }
}
.board .tile--press:active { box-shadow: var(--pressed); transform: translateY(1px); }
.board .tile--press:focus-visible { outline: var(--focus); outline-offset: 3px; }
.board .tile--menu img { width: min(66cqw, 34cqh * 1.96); height: auto; pointer-events: none; }

.board :is(.tile__key, .tile__soon) {
  position: absolute;
  top: clamp(5px, 6cqmin, 12px);
  left: clamp(5px, 6cqmin, 12px);
  z-index: 1;
  box-sizing: border-box;
  min-width: 1.7em;
  padding: .24em .45em .2em;
  border-radius: .45em;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: clamp(9px, 7cqmin, calc(14px * var(--u, 1)));
  line-height: 1;
  letter-spacing: .04em;
  text-align: center;
  white-space: nowrap;
  color: rgba(11, 11, 13, .62);
  background: linear-gradient(180deg, rgba(255, 255, 255, .94) 0%, rgba(243, 242, 238, .88) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 0 0 1px rgba(11, 11, 13, .07),
              0 1px 2px rgba(11, 11, 13, .14), 0 2px 0 rgba(11, 11, 13, .05);
  pointer-events: none;
}
.board .tile--logo img { width: min(64cqw, 64cqh * 1.175); height: auto; pointer-events: none; }

.board .tile--lit {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, .6) 0%, rgba(255, 255, 255, 0) 42%),
    radial-gradient(125% 120% at 50% 50%, color-mix(in srgb, var(--lit-c, var(--nav-c)) 15%, #fff) 0%, color-mix(in srgb, var(--lit-c, var(--nav-c)) 7%, #fff) 100%);
  box-shadow: var(--lift), inset 0 0 18px color-mix(in srgb, var(--lit-c, var(--nav-c)) 16%, transparent),
              0 12px 30px -16px color-mix(in srgb, var(--lit-c, var(--nav-c)) 45%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .board .tile { transition: none; }
  .board .tile::after { display: none; }
}
