@import "../css/tokens.css";

/* Cross Hop — Vibrant Arcade Aesthetic */

:root {
  --ch-green-top: #4ADE80;
  --ch-green-front: #22C55E;
  --ch-green-side: #16A34A;
  --ch-road: #1E293B;
  --ch-road-dark: #0F172A;
  --ch-water: #38BDF8;
  --ch-gold: #FACC15;
  --ch-gold-deep: #D97706;
  --ch-red: #EF4444;
  --ch-red-deep: #B91C1C;
  --ch-card-bg: rgba(255, 255, 255, 0.94);
  --ch-border: #CBD5E1;
  --ch-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-paper-2, #F8FAFC);
  color: var(--color-ink, #0F172A);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* Hub Bar */
.hub-bar {
  width: 100%;
  max-width: 780px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--color-paper, #F1F5F9);
  border-bottom: 1px solid var(--color-rule, #E2E8F0);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: var(--z-bar, 20);
}

.hub-bar a {
  color: var(--color-ink, #0F172A);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  border: 1px solid var(--color-rule, #CBD5E1);
  transition: transform var(--dur-micro) var(--ease-out);
}

.hub-bar a:hover {
  transform: translateY(-1px);
}

.hub-bar span {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

/* Advertisement Well */
.playyard-ad {
  width: 100%;
  max-width: 740px;
  margin: 0.6rem auto;
  text-align: center;
}

.ad-well {
  min-height: 60px;
  background: rgba(241, 245, 249, 0.6);
  border: 1px dashed var(--color-rule, #CBD5E1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* App Shell */
.app-shell {
  width: 100%;
  max-width: 580px;
  padding: 0.5rem 0.8rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Common Screen Styles */
.screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen[hidden] {
  display: none !important;
}

/* Kicker & Typography */
.kicker {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #16A34A;
  margin-bottom: 0.25rem;
}

h1.game-title {
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 800;
  color: #0F172A;
  text-shadow: 0 2px 0 #FFFFFF;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 0.5rem;
}

.lede {
  font-size: var(--text-sm);
  color: var(--color-ink-2, #334155);
  text-align: center;
  max-width: 440px;
  margin-bottom: 1rem;
}

/* Demo Container on Title */
.demo-wrap {
  width: 100%;
  max-width: 360px;
  height: 190px;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid #0F172A;
  box-shadow: 0 8px 0 #0F172A, var(--ch-shadow);
  margin-bottom: 1.25rem;
  background: #7DD3FC;
}

.demo-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Fact Badges on Title */
.facts-list {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.facts-list li {
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  padding: 0.4rem 0.75rem;
  font-size: var(--text-xs);
  font-family: var(--font-label);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 0 #CBD5E1;
}

.facts-list li b {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0F172A;
}

/* Tactile Arcade Buttons */
.btn-row {
  display: flex;
  gap: 0.6rem;
  width: 100%;
  max-width: 380px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 800;
  padding: 0.75rem 1.4rem;
  border-radius: 14px;
  border: 2px solid #0F172A;
  cursor: pointer;
  box-shadow: 0 4px 0 #0F172A;
  background: #FFFFFF;
  color: #0F172A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: transform var(--dur-micro) var(--ease-press), box-shadow var(--dur-micro) var(--ease-press);
  user-select: none;
  -webkit-user-select: none;
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0F172A;
}

.btn--primary {
  background: #4ADE80;
  color: #052E16;
  font-size: 1.05rem;
  padding: 0.85rem 1.8rem;
  box-shadow: 0 5px 0 #15803D;
  border-color: #15803D;
}

.btn--primary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #15803D;
}

.btn--accent {
  background: #FACC15;
  color: #713F12;
  box-shadow: 0 4px 0 #CA8A04;
  border-color: #CA8A04;
}

.btn--soft {
  background: #F1F5F9;
  color: #334155;
  border-color: #CBD5E1;
  box-shadow: 0 3px 0 #CBD5E1;
}

.btn--selected {
  background: #22C55E;
  color: #FFFFFF;
  border-color: #15803D;
  box-shadow: 0 2px 0 #15803D;
}

.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: 0 2px 0 #CBD5E1;
}

/* Game Arena & Canvas */
.game-arena {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* In-Game HUD */
.hud {
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border: 2px solid #0F172A;
  border-radius: 16px;
  padding: 0.5rem 0.8rem;
  box-shadow: 0 4px 0 #0F172A;
  margin-bottom: 0.6rem;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hud-pill {
  display: flex;
  flex-direction: column;
  font-family: var(--font-label);
}

.hud-label {
  font-size: 0.65rem;
  color: #64748B;
  font-weight: 700;
  text-transform: uppercase;
}

.hud-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1;
}

.hud-val--gold {
  color: #D97706;
}

.hud-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-hud {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  border: 1.5px solid #0F172A;
  background: #F8FAFC;
  box-shadow: 0 2px 0 #0F172A;
  cursor: pointer;
}

.btn-hud:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* Canvas Container */
.stage-wrap {
  width: 100%;
  max-width: 440px;
  height: min(68vh, 620px);
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid #0F172A;
  box-shadow: 0 6px 0 #0F172A, var(--ch-shadow);
  background: #7DD3FC;
  touch-action: none;
}

.stage-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Virtual D-Pad for Mobile Players */
.dpad {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(2, 48px);
  gap: 6px;
  justify-content: center;
}

.dpad-btn {
  background: #FFFFFF;
  border: 2px solid #0F172A;
  box-shadow: 0 3px 0 #0F172A;
  border-radius: 12px;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.dpad-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #0F172A;
  background: #4ADE80;
}

.dpad-btn--up {
  grid-column: 2;
  grid-row: 1;
}

.dpad-btn--left {
  grid-column: 1;
  grid-row: 2;
}

.dpad-btn--down {
  grid-column: 2;
  grid-row: 2;
}

.dpad-btn--right {
  grid-column: 3;
  grid-row: 2;
}

/* Overlay Sheet (Game Over / High Score) */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  animation: fadeIn 0.2s var(--ease-out);
}

.overlay[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.sheet {
  background: #FFFFFF;
  border: 3px solid #0F172A;
  border-radius: 24px;
  box-shadow: 0 8px 0 #0F172A, 0 20px 30px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 380px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.badge-best {
  background: #FEF08A;
  color: #854D0E;
  border: 1.5px solid #EAB308;
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.sheet h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 0.2rem;
}

.sheet-kicker {
  font-size: var(--text-sm);
  color: #64748B;
  margin-bottom: 1.25rem;
}

.score-board {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: 16px;
  padding: 0.75rem 0.5rem;
  margin-bottom: 1.25rem;
}

.sb-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sb-label {
  font-size: 0.68rem;
  font-family: var(--font-label);
  color: #64748B;
  font-weight: 700;
  text-transform: uppercase;
}

.sb-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0F172A;
}

.sb-val--gold {
  color: #D97706;
}

/* Shop & Skin Selector */
.shop-balance {
  font-family: var(--font-label);
  font-size: 1rem;
  font-weight: 800;
  color: #D97706;
  background: #FEF3C7;
  border: 2px solid #FCD34D;
  border-radius: 12px;
  padding: 0.4rem 1rem;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.shop-roster {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.skin-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: 18px;
  padding: 0.75rem;
  box-shadow: 0 3px 0 #CBD5E1;
  transition: border-color var(--dur-short);
}

.skin-card.is-selected {
  border-color: #22C55E;
  background: #F0FDF4;
  box-shadow: 0 3px 0 #16A34A;
}

.skin-preview {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #F1F5F9;
  border: 1.5px solid #CBD5E1;
  flex-shrink: 0;
}

.skin-info {
  flex: 1;
  text-align: left;
}

.skin-kicker {
  font-family: var(--font-label);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #16A34A;
}

.skin-name {
  font-size: 1rem;
  font-weight: 800;
  color: #0F172A;
}

.skin-desc {
  font-size: 0.78rem;
  color: #64748B;
  line-height: 1.3;
}

.skin-action {
  flex-shrink: 0;
}

/* How to Play Screen */
.how-card {
  background: #FFFFFF;
  border: 2px solid #0F172A;
  border-radius: 20px;
  box-shadow: 0 4px 0 #0F172A;
  padding: 1.25rem;
  max-width: 480px;
  width: 100%;
  margin-bottom: 1.25rem;
}

.how-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1rem 0;
  text-align: left;
}

.how-steps li {
  display: flex;
  gap: 0.75rem;
  font-size: var(--text-sm);
  color: #334155;
}

.how-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4ADE80;
  border: 1.5px solid #15803D;
  color: #052E16;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-family: var(--font-label);
}

/* Editorial & SEO Section Below Game */
.editorial {
  width: 100%;
  max-width: 640px;
  margin-top: 2rem;
  padding: 1.5rem 1rem;
  border-top: 1px solid #E2E8F0;
  color: #334155;
  text-align: left;
}

.editorial h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 0.5rem;
}

.editorial p {
  font-size: var(--text-sm);
  margin-bottom: 0.85rem;
  line-height: 1.6;
}

.editorial a {
  color: #0284C7;
  font-weight: 600;
  text-decoration: underline;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.faq-item {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 1rem;
}

.faq-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 0.35rem;
}

.faq-item p {
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 0;
}

/* Footer */
footer {
  width: 100%;
  max-width: 640px;
  text-align: center;
  padding: 1.5rem 1rem 3rem;
  font-size: var(--text-xs);
  color: #94A3B8;
  border-top: 1px solid #E2E8F0;
}

footer a {
  color: #64748B;
  text-decoration: none;
  margin: 0 0.4rem;
}

footer a:hover {
  text-decoration: underline;
}
