@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Thai:wght@400;500;600;700;800&display=swap");

:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.1);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.15);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --topbar-bg: rgba(15, 23, 42, 0.88);
  --hero-bg: linear-gradient(135deg, #1e293b 0%, #0f172a 60%, #064e3b 100%);
  --footer-bg: #0b1120;
  --page-pad: clamp(16px, 4vw, 40px);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --green: #4f46e5;
  --green-soft: #eef2ff;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --topbar-bg: rgba(255, 255, 255, 0.90);
  --hero-bg: linear-gradient(135deg, #3730a3 0%, #4f46e5 50%, #6366f1 100%);
  --footer-bg: #f8fafc;
}

html[data-theme="light"] .hero-card {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.15);
}

html[data-theme="light"] .game-tile.playable:hover .icon-frame {
  border-color: #4f46e5;
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.20);
}

html[data-theme="light"] .btn-login-header {
  border-color: rgba(79, 70, 229, 0.25);
}

html[data-theme="light"] .user-avatar-badge,
html[data-theme="light"] .profile-header-bg,
html[data-theme="light"] .profile-avatar-large {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: "Noto Sans Thai", Inter, "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

/* Header Topbar */
.store-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  min-height: 76px;
  padding: 0 var(--page-pad);
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  font-size: 21px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink);
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.store-tabs {
  display: flex;
  gap: 28px;
  align-items: center;
  min-height: 76px;
  overflow-x: auto;
  scrollbar-width: none;
}

.store-tabs::-webkit-scrollbar,
.tile-row::-webkit-scrollbar {
  display: none;
}

.store-tabs a {
  position: relative;
  display: grid;
  min-height: 76px;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.store-tabs a:hover {
  color: var(--ink);
}

.store-tabs a.active {
  color: var(--green);
}

.store-tabs a.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--green);
  content: "";
}

.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.theme-toggle-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.icon-button,
.next-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.icon-button svg,
.next-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.store-page {
  min-height: calc(100svh - 76px);
  padding: 28px 0 56px;
  overflow: hidden;
}

.shelf {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.shelf + .shelf {
  margin-top: 42px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.2;
  letter-spacing: 0;
}

.small-link,
.muted-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.small-link {
  color: var(--green);
}

.tile-row {
  position: relative;
  display: grid;
  grid-auto-columns: clamp(112px, 10.4vw, 154px);
  grid-auto-flow: column;
  gap: clamp(18px, 2.1vw, 30px);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 54px 10px 0;
  scroll-padding-inline: var(--page-pad);
  scrollbar-width: none;
}

.featured-row {
  grid-auto-columns: clamp(124px, 11.8vw, 166px);
  min-height: 238px;
}

.compact-row {
  grid-auto-columns: clamp(104px, 9vw, 132px);
}

.game-tile {
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  gap: 4px;
  min-width: 0;
  text-decoration: none;
}

.game-tile.locked {
  cursor: default;
}

.icon-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 10px;
  border-radius: 24%;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.game-tile.large .icon-frame {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.game-tile.playable:hover .icon-frame {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: 0 14px 28px rgba(16, 185, 129, 0.25);
}

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

.game-title,
.game-subtitle,
.game-score {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-title {
  min-height: 42px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.game-subtitle,
.game-score {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}

.game-score span {
  color: #fbbf24;
}

.next-button {
  position: sticky;
  right: 6px;
  align-self: center;
  justify-self: end;
  grid-column: auto;
  margin-left: -18px;
  cursor: default;
}

/* ═══ Animated Dino Runner Hero Section ═══ */
.hero-dino-section {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 36px;
  height: 210px;
  background: var(--hero-bg);
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  cursor: pointer;
  user-select: none;
}

html[data-theme="light"] .hero-dino-section {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.15);
}

.hero-dino-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 24px;
}

.hero-dino-top-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  pointer-events: none;
}

.dino-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.dino-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(52, 211, 153, 0.35);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-family: "Courier New", Courier, monospace;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.05em;
}

.dino-hi-score {
  color: #94a3b8;
  font-size: 12px;
}

.dino-hi-score strong {
  color: #38bdf8;
}

.dino-cur-score {
  color: #34d399;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.dino-score-badge.new-record-active {
  border-color: #f59e0b !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6), 0 0 40px rgba(245, 158, 11, 0.3) !important;
  animation: pulseGold 0.8s infinite alternate ease-in-out;
}

.dino-score-badge.new-record-active .dino-cur-score {
  color: #facc15 !important;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.8) !important;
}

@keyframes pulseGold {
  from { transform: scale(1); border-color: #f59e0b; }
  to { transform: scale(1.05); border-color: #facc15; }
}

.dino-hint {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 600;
}

/* Leaderboard Bottom Bar & Button */
.hero-dino-bottom-bar {
  position: absolute;
  bottom: 14px;
  right: 20px;
  z-index: 5;
}

.btn-leaderboard {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fef08a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.btn-leaderboard:hover {
  background: #f59e0b;
  color: #0f172a;
  border-color: #facc15;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* Leaderboard Modal Popup */
.dino-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.dino-modal-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  color: #f8fafc;
  overflow: hidden;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.dino-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.dino-modal-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.trophy-badge {
  font-size: 28px;
  line-height: 1;
}

.dino-modal-title h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
}

.dino-modal-title p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.dino-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.dino-modal-close:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: transparent;
}

.dino-modal-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
}

.dino-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.6;
}

.dino-search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.dino-search-input:focus {
  border-color: #f59e0b;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.dino-record-count {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.dino-table-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.dino-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.dino-table th {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.dino-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.dino-table tbody tr:last-child td {
  border-bottom: none;
}

.dino-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.col-rank {
  font-family: "Courier New", Courier, monospace;
  font-weight: 800;
  text-align: center;
}

.rank-gold .col-rank {
  color: #facc15;
  font-size: 14px;
}

.rank-silver .col-rank {
  color: #e2e8f0;
  font-size: 14px;
}

.rank-bronze .col-rank {
  color: #fb923c;
  font-size: 14px;
}

.col-score {
  font-family: "Courier New", Courier, monospace;
  font-weight: 800;
  color: #34d399;
  text-align: right;
}

.col-date {
  text-align: right;
  color: #64748b;
  font-size: 12px;
}

.empty-table {
  text-align: center;
  padding: 32px !important;
  color: #64748b;
}

@media (max-width: 768px) {
  .hero-dino-bottom-bar {
    position: static;
    margin-top: 10px;
    display: flex;
    justify-content: center;
  }
  .btn-leaderboard {
    width: calc(100% - 24px);
    justify-content: center;
  }
  .dino-modal-content {
    max-height: 90vh;
    border-radius: 16px;
  }
}

/* Mobile Edge-to-Edge Hero Banner */
@media (max-width: 768px) {
  .hero-shelf {
    padding: 0;
  }
  .hero-shelf .hero-dino-section {
    border-radius: 0;
    border-left: none;
    border-right: none;
    height: 180px;
  }
  .hero-shelf .hero-dino-canvas {
    border-radius: 0;
  }
  .hero-dino-top-bar {
    padding: 12px 14px;
  }
  .dino-hint {
    font-size: 11px;
    padding: 4px 10px;
  }
}

/* Hero Card (legacy fallback) */
.hero-card {
  position: relative;
  overflow: hidden;
  padding: 32px 36px;
  border-radius: 24px;
  background: var(--hero-bg);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  margin-bottom: 36px;
}


.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
}

.status-dot.live {
  box-shadow: 0 0 10px #34d399;
}

.hero-body {
  display: flex;
  align-items: center;
  gap: 28px;
}

.hero-icon-frame {
  width: 104px;
  height: 104px;
  flex-shrink: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hero-icon-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content h1 {
  margin: 0 0 6px;
  color: #ffffff;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 800;
}

.hero-subtitle {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  line-height: 1.45;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.meta-item.rating {
  font-weight: 700;
  color: #fbbf24;
}

.meta-item.chip {
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 12px;
}

.hero-actions .btn-play-primary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--green);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-actions .btn-play-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.filter-chip.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}

/* Catalog Layout */
.grid-catalog {
  grid-auto-columns: clamp(120px, 11vw, 160px);
}

/* Tile Lock Overlay & Status Badge */
.game-tile.locked .icon-frame img {
  filter: grayscale(0.5) opacity(0.6);
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  color: #ffffff;
}

.lock-overlay svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.game-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-playable {
  color: var(--green);
}

.status-playable .status-dot {
  background: var(--green);
}

.status-locked {
  color: var(--muted);
}

.status-locked .status-dot {
  background: #94a3b8;
}

.muted-score {
  color: var(--muted);
  font-weight: 500;
}

/* User Auth Topbar Widget */
.btn-login-header {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(16, 185, 129, 0.3);
  transition: all 0.15s ease;
}

.btn-login-header:hover {
  background: var(--green);
  color: #ffffff;
}

.user-menu-wrapper {
  position: relative;
}

.user-menu-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 4px 14px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: border-color 0.15s ease;
}

.user-menu-btn:hover {
  border-color: var(--green);
}

.user-avatar-badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #047857);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
}

.user-avatar-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-dropdown-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: none;
  z-index: 100;
}

.user-menu-wrapper.active .user-dropdown-card {
  display: block;
}

.dropdown-header {
  padding: 6px 8px;
}

.dropdown-header strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.dropdown-header small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--green);
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Footer Page Component */
.store-footer {
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
  margin-top: 60px;
  padding: 48px var(--page-pad) 24px;
}

.footer-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
}

.footer-brand strong {
  font-size: 18px;
  color: var(--ink);
}

.footer-brand p {
  margin: 8px 0 0;
  max-width: 420px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 48px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.footer-col a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--green);
}

.footer-bottom {
  width: min(1320px, 100%);
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Auth Login View */
.auth-page {
  display: grid;
  place-items: center;
  min-height: calc(100svh - 180px);
  padding: 40px var(--page-pad);
}

.auth-card {
  width: min(440px, 100%);
  padding: 36px 32px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  border-radius: 12px;
}

.auth-header h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--ink);
}

.auth-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
}

.auth-alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.form-group input {
  appearance: none;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.btn-auth-submit {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s ease;
}

.btn-auth-submit:hover {
  transform: translateY(-2px);
}

.auth-divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}

.auth-divider span {
  position: relative;
  padding: 0 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.btn-sso-pok9 {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-sso-pok9:hover {
  background: var(--surface-hover);
  border-color: var(--muted);
}

.auth-footer-link {
  text-align: center;
  margin-top: 24px;
}

.auth-footer-link a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.auth-footer-link a:hover {
  color: var(--green);
}

/* Profile View */
.profile-page {
  display: grid;
  place-items: center;
  padding: 40px var(--page-pad);
}

.profile-card {
  position: relative;
  overflow: hidden;
  width: min(520px, 100%);
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.profile-header-bg {
  height: 100px;
  background: linear-gradient(135deg, #10b981, #047857);
}

.profile-body {
  position: relative;
  padding: 0 32px 36px;
  text-align: center;
}

.profile-avatar-large {
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
  margin: -45px auto 16px;
  border-radius: 50%;
  border: 4px solid var(--surface);
  background: linear-gradient(135deg, #10b981, #047857);
  color: #ffffff;
  font-size: 36px;
  font-weight: 800;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
}

.profile-email {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.role-chip {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.profile-details-grid {
  display: grid;
  gap: 12px;
  margin: 24px 0;
  padding: 18px;
  border-radius: 16px;
  background: var(--surface-hover);
  border: 1px solid var(--line);
  text-align: left;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.detail-label {
  color: var(--muted);
}

.detail-value {
  font-weight: 600;
  color: var(--ink);
}

.detail-value.text-green {
  color: var(--green);
}

.profile-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.btn-primary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--green);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.btn-outline-danger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

@media (max-width: 900px) {
  .store-topbar {
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
    min-height: 68px;
    padding-top: 10px;
    padding-bottom: 0;
  }

  .brand {
    font-size: 18px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .store-tabs {
    grid-column: 1 / -1;
    min-height: 48px;
    gap: 24px;
  }

  .store-tabs a {
    min-height: 48px;
  }

  .store-page {
    min-height: calc(100svh - 116px);
    padding-top: 22px;
  }
}

@media (max-width: 620px) {
  :root {
    --page-pad: 16px;
  }

  .top-actions {
    gap: 6px;
  }

  .theme-toggle-label {
    display: none;
  }

  .store-topbar {
    grid-template-columns: 1fr;
  }

  .tile-row {
    grid-auto-columns: 104px;
    gap: 18px;
    padding-right: 24px;
  }

  .featured-row {
    grid-auto-columns: 118px;
    min-height: 212px;
  }

  .game-title {
    min-height: 40px;
    font-size: 13px;
  }

  .game-subtitle,
  .game-score {
    font-size: 12px;
  }

  .next-button {
    display: none;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .hero-card {
    padding: 20px;
  }

  .hero-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .hero-icon-frame {
    width: 72px;
    height: 72px;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .footer-shell {
    grid-template-columns: 1fr;
  }
}
