:root {
  --bg0: #070b14;
  --bg1: #121a2b;
  --ink: #f4f7ff;
  --muted: #9aa8c2;
  --line: rgba(255,255,255,0.12);
  --accent: #3d8bfd;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Nunito", "Outfit", sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(700px 420px at 10% -10%, #1b3a6b 0%, transparent 55%),
    radial-gradient(600px 380px at 100% 0%, #5a1d3a 0%, transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1));
}
body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px;
}
.hidden { display: none !important; }
.phone {
  width: min(390px, 100%);
  min-height: min(780px, 92dvh);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid var(--line);
  border-radius: 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  padding: 18px 16px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.phone-notch {
  width: 120px;
  height: 22px;
  margin: 0 auto 10px;
  background: #05070d;
  border-radius: 0 0 16px 16px;
}
.phone-top { text-align: center; padding: 8px 8px 18px; }
.brand {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
}
.sub { color: var(--muted); margin-top: 4px; font-weight: 600; }
.user-bar {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.28);
  text-align: left;
}
.user-meta { display: grid; gap: 2px; min-width: 0; }
.user-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chips { color: #f6c453; font-size: 0.88rem; font-weight: 700; }
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  align-content: start;
}
.game-tile {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 22px 12px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  transition: transform 0.15s ease, filter 0.15s;
  min-height: 148px;
}
.game-tile:active { transform: scale(0.97); }
.game-tile .icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-family: var(--display);
  font-size: 1.35rem;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.game-tile.poker .icon {
  background: linear-gradient(145deg, #1f6f4a, #0d3b28);
  color: #e8fff3;
  font-size: 2rem;
}
.game-tile.uno .icon {
  background: conic-gradient(#e63946, #f4d35e, #2a9d8f, #457b9d, #e63946);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
  font-size: 1.05rem;
}
.game-tile.dogdoku .icon,
.game-tile.chess .icon {
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
}
.game-tile.xiangqi .icon {
  background: linear-gradient(145deg, #e8c88a, #c49a4a);
  color: #c0392b;
  font-family: "Noto Serif SC", serif;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(42, 24, 16, 0.25);
}
.game-tile .icon.img-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 18px;
}
.game-tile .name {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.15rem;
}
.game-tile .desc { color: var(--muted); font-size: 0.82rem; }
.phone-foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding-top: 14px;
}
.auth-form {
  display: grid;
  gap: 12px;
  padding: 4px 4px 8px;
  flex: 1;
  align-content: start;
}
.auth-form label {
  display: grid;
  gap: 6px;
  text-align: left;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}
.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,0.35);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  outline: none;
}
.auth-form input:focus {
  border-color: rgba(61, 139, 253, 0.7);
  box-shadow: 0 0 0 3px rgba(61, 139, 253, 0.18);
}
.auth-error {
  margin: 0;
  color: #ff8f9a;
  font-size: 0.88rem;
  font-weight: 600;
}
.btn {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 12px 14px;
  cursor: pointer;
}
.btn.primary {
  background: linear-gradient(135deg, #2f6fed, #1f4fb8);
  border-color: transparent;
}
.btn.ghost {
  background: transparent;
  font-weight: 600;
  color: var(--muted);
}
.btn.tiny {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.btn:disabled { opacity: 0.55; cursor: wait; }
@media (max-width: 420px) {
  body { padding: 0; }
  .phone {
    width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
}
