:root {
  --bg: #07060b;
  --bg-2: #100e16;
  --ink: #f6f3ee;
  --muted: #9a948a;
  --line: rgba(246, 243, 238, 0.08);
  --card: rgba(255, 255, 255, 0.045);
  --card-2: rgba(255, 255, 255, 0.07);
  --amber: #f0b429;
  --lime: #c8f54a;
  --rose: #ff6b6b;
  --sky: #7ad7ff;
  --violet: #b08cff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --dock: 76px;
  --radius: 22px;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: #05040a;
  color: var(--ink);
  font-family: Manrope, "Segoe UI", sans-serif;
}

body {
  min-height: 100dvh;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.app {
  position: relative;
  isolation: isolate;
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(18px + var(--safe-top)) 16px calc(var(--dock) + var(--safe-bottom) + 12px);
  overflow: clip;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(240, 180, 41, 0.16), transparent 50%),
    linear-gradient(180deg, #0c0a12 0%, var(--bg) 38%, #09080e 100%);
}

.bg {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: -1;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  animation: drift 14s ease-in-out infinite;
}

.orb-a {
  width: 180px;
  height: 180px;
  top: -40px;
  right: -30px;
  background: #f0b429;
}

.orb-b {
  width: 220px;
  height: 220px;
  left: -90px;
  top: 28%;
  background: #5b3dff;
  animation-delay: -4s;
}

.orb-c {
  width: 160px;
  height: 160px;
  right: -40px;
  bottom: 18%;
  background: #c8f54a;
  opacity: 0.22;
  animation-delay: -8s;
}

.grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}

@keyframes drift {
  0%,
  100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-12px, 18px, 0) scale(1.08); }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark {
  width: 44px;
  height: 44px;
  display: block;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(200, 245, 74, 0.2);
}

.brand-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand h1 {
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 22px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip,
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.chip {
  padding: 0 12px 0 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
}

.chip svg,
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn {
  width: 40px;
  justify-content: center;
  position: relative;
}

.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(200, 245, 74, 0.16);
}

.player-card,
.quick-match,
.game-card,
.daily-card,
.board-row,
.profile-hero,
.stat-row,
.list-item {
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(16px);
}

.player-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 22px;
  color: #1a1406;
  background:
    linear-gradient(135deg, #fff1b8, #f0b429 55%, #c8f54a);
}

.avatar.lg {
  width: 76px;
  height: 76px;
  flex-basis: 76px;
  border-radius: 24px;
  font-size: 28px;
  margin: 0 auto 12px;
}

.hello,
.daily-kicker,
.sheet-tag {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.player-meta h2,
.profile-hero h2,
.game-card h4,
.daily-card h3,
.sheet-card h3 {
  font-family: Manrope, "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
}

.player-meta h2 {
  font-size: 20px;
  margin: 2px 0 8px;
}

.player-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.player-stats b {
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
}

.sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3d3944;
}

.streak b {
  color: var(--lime);
}

.quick-match {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 18px 16px;
  border-radius: 24px;
  margin-bottom: 22px;
  background:
    linear-gradient(135deg, rgba(240, 180, 41, 0.16), rgba(200, 245, 74, 0.06) 46%, rgba(255, 255, 255, 0.03)),
    var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.quick-copy p {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 4px;
}

.quick-copy strong {
  display: block;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.quick-copy span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.quick-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #16120a;
  background: var(--lime);
}

.quick-icon svg {
  width: 28px;
  height: 28px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h3 {
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 18px;
}

.section-head span,
.list-item small {
  color: var(--muted);
  font-size: 13px;
}

.featured-slot {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.featured-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 128px;
  padding: 12px;
  border-radius: 24px;
  text-align: left;
  overflow: hidden;
  border: 1px solid rgba(200, 245, 74, 0.18);
  background:
    linear-gradient(135deg, rgba(200, 245, 74, 0.12), rgba(255, 255, 255, 0.03) 55%),
    var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.18s ease;
}

.featured-card:active {
  transform: scale(0.985);
}

.featured-art {
  width: 104px;
  height: 104px;
  border-radius: 22px;
  object-fit: contain;
  background: #101014;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.featured-copy {
  min-width: 0;
}

.featured-copy .tag {
  display: inline-block;
  margin-bottom: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--lime);
}

.featured-copy h4 {
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 20px;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.featured-copy p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.game-card {
  position: relative;
  min-height: 132px;
  padding: 14px;
  border-radius: 20px;
  text-align: left;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.game-card:active {
  transform: scale(0.98);
}

.game-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -22px;
  bottom: -28px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.18;
  filter: blur(6px);
}

.game-card .icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
}

.game-card .icon svg {
  width: 20px;
  height: 20px;
}

.game-card h4 {
  font-size: 16px;
  margin-bottom: 4px;
}

.game-card p {
  color: var(--muted);
  font-size: 12px;
}

.game-card .tag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.game-card.is-ready .tag {
  color: var(--lime);
}

.game-card.is-soon {
  opacity: 0.9;
}

.daily-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 16px;
  border-radius: 20px;
  text-align: left;
  margin-bottom: 22px;
}

.daily-card h3 {
  font-size: 16px;
  margin: 4px 0;
}

.daily-note {
  color: var(--muted);
  font-size: 12px;
}

.daily-progress {
  min-width: 72px;
  text-align: right;
}

.daily-progress b {
  font-family: "IBM Plex Mono", monospace;
  font-size: 18px;
  color: var(--amber);
}

.bar {
  display: block;
  height: 5px;
  margin-top: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar i {
  display: block;
  width: var(--p);
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--lime));
}

.screen[hidden] {
  display: none;
}

.screen.is-active {
  animation: rise 0.35s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.board {
  display: grid;
  gap: 8px;
}

.board-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
}

.board-row.is-me {
  border-color: rgba(240, 180, 41, 0.35);
  background: rgba(240, 180, 41, 0.08);
}

.board-row .place {
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
}

.board-row .who {
  display: flex;
  align-items: center;
  gap: 10px;
}

.board-row .mini {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #1d1a24;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 13px;
}

.board-row b {
  font-family: "IBM Plex Mono", monospace;
}

.profile-hero {
  padding: 22px 16px 18px;
  border-radius: 24px;
  text-align: center;
  margin-bottom: 12px;
}

.profile-hero p {
  color: var(--muted);
  margin-top: 4px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 16px 8px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-align: center;
}

.stat-row b {
  display: block;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 22px;
  margin-bottom: 4px;
}

.stat-row span {
  color: var(--muted);
  font-size: 12px;
}

.list {
  display: grid;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  text-align: left;
}

.dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(430px, 100%);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: rgba(7, 6, 11, 0.78);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.dock-btn {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 0;
  color: #6f6a63;
  border-radius: 14px;
}

.dock-btn svg {
  width: 22px;
  height: 22px;
}

.dock-btn span {
  font-size: 11px;
  font-weight: 700;
}

.dock-btn.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.sheet[hidden] {
  display: none;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.55);
}

.sheet-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(430px, 100%);
  transform: translateX(-50%);
  padding: 10px 20px calc(22px + var(--safe-bottom));
  border-radius: 28px 28px 0 0;
  background: #141218;
  border: 1px solid var(--line);
  animation: sheet-up 0.28s ease;
}

@keyframes sheet-up {
  from { transform: translate(-50%, 24px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}

.sheet-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.sheet-icon svg {
  width: 24px;
  height: 24px;
}

.sheet-icon.is-cover {
  width: 72px;
  height: 72px;
  padding: 0;
  overflow: hidden;
  background: #0b0b10;
}

.sheet-icon.is-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet-card h3 {
  font-size: 24px;
  margin: 6px 0 8px;
}

.sheet-desc {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.sheet-cta,
.toast {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  font-family: Manrope, "Segoe UI", sans-serif;
  background: var(--lime);
  color: #16120a;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock) + 16px);
  z-index: 30;
  width: min(390px, calc(100% - 32px));
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  animation: rise 0.25s ease;
}

@media (min-width: 760px) {
  body {
    display: grid;
    place-items: center;
    padding: 24px 0;
  }

  .app {
    min-height: min(860px, 100dvh);
    border: 1px solid var(--line);
    border-radius: 32px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  }

  .dock {
    width: min(430px, 100%);
    border-radius: 0 0 32px 32px;
  }
}
