@font-face {
  font-family: "Chakra Petch";
  src: url(../fonts/chakra-petch-500.woff2) format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Chakra Petch";
  src: url(../fonts/chakra-petch-700.woff2) format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url(../fonts/manrope-400-800.woff2) format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --bg: #0e1315;
  --panel: #151c1f;
  --panel2: #1b2427;
  --line: #263236;
  --text: #e9f1ed;
  --muted: #8f9f9b;
  --neon: #3ddc6a;
  --neon-dark: #1d8f43;
  --gold: #f2c14e;
  --pink: #ff5c8a;
  --cyan: #3fd0e0;
  --head: "Chakra Petch", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --side: 15rem;
  --r: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--body);
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

body.locked {
  overflow: hidden;
}

a {
  color: inherit;
  text-underline-offset: .2em;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--head);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 .55em;
  letter-spacing: .01em;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

h3 {
  font-size: 1.12rem;
}

p {
  margin: 0 0 1em;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--neon);
  color: #06210f;
  padding: .5rem 1rem;
}

.strip {
  margin: 0;
  padding: .4rem 1rem;
  background: #0a0e10;
  border-bottom: 1px solid var(--line);
  color: var(--neon);
  text-align: center;
  font: 500 .76rem/1.4 var(--head);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.top {
  position: sticky;
  top: 0;
  z-index: 30;
}

.strip {
  height: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar {
  height: 4rem;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .75rem 1.2rem;
  background: rgba(14, 19, 21, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-right: auto;
  font: 700 1.15rem var(--head);
  letter-spacing: .04em;
  text-decoration: none;
}

.logo svg {
  width: 2rem;
  height: 2rem;
}

.purse {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .45rem .5rem .45rem .8rem;
}

.purse b {
  font: 700 1.05rem var(--head);
}

.purse small {
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.2;
}

.coin {
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
}

.age {
  font: 700 .85rem var(--head);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  border-radius: 8px;
  padding: .3rem .5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: 700 .92rem/1 var(--body);
  padding: .8rem 1.25rem;
  border-radius: 12px;
  border: 0;
  background: var(--neon);
  color: #06210f;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(61, 220, 106, 0);
  transition: box-shadow .2s, background .2s;
}

.btn:hover {
  box-shadow: 0 0 22px -4px rgba(61, 220, 106, .7);
}

.btn.ghost {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn.ghost:hover {
  box-shadow: none;
  background: #223035;
}

.btn.sm {
  padding: .55rem .85rem;
  font-size: .82rem;
  border-radius: 10px;
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  box-shadow: none;
}

#navbtn {
  display: none;
}

#nav {
  position: fixed;
  top: 6rem;
  left: 0;
  bottom: 0;
  width: var(--side);
  padding: 1.2rem .9rem;
  border-right: 1px solid var(--line);
  background: var(--bg);
  overflow-y: auto;
  z-index: 20;
}

#nav p {
  font: 500 .72rem var(--head);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.2rem .5rem .5rem;
}

#nav p:first-child {
  margin-top: 0;
}

#nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  color: #c9d5d1;
}

#nav a i {
  width: 2.1rem;
  height: 2.1rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  font: normal 700 .8rem var(--head);
  color: var(--neon);
}

#nav a:hover,
#nav a[aria-current="page"] {
  background: var(--panel);
  color: #fff;
}

#nav a[aria-current="page"] i {
  background: var(--neon);
  color: #06210f;
  border-color: var(--neon);
}

main,
.foot {
  margin-left: var(--side);
}

main {
  display: block;
  padding: 1.5rem clamp(1rem, 2.5vw, 2rem) 4rem;
}

.lobby {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  gap: 1.5rem;
  align-items: start;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  align-items: center;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  padding: clamp(1.4rem, 3vw, 2.6rem);
  background:
    radial-gradient(60% 90% at 85% 40%, rgba(61, 220, 106, .22), transparent 70%),
    radial-gradient(40% 60% at 10% 100%, rgba(255, 92, 138, .12), transparent 70%),
    linear-gradient(160deg, #182226, #10171a);
}

.hero .lead {
  color: #c4d1cd;
  max-width: 32rem;
}

.eyebrow {
  font: 500 .78rem var(--head);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .7rem;
}

.sign {
  width: 100%;
  height: auto;
}

.sign .tube {
  fill: none;
  stroke: var(--neon);
  stroke-width: 5;
  filter: url(#glow);
}

.sign .frame {
  fill: none;
  stroke: var(--pink);
  stroke-width: 3.5;
  filter: url(#glow);
}

.sign .word {
  fill: none;
  stroke: var(--neon);
  stroke-width: 3;
  font: 700 118px var(--head);
  letter-spacing: 6px;
  filter: url(#glow);
}

.sign .sub {
  fill: var(--cyan);
  font: 500 19px var(--head);
  letter-spacing: 5px;
}

.sign .lit {
  animation: flicker 1.8s steps(1, end) .3s both;
}

@keyframes flicker {
  0% { opacity: .08; }
  12% { opacity: 1; }
  16% { opacity: .15; }
  24% { opacity: 1; }
  30% { opacity: .3; }
  34% { opacity: 1; }
  100% { opacity: 1; }
}

.notice-card {
  margin-top: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--neon);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
}

.notice-card p:last-child {
  margin: 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin: 2rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  font: 600 .92rem var(--body);
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: .7rem .9rem;
  margin-bottom: -1px;
  cursor: pointer;
}

.tabs button[aria-pressed="true"] {
  color: #fff;
  border-bottom-color: var(--gold);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: 1rem;
}

.tile {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .6rem .6rem 1rem;
  text-decoration: none;
  transition: transform .2s, border-color .2s;
}

.tile:hover {
  transform: translateY(-3px);
  border-color: var(--neon-dark);
}

.tile svg {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.tile h3 {
  margin: .8rem .4rem .2rem;
}

.tile p {
  margin: 0 .4rem;
  color: var(--muted);
  font-size: .88rem;
}

.side {
  position: sticky;
  top: 7rem;
  display: grid;
  gap: 1rem;
}

.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.2rem;
}

.box h2 {
  font-size: 1.1rem;
}

.box p {
  font-size: .92rem;
  color: #c4d1cd;
}

.box p:last-child {
  margin-bottom: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.chip {
  font: 600 .85rem/1 var(--body);
  padding: .6rem .8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--neon);
  border-color: var(--neon);
  color: #06210f;
}

.chip:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.lines {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .9rem;
}

.lines li {
  padding: .55rem 0;
  border-top: 1px solid var(--line);
}

.lines li:first-child {
  border-top: 0;
  padding-top: 0;
}

.lines span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
}

.section {
  margin-top: 2.6rem;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pair ul {
  margin: 0;
  padding-left: 1.1rem;
}

.pair li {
  margin-bottom: .4rem;
}

.label {
  font: 500 .74rem var(--head);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6rem;
}

details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .9rem 1.1rem;
  margin-bottom: .6rem;
  max-width: 48rem;
}

summary {
  font-weight: 700;
  cursor: pointer;
}

details p {
  margin: .6rem 0 0;
  color: #c4d1cd;
}

.page-head {
  max-width: 48rem;
  padding: 1rem 0 1.2rem;
}

.page-head p {
  color: #c4d1cd;
  font-size: 1.08rem;
}

.prose {
  max-width: 46rem;
}

.prose h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
}

.prose p,
.prose li {
  color: #cfdad6;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

th,
td {
  text-align: left;
  padding: .55rem .5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font: 500 .72rem var(--head);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.play {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.table {
  background:
    radial-gradient(70% 60% at 50% 0%, rgba(61, 220, 106, .12), transparent 70%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(1rem, 2.5vw, 1.6rem);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.3rem;
}

.say {
  min-height: 3.2em;
  margin: 1.2rem 0 0;
  padding: .8rem 1rem;
  background: var(--panel2);
  border-radius: 12px;
  font-size: .95rem;
}

.slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
  padding: .8rem;
  border-radius: 18px;
  background: #0a0f11;
  border: 1px solid var(--line);
}

.slot {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(180deg, #1a2326, #121a1d);
}

.slot svg {
  width: 62%;
  height: 62%;
}

.slot.hit {
  box-shadow: inset 0 0 0 2px var(--neon), 0 0 18px -4px rgba(61, 220, 106, .8);
}

.hand {
  margin-bottom: 1rem;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  min-height: 6.4rem;
  margin-top: .3rem;
}

.card {
  width: 4.4rem;
  height: 6.2rem;
  border-radius: 10px;
  background: #f4f6f3;
  color: #121a1d;
  display: grid;
  place-items: center;
  font: 700 1.5rem/1 var(--head);
  box-shadow: 0 6px 14px -8px #000;
}

.card.red {
  color: #d23a4b;
}

.card.down {
  background: repeating-linear-gradient(45deg, var(--neon-dark) 0 6px, #17652f 6px 12px);
}

.total {
  font: 500 .85rem var(--head);
  color: var(--muted);
  letter-spacing: .08em;
}

.board {
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #0a0f11;
}

.big {
  font: 700 clamp(3rem, 9vw, 5rem)/1 var(--head);
}

.foot {
  border-top: 1px solid var(--line);
  padding: 2.5rem clamp(1rem, 2.5vw, 2rem) 2rem;
  font-size: .92rem;
  color: #b3c1bd;
}

.foot h2 {
  font-size: 1.15rem;
  color: #fff;
}

.foot h3 {
  font: 500 .72rem var(--head);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.help {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .8rem;
}

.help li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .9rem 1rem;
}

.help span {
  display: block;
  color: var(--muted);
  font-size: .85rem;
}

.fcols {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 1.5rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}

.fcols ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fcols li {
  margin-bottom: .35rem;
}

.fine {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: .84rem;
  color: var(--muted);
}

.fine p {
  margin-bottom: .45rem;
}

#gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(6, 9, 10, .88);
}

#gate > div {
  width: 100%;
  max-width: 30rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 2rem;
  box-shadow: 0 0 60px -20px rgba(61, 220, 106, .45);
}

#gate .num {
  font: 700 3.2rem/1 var(--head);
  color: var(--gold);
  margin-bottom: .8rem;
}

#gate .small {
  font-size: .84rem;
  color: var(--muted);
  margin: 1.2rem 0 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.2rem;
}

#notice {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 80;
  max-width: 28rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .9rem 1.1rem;
  font-size: .9rem;
}

#notice p {
  margin: 0;
}

#breakNote {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 85;
  max-width: 22rem;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 1.2rem;
}

#breakNote h2 {
  font-size: 1.1rem;
  color: var(--gold);
}

.lost {
  max-width: 34rem;
  padding: 4rem 0;
}

@media (max-width: 1180px) {
  .lobby {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1000px) {
  #navbtn {
    display: inline-flex;
  }

  #nav {
    display: none;
    top: 100%;
    bottom: auto;
    position: absolute;
    left: 0;
    right: 0;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 75vh;
  }

  #nav.open {
    display: block;
  }

  main,
  .foot {
    margin-left: 0;
  }

  .play,
  .hero {
    grid-template-columns: 1fr;
  }

  .fcols {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .purse small,
  .age {
    display: none;
  }

  .topbar {
    gap: .5rem;
    padding: .6rem .8rem;
  }

  .side,
  .pair,
  .help {
    grid-template-columns: 1fr;
  }

  #notice {
    right: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sign .lit {
    animation: none;
  }

  .tile,
  .btn {
    transition: none;
  }
}
