/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--page-pad);
  background: rgba(11,15,26,0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2)); box-shadow: 0 0 20px var(--color-accent); }
.logo-text strong { background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats { display: flex; gap: 8px; align-items: center; }

/* Bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--bottomnav-h);
  display: flex; justify-content: space-around; align-items: center;
  background: rgba(11,15,26,0.9); backdrop-filter: blur(14px);
  border-top: 1px solid var(--color-border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--color-fg-muted); font-weight: 600;
  padding: 8px 16px; border-radius: var(--radius-md); transition: color .2s, background .2s;
}
.bottom-nav a span { font-size: 20px; }
.bottom-nav a.active { color: var(--color-fg); }
.bottom-nav a.active span { filter: drop-shadow(0 0 8px var(--color-accent)); }

#app {
  min-height: calc(100vh - var(--topbar-h) - var(--bottomnav-h));
  padding: 18px var(--page-pad) calc(var(--bottomnav-h) + 24px);
  max-width: 720px; margin: 0 auto;
}

.page-header { margin-bottom: 16px; }
.page-header h1 { font-size: 28px; margin-bottom: 4px; }
.page-header p { color: var(--color-fg-muted); }
.empty { color: var(--color-fg-muted); padding: 28px 0; text-align: center; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  border-radius: var(--radius-lg);
  padding: 22px; display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--shadow-pop); position: relative; overflow: hidden; margin-bottom: 26px;
}
.hero::before { content: ''; position: absolute; inset: 1px; border-radius: calc(var(--radius-lg) - 1px); background: linear-gradient(135deg, rgba(0,0,0,0.25), rgba(0,0,0,0.15)); z-index: 0; }
.hero__body { position: relative; z-index: 1; max-width: 70%; }
.hero__kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; opacity: 0.9; text-transform: uppercase; }
.hero__body h1 { font-size: 26px; margin: 6px 0 6px; color: white; }
.hero__body p { color: rgba(255,255,255,0.85); margin-bottom: 14px; font-size: 14px; }
.hero__body .btn { background: white; color: #111; }
.hero__emoji { font-size: 86px; position: relative; z-index: 1; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4)); animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-10px) rotate(5deg); } }

/* Rows */
.row { margin: 20px 0; }
.row h2 { font-size: 20px; margin-bottom: 12px; }
.row__scroll {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--page-pad)); padding-left: var(--page-pad); padding-right: var(--page-pad);
}
.row__scroll::-webkit-scrollbar { display: none; }
.row__scroll .game-card { flex: 0 0 70%; scroll-snap-align: start; }

/* Game grid */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.game-card {
  display: flex; flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .2s var(--ease-bounce), box-shadow .2s;
  min-height: 180px;
}
.game-card:hover, .game-card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.game-card:active { transform: scale(0.98); }
.game-card__emoji {
  height: 80px; display: flex; align-items: center; justify-content: center;
  font-size: 48px; background: linear-gradient(135deg, var(--tile-color), var(--tile-color-2));
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
}
.game-card__body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.game-card__body h3 { font-size: 14px; line-height: 1.2; }
.game-card__body p { font-size: 12px; color: var(--color-fg-muted); line-height: 1.4; }
.game-card__meta { display: flex; gap: 4px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }

/* Play screen */
.play-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 10px; gap: 12px;
}
.play-header__title { display: flex; align-items: center; gap: 8px; flex: 1; overflow: hidden; }
.play-header__title span { font-size: 22px; }
.play-header__title strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  aspect-ratio: 9 / 14; max-height: 72vh;
}
.game-frame { width: 100%; height: 100%; border: 0; display: block; background: var(--color-bg); }

/* Profile */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: 16px; text-align: center;
}
.stat-card__value { font-family: var(--font-display); font-size: 30px; font-weight: 700; background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card__label { color: var(--color-fg-muted); font-size: 13px; margin-top: 4px; }
.collection { margin-top: 16px; }
.collection h3 { font-size: 15px; margin-bottom: 8px; color: var(--color-fg-muted); text-transform: capitalize; }
.collection__items { display: flex; flex-wrap: wrap; gap: 6px; }
.coll-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-pill); background: var(--color-surface); border: 1px solid var(--color-border); font-size: 13px; }
.history-chip { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-pill); background: var(--color-surface); border: 1px solid var(--color-border); font-size: 13px; }
.history-chip em { font-style: normal; color: var(--color-accent-2); font-weight: 700; }
