/* Number Nook Keno engine */
.qt-eng-keno { container-type: inline-size; }

.qt-keno {
  --qt-keno-glow: color-mix(in srgb, var(--qt-accent, #b86bff) 50%, transparent);
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  color: var(--qt-ink, #f6f1ff);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
@container (min-width: 780px) {
  .qt-keno { grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; }
}

.qt-keno-play {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: clamp(10px, 2.4vw, 20px);
  border-radius: calc(var(--qt-r, 16px) + 6px);
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--qt-accent, #b86bff) 22%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(34, 18, 58, .88), rgba(14, 8, 28, .94));
  border: 1px solid color-mix(in srgb, var(--qt-accent, #b86bff) 35%, transparent);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .5), 0 0 36px var(--qt-keno-glow), inset 0 1px 0 rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
}

.qt-keno-tray {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(3px, 1vw, 8px);
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5);
}
.qt-keno-slot {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  font-size: clamp(11px, 2.4vw, 16px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #1d0d33;
}
.qt-keno-slot.is-on {
  background: radial-gradient(circle at 35% 30%, #ffffff, #e2d6f5 55%, #a996c8);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .45);
  animation: qt-keno-ball .26s ease-out;
}
.qt-keno-slot.is-hit {
  background: radial-gradient(circle at 35% 30%, #fffbe0, var(--qt-gold, #ffcf4a) 55%, #d08a00);
  box-shadow: 0 0 0 2px #fff6cf, 0 0 14px rgba(255, 207, 74, .7);
}
@keyframes qt-keno-ball { from { transform: translateY(-10px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }

.qt-keno-board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(4px, 1vw, 8px); }
.qt-keno-tile {
  position: relative;
  aspect-ratio: 1.15;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: clamp(14px, 2.6vw, 20px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--qt-ink, #f6f1ff);
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 3px 8px rgba(0, 0, 0, .25);
  transition: transform .14s ease-out, opacity .2s ease-out;
}
.qt-keno-tile:hover:not(:disabled) { transform: translateY(-2px); }
.qt-keno-tile:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.qt-keno-tile:disabled { cursor: default; }
.qt-keno-tile:focus-visible { outline: 2px solid var(--qt-ember, #ffa63d); outline-offset: 2px; }
.qt-keno-tile[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--qt-accent, #b86bff) 60%, #fff), var(--qt-accent, #b86bff) 55%, color-mix(in srgb, var(--qt-accent, #b86bff) 60%, #000));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 0 16px var(--qt-keno-glow);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}
.qt-keno-tile.is-drawn:not(.is-hit) { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .25); }
.qt-keno-tile.is-drawn:not(.is-hit)::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  opacity: .8;
}
.qt-keno-tile.is-hit {
  color: #2a1700;
  background: linear-gradient(180deg, #fff3b8, var(--qt-gold, #ffcf4a) 55%, #e09a00);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), 0 0 0 2px #fff, 0 0 22px rgba(255, 207, 74, .75);
  text-shadow: none;
}
.qt-keno-tile.is-pop { animation: qt-keno-pop .32s ease-out; }
@keyframes qt-keno-pop { 0% { transform: scale(.95); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
.qt-keno.is-playing .qt-keno-tile:not([aria-pressed="true"]):not(.is-drawn) { opacity: .6; }

.qt-keno-banner {
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 48px;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--qt-line, rgba(255, 255, 255, .12));
  text-align: center;
}
.qt-keno-banner-main { font-weight: 800; font-size: clamp(15px, 2.2vw, 19px); }
.qt-keno-banner-sub { font-size: 12.5px; color: var(--qt-muted, #b9b0d6); }
.qt-keno-banner.is-on { animation: qt-keno-in .26s ease-out; }
.qt-keno-banner.is-win { border-color: rgba(255, 166, 61, .5); box-shadow: 0 0 24px rgba(255, 166, 61, .3); }
.qt-keno-banner.is-win .qt-keno-banner-main { color: var(--qt-ember, #ffa63d); }
@keyframes qt-keno-in { from { transform: scale(.95); opacity: .3; } to { transform: scale(1); opacity: 1; } }

/* panel */
.qt-keno-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: var(--qt-r, 16px);
  background: linear-gradient(180deg, rgba(42, 22, 70, .86), rgba(16, 9, 32, .92));
  border: 1px solid var(--qt-line, rgba(255, 255, 255, .12));
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
}
.qt-keno-head { display: flex; justify-content: space-between; align-items: baseline; }
.qt-keno-label { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--qt-muted, #b9b0d6); }
.qt-keno-count { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--qt-accent, #b86bff); }
.qt-keno-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qt-keno-tool {
  min-height: 40px;
  border: 1px solid var(--qt-line, rgba(255, 255, 255, .12));
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--qt-ink, #f6f1ff);
  background: rgba(255, 255, 255, .07);
  cursor: pointer;
  transition: transform .14s ease-out, opacity .2s ease-out;
}
.qt-keno-tool:first-child { background: color-mix(in srgb, var(--qt-accent, #b86bff) 28%, transparent); border-color: color-mix(in srgb, var(--qt-accent, #b86bff) 55%, transparent); }
.qt-keno-tool:hover:not(:disabled) { transform: translateY(-1px); }
.qt-keno-tool:disabled { opacity: .4; cursor: default; }
.qt-keno-tool:focus-visible { outline: 2px solid var(--qt-ember, #ffa63d); outline-offset: 2px; }

.qt-keno-pays { border-radius: 12px; background: rgba(0, 0, 0, .28); border: 1px solid var(--qt-line, rgba(255, 255, 255, .12)); overflow: hidden; }
.qt-keno-pays-head { display: flex; justify-content: space-between; padding: 7px 12px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--qt-muted, #b9b0d6); border-bottom: 1px solid var(--qt-line, rgba(255, 255, 255, .12)); }
.qt-keno-pays-list { display: grid; margin: 0; padding: 4px; list-style: none; }
.qt-keno-pays-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: opacity .15s ease-out;
}
.qt-keno-pays-m { color: var(--qt-gold, #ffcf4a); }
.qt-keno-pays-row.is-zero { opacity: .45; }
.qt-keno-pays-row.is-zero .qt-keno-pays-m { color: inherit; }
.qt-keno-pays-row.is-live { background: rgba(255, 255, 255, .1); opacity: 1; }
.qt-keno-pays-row.is-paid { background: var(--qt-ember, #ffa63d); color: #2a1200; opacity: 1; }
.qt-keno-pays-row.is-paid .qt-keno-pays-m { color: #2a1200; }
.qt-keno-pays-empty { padding: 10px 8px; font-size: 13px; color: var(--qt-muted, #b9b0d6); text-align: center; }

.qt-keno-go {
  display: grid;
  justify-items: center;
  gap: 1px;
  width: 100%;
  min-height: 60px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  color: #2a1200;
  cursor: pointer;
  background: linear-gradient(180deg, #ffd9a0 0%, var(--qt-ember, #ffa63d) 45%, #e07a1f 100%);
  box-shadow: 0 5px 0 #8a3d00, 0 10px 28px rgba(255, 166, 61, .35), inset 0 2px 0 rgba(255, 255, 255, .7);
  transition: transform .1s ease-out, opacity .2s ease-out;
}
.qt-keno-go-main { font-size: 20px; font-weight: 950; letter-spacing: .05em; text-transform: uppercase; }
.qt-keno-go-sub { font-size: 12px; font-weight: 700; opacity: .75; }
.qt-keno-go:hover { transform: translateY(-1px); }
.qt-keno-go:active { transform: translateY(4px); }
.qt-keno-go:disabled { cursor: default; opacity: .55; transform: none; }
.qt-keno-go:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@container (max-width: 779px) {
  .qt-keno-panel { padding: 12px; gap: 10px; grid-template-columns: 1fr 1fr; }
  .qt-keno-head { grid-column: 1 / -1; }
  .qt-keno-tools { grid-column: 1 / -1; }
  .qt-keno-pays { grid-column: 1 / -1; }
  .qt-keno-pays-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 4px; }
  .qt-keno-pays-row { font-size: 12.5px; padding: 3px 6px; }
  .qt-keno-go { grid-column: 1 / -1; }
  .qt-keno-tile { border-radius: 9px; aspect-ratio: 1; }
  .qt-keno-tray { padding: 6px; }
  .qt-keno-tile.is-drawn:not(.is-hit)::after { right: 4px; top: 4px; width: 5px; height: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .qt-keno-slot.is-on, .qt-keno-tile.is-pop, .qt-keno-banner.is-on { animation: none; }
}
