/* Yaarwin Game — design tokens from yaarwin.club palette */
:root {
  --gold: #0cd781;
  --gold-light: #00e989;
  --gold-dark: #09b86a;
  --orange: #0cd781;
  --orange-mid: #00e989;
  --amber: #00e989;
  --pink: #0cd781;
  --pink-deep: #09b86a;
  --red: #d23838;
  --bg-page: #f2f2f1;
  --bg-card: #ffffff;
  --text: #223935;
  --text-muted: #6b8f7f;
  --text-light: #b6c8bf;
  --border: #d8ebe4;
  --shadow: 0 4px 16px rgba(12, 215, 129, 0.1);
  --header-grad: linear-gradient(180deg, #0cd781 0%, #00e989 100%);
  --btn-gold-grad: linear-gradient(90deg, #0cd781 0%, #00e989 100%);
  --btn-pink-grad: linear-gradient(90deg, #0cd781 0%, #00e989 100%);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 56px;
  --max-w: 480px;
  --radius: 12px;
  --radius-lg: 16px;
  --font: "Roboto", "Inter", bahnschrift, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.45;
  min-height: 100dvh;
  overflow-x: hidden;
}

a {
  color: var(--pink);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font-family: inherit;
}

.app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg-page);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
}

.has-bottom-nav {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
}

/* Header */
.site-header {
  background: var(--header-grad);
  padding: 12px 16px 16px;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header.compact {
  padding-bottom: 12px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #0cd781, #00e989);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(12, 215, 129, 0.35);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-name span {
  color: #e8fff4;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 18px;
  transition: transform 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-gold {
  background: var(--btn-gold-grad);
  color: #fff;
  box-shadow: 0 3px 10px rgba(12, 215, 129, 0.35);
}

.btn-pink {
  background: var(--btn-pink-grad);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255, 31, 85, 0.35);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
}

.btn-block {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  border-radius: 999px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
}

/* Auth pages */
.auth-page {
  min-height: 100dvh;
  background: var(--bg-page);
}

.auth-hero {
  background: var(--header-grad);
  padding: 28px 20px 48px;
  text-align: center;
  color: #fff;
  border-radius: 0 0 28px 28px;
  position: relative;
  overflow: hidden;
}

.auth-hero::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 215, 118, 0.35), transparent 70%);
  top: -40px;
  right: -40px;
  pointer-events: none;
}

.auth-hero .brand-logo {
  width: 64px;
  height: 64px;
  font-size: 22px;
  margin: 0 auto 12px;
  border-radius: 18px;
}

.auth-hero h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-hero p {
  font-size: 13px;
  opacity: 0.9;
  max-width: 300px;
  margin: 0 auto;
  line-height: 1.5;
}

.auth-card {
  margin: -32px 16px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
}

.auth-tabs {
  display: flex;
  background: #f3f0f8;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--btn-gold-grad);
  color: #7a3b00;
  box-shadow: 0 2px 8px rgba(255, 165, 34, 0.3);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fafafa;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
}

.form-input-wrap {
  position: relative;
}

.form-input-wrap .form-input {
  padding-right: 44px;
}

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 8px;
  display: none;
}

.form-error.show {
  display: block;
}

.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 20px 24px;
}

.auth-footer a {
  font-weight: 600;
}

/* Landing */
.hero-banner {
  margin: 12px 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 2.2 / 1;
  background: linear-gradient(125deg, #0a8f58 0%, #0cd781 40%, #00e989 100%);
  box-shadow: var(--shadow);
}

.hero-banner-content {
  position: absolute;
  inset: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
}

.hero-banner h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.hero-banner p {
  font-size: 12px;
  opacity: 0.92;
}

.hero-banner .badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--btn-gold-grad);
  color: #7a3b00;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.quick-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
  margin-bottom: 16px;
}

.quick-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.15s;
}

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

.quick-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.quick-card-icon.gold {
  background: linear-gradient(135deg, #fff7b2, #ffa522);
}

.quick-card-icon.pink {
  background: linear-gradient(135deg, #0cd781, #00e989);
}

.quick-card-text h3 {
  font-size: 13px;
  font-weight: 700;
}

.quick-card-text span {
  font-size: 11px;
  color: var(--text-muted);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 10px;
}

.section-title h2 {
  font-size: 16px;
  font-weight: 700;
}

.section-title a {
  font-size: 12px;
  color: var(--text-muted);
}

/* Winning ticker */
.win-ticker {
  margin: 0 16px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border);
}

.win-ticker h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--pink);
}

.ticker-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.ticker-row:last-child {
  border-bottom: none;
}

.ticker-row .user {
  color: var(--text-muted);
}

.ticker-row .amount {
  color: var(--gold-dark);
  font-weight: 700;
}

/* Game grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px 16px;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s;
}

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

.game-card-thumb {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
}

.game-card-thumb.match {
  background: linear-gradient(145deg, #ff6b6b, #ee5a24);
}

.game-card-thumb.memory {
  background: linear-gradient(145deg, #5f27cd, #341f97);
}

.game-card-thumb.sequence {
  background: linear-gradient(145deg, #00d2d3, #01a3a4);
}

.game-card-thumb.spot {
  background: linear-gradient(145deg, #fbbf24, #d97706);
}

.game-card-body {
  padding: 10px 12px 12px;
}

.game-card-body h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

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

.game-card-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: none;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item.active {
  color: var(--pink);
  font-weight: 600;
}

.nav-item.promo .nav-icon-wrap {
  width: 44px;
  height: 44px;
  margin-top: -18px;
  background: var(--btn-gold-grad);
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(255, 165, 34, 0.5);
  border: 3px solid var(--bg-card);
}

.nav-item.promo svg {
  width: 24px;
  height: 24px;
  color: #7a3b00;
}

/* Disclaimer */
.disclaimer {
  margin: 8px 16px 20px;
  padding: 14px;
  background: #fff5f5;
  border-radius: var(--radius);
  border: 1px solid #ffe4e4;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.55;
}

.disclaimer .age {
  display: inline-block;
  background: var(--pink);
  color: #fff;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 12px;
}

/* Profile / account */
.profile-header {
  text-align: center;
  padding: 20px 16px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--header-grad);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  border: 3px solid var(--gold-light);
}

.coins-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, #fff7b2, #ffd976);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #7a3b00;
  margin-top: 8px;
}

.menu-list {
  padding: 0 16px;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
}

.menu-item.danger {
  color: var(--red);
}

/* Game play screen */
.game-screen {
  padding: 12px 16px;
}

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

.game-topbar h1 {
  font-size: 16px;
  font-weight: 700;
}

.back-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}

.game-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-pill {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-pill .label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-pill .value {
  font-size: 18px;
  font-weight: 800;
  color: var(--pink);
}

.game-canvas-wrap {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.game-canvas-wrap canvas {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  touch-action: manipulation;
}

.game-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.color-btn {
  aspect-ratio: 1;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}

.color-btn:active,
.color-btn.lit {
  transform: scale(0.95);
  filter: brightness(1.3);
}

.game-msg {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  min-height: 20px;
}

.hidden {
  display: none !important;
}

/* Tab panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Activity placeholder */
.activity-card {
  margin: 0 16px 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.activity-card h3 {
  font-size: 14px;
  margin-bottom: 4px;
}

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

/* Promo */
.promo-banner {
  margin: 12px 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ff772a, #ff1f55);
  color: #fff;
  text-align: center;
}

.promo-banner h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

.promo-banner p {
  font-size: 13px;
  opacity: 0.9;
}

/* Responsive */
@media (min-width: 481px) {
  body {
    background: linear-gradient(180deg, #f3edf8 0%, var(--bg-page) 120px);
  }
}

@media (max-width: 360px) {
  .game-grid {
    gap: 8px;
  }

  .brand-name {
    font-size: 16px;
  }
}
