:root {
  color-scheme: dark;
  --bg: #0d1020;
  --panel: #1a1f3d;
  --ink: #e8ecff;
  --mut: #9aa3d0;
  --acc: #ffd166;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
}
#wrap {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
}
#fs {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  background: #1a1f3dcc;
  color: #e8ecff;
  border: 1px solid #444b80;
  border-radius: 8px;
  padding: 3px 9px;
  font: 14px inherit;
  cursor: pointer;
}
#wrap:fullscreen {
  max-width: none;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
#wrap:fullscreen canvas {
  width: min(100vw, 177.78vh);
  height: auto;
}
.tx {
  max-width: 520px;
  font-size: 15px;
  line-height: 1.45;
  margin: 4px 0;
}
.row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
button.sm.on {
  border-color: var(--acc);
  color: var(--acc);
}
#mg {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #000;
  display: none;
}
#mg iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
#mgb {
  position: absolute;
  top: calc(6px + env(safe-area-inset-top, 0px));
  left: 6px;
  z-index: 21;
  background: #1a1f3dee;
  color: #e8ecff;
  border: 1px solid #444b80;
  border-radius: 8px;
  padding: 6px 12px;
  font: 14px inherit;
  cursor: pointer;
}
html,
body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
canvas {
  touch-action: none;
}
#tc {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  padding: 0 12px;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 3;
  touch-action: none;
}
#tc *,
#mnu {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#tc button {
  pointer-events: auto;
  width: clamp(50px, 9vw, 70px);
  height: clamp(50px, 9vw, 70px);
  border-radius: 50%;
  border: 2px solid #ffffff55;
  background: #10142acc;
  color: #e8ecff;
  font: bold 18px system-ui;
  padding: 0;
}
#tc button.on {
  background: #ffd166dd;
  color: #222;
}
.dp {
  display: grid;
  grid-template-columns: repeat(3, auto);
  grid-template-areas: '. u .' 'l d r';
  gap: 6px;
}
.dp [data-k='u'] {
  grid-area: u;
}
.dp [data-k='l'] {
  grid-area: l;
}
.dp [data-k='d'] {
  grid-area: d;
}
.dp [data-k='r'] {
  grid-area: r;
}
.ab {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.ab [data-k='a'] {
  width: clamp(64px, 12vw, 88px);
  height: clamp(64px, 12vw, 88px);
}
#mnu {
  display: none;
  position: absolute;
  top: 6px;
  right: 48px;
  z-index: 5;
  background: #1a1f3dcc;
  color: #e8ecff;
  border: 1px solid #444b80;
  border-radius: 8px;
  padding: 3px 10px;
  font: 14px inherit;
  cursor: pointer;
}
@media (orientation: portrait) {
  #tc {
    position: static;
    padding: 10px 12px 16px;
    bottom: auto;
  }
}
@media (max-width: 700px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid .card span {
    display: none;
  }
  .col {
    flex-basis: 100%;
  }
}
.bd {
  font-style: normal;
  font-size: 10px;
  background: #ffd166;
  color: #222;
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
}
.b2 {
  background: #7fd4ff;
}
.card.on2 {
  border-color: #7fd4ff;
}
.card.on.on2 {
  border-color: #ffd166;
  box-shadow: 0 0 0 2px #7fd4ff;
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #10142a;
}
#ov {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 24, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  overflow: auto;
  text-align: center;
}
h1 {
  margin: 0;
  font-size: clamp(20px, 4vw, 32px);
}
.cols {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.col {
  flex: 1 1 300px;
  max-width: 720px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.grid .card {
  margin: 0;
  padding: 6px 8px;
}
.grid .card span {
  font-size: 11px;
}
.col h3 {
  margin: 4px 0;
  font-size: 14px;
  color: var(--mut);
}
.card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  color: var(--ink);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 7px 10px;
  margin: 4px 0;
  font: inherit;
  cursor: pointer;
}
.card.on {
  border-color: var(--acc);
}
.card b {
  font-size: 15px;
}
.card span {
  display: block;
  font-size: 12px;
  color: var(--mut);
}
button.go {
  background: var(--acc);
  color: #222;
  border: 0;
  border-radius: 10px;
  padding: 10px 26px;
  font: bold 16px inherit;
  cursor: pointer;
  margin: 2px;
}
button.sm {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid #444b80;
  border-radius: 8px;
  padding: 5px 12px;
  font: inherit;
  cursor: pointer;
}
small {
  color: var(--mut);
  font-size: 12px;
}
#ov button.gpf {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
#gpi {
  position: absolute;
  left: 8px;
  bottom: 6px;
  z-index: 4;
  font-size: 11px;
  color: var(--mut);
  pointer-events: none;
}
#ov h1 {
  font-weight: 900;
  letter-spacing: 0.5px;
  background: linear-gradient(180deg, #fff3c4, #ffd166 55%, #ff9f43);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #1b1730);
}
.card {
  transition:
    transform 0.08s,
    border-color 0.08s;
}
.card:hover {
  transform: translateY(-1px);
  border-color: #444b80;
}
.card img {
  background: radial-gradient(circle at 50% 35%, #3a3f78, #0d1020) !important;
}
#snd {
  position: absolute;
  top: 40px;
  right: 6px;
  z-index: 5;
  background: #1a1f3dcc;
  color: #e8ecff;
  border: 1px solid #444b80;
  border-radius: 8px;
  padding: 3px 7px;
  font: 14px inherit;
  cursor: pointer;
}
