:root {
  --bg: #11110d;
  --panel: #1b1b15;
  --panel-2: #222219;
  --line: rgba(255, 255, 255, .08);
  --yellow: #f4d328;
  --yellow-2: #ffe96a;
  --text: #f6f4ea;
  --muted: #a7a594;
  --danger: #ff685e;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 85% 0%, rgba(244, 211, 40, .10), transparent 35%),
    var(--bg);
  color: var(--text);
}

button { font: inherit; }

.app-shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 14px 18px 104px;
}

.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.avatar-button, .balance-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.avatar-button {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  padding: 0;
}

.avatar-button img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#avatarFallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--bg);
  font-weight: 900;
  background: var(--yellow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.6px;
}

.brand > span:last-child > span { color: var(--yellow); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  color: #11110d;
  background: var(--yellow);
  font-size: 15px;
}

.balance-button {
  padding: 9px 12px;
  border-radius: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.coin { color: var(--yellow); }

.hero {
  position: relative;
  margin-top: 24px;
  padding: 25px 22px 23px;
  min-height: 226px;
  overflow: hidden;
  border: 1px solid rgba(244, 211, 40, .21);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(244, 211, 40, .22), transparent 37%),
    linear-gradient(140deg, #242319, #171711 70%);
}

.hero::after {
  content: "U";
  position: absolute;
  right: 3px;
  bottom: -84px;
  color: rgba(244, 211, 40, .07);
  font-size: 250px;
  line-height: 1;
  font-weight: 1000;
  pointer-events: none;
}

.eyebrow {
  color: var(--yellow);
  letter-spacing: 2px;
  font-size: 10px;
  font-weight: 900;
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin: 15px 0 9px;
  font-size: 38px;
  line-height: .99;
  letter-spacing: -1.8px;
}

.hero h1 span { color: var(--yellow); }

.hero p {
  position: relative;
  z-index: 1;
  max-width: 290px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.hero-tag {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 14px;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--yellow-2);
  background: rgba(244, 211, 40, .10);
  font-size: 10px;
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 28px 2px 14px;
}

.section-heading h2, .admin-panel h2 {
  margin: 5px 0 0;
  font-size: 23px;
  letter-spacing: -.7px;
}

.live-pill {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1px;
}

.live-pill i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--yellow);
}

.game-list { display: grid; gap: 11px; }

.game-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 19px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: linear-gradient(120deg, #202019, #191913);
  transition: transform .15s ease, border-color .15s ease;
}

.game-card:active { transform: scale(.985); }
.game-card:hover { border-color: rgba(244, 211, 40, .4); }

.game-icon {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  border-radius: 15px;
  color: #17160f;
  background: var(--yellow);
  font-size: 28px;
  font-weight: 900;
}

.mines-card .game-icon {
  color: var(--yellow);
  background: #343016;
}

.game-copy { flex: 1; display: grid; gap: 5px; }
.game-copy strong { font-size: 15px; }
.game-copy small { color: var(--muted); font-size: 11px; }
.arrow { color: var(--yellow); font-size: 22px; }

.notice, .admin-panel {
  margin-top: 17px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, .025);
}

.notice strong { color: var(--yellow); font-size: 12px; }
.notice p, .admin-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.bottom-nav {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 520px);
  display: flex;
  justify-content: space-around;
  padding: 11px 12px calc(11px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(17, 17, 13, .94);
  backdrop-filter: blur(16px);
}

.nav-item {
  display: grid;
  gap: 3px;
  justify-items: center;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.nav-item span { font-size: 19px; }
.nav-item.active { color: var(--yellow); }

.secondary-button, .primary-button {
  width: 100%;
  margin-top: 12px;
  padding: 13px;
  border: 0;
  border-radius: 13px;
  font-weight: 900;
  cursor: pointer;
}

.primary-button { color: #11110d; background: var(--yellow); }
.secondary-button {
  color: var(--yellow);
  border: 1px solid rgba(244, 211, 40, .28);
  background: rgba(244, 211, 40, .08);
}

.modal.hidden, .hidden { display: none !important; }

.modal {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  align-items: end;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
}

.modal-card {
  position: relative;
  width: min(100%, 520px);
  max-height: 88dvh;
  overflow: auto;
  margin: 0 auto;
  padding: 25px 20px 30px;
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  background: #1a1a14;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 28px;
}

.modal-card h2 { margin: 5px 0 10px; }
.modal-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.modal-card label { display: block; margin-top: 12px; color: var(--muted); font-size: 12px; }

.modal-card input, .modal-card select {
  width: 100%;
  margin-top: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: #11110d;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-top: 16px;
}

.cell {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: #27271e;
  font-size: 17px;
  cursor: pointer;
}

.cell.open { color: #11110d; background: var(--yellow); }
.cell.bomb { color: white; background: var(--danger); }

.result {
  margin-top: 12px;
  padding: 11px;
  border-radius: 12px;
  color: var(--yellow-2);
  background: rgba(244, 211, 40, .08);
  font-size: 13px;
}

.topbar,
.game-card,
.notice,
.admin-panel,
.modal-card,
.bottom-nav {
  background: rgba(28, 28, 21, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.game-card,
.primary-button,
.secondary-button,
.balance-button,
.avatar-button {
  transition: transform 180ms ease, border-color 180ms ease,
    box-shadow 180ms ease;
}

.game-card:active,
.primary-button:active,
.secondary-button:active {
  transform: scale(0.975);
}

.game-card:hover,
.balance-button:hover {
  border-color: rgba(244, 211, 40, 0.48);
  box-shadow: 0 10px 30px rgba(244, 211, 40, 0.08);
}

.modal-card {
  animation: glass-rise 240ms ease-out;
}

@keyframes glass-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}