/* ==========================================================================
   FS WOOD PEEL - STYLE SHEET
   Organic Luxury Dark Aesthetic & Craft Studio UI
   Zero CSS Overrides for Shared Modal Classes (Directive 8 Compliant)
   ========================================================================== */

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;

  --bg-dark: #080706;
  --bg-gradient: radial-gradient(circle at 50% 20%, #1a1511 0%, #0d0b09 60%, #050403 100%);
  --bg-card: rgba(24, 20, 16, 0.76);
  --bg-card-border: rgba(220, 180, 130, 0.22);

  --text-main: #f5efe6;
  --text-muted: #a89f91;

  --wood-amber: #e69a58;
  --wood-gold: #ffd700;
  --wood-leaf: #00e5a3;
  --wood-rose: #f2b5a5;

  --shadow-color: rgba(0, 0, 0, 0.65);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Studio Light */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.16;
  animation: floatOrb 20s ease-in-out infinite alternate;
}

.glow-1 {
  width: 440px;
  height: 440px;
  background: #d4a373;
  top: -80px;
  left: 20%;
}

.glow-2 {
  width: 380px;
  height: 380px;
  background: #a86b3c;
  bottom: 8%;
  right: 15%;
  animation-delay: -8s;
}

.glow-3 {
  width: 300px;
  height: 300px;
  background: #ffb703;
  top: 50%;
  left: 10%;
  animation-delay: -12s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 40px) scale(1.12); }
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 8px 12px 14px;
  z-index: 1;
  gap: 8px;
}

/* Header & Nav */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

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

.glass-btn {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
  text-decoration: none;
}

.glass-btn:hover {
  background: rgba(220, 180, 130, 0.16);
  border-color: var(--wood-amber);
  box-shadow: 0 0 12px rgba(230, 154, 88, 0.3);
}

.title-group h1 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ffffff 40%, var(--wood-amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  padding: 6px 8px;
  font-size: 0.95rem;
  min-width: 36px;
  justify-content: center;
}

.donate-btn {
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.35);
  font-weight: 600;
  font-size: 0.8rem;
}

.donate-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

/* Stats HUD Banner */
.stats-banner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 6px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 12px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stat-label {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stat-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-card.highlight .stat-val {
  color: var(--wood-amber);
  text-shadow: 0 0 12px rgba(230, 154, 88, 0.35);
}

.stat-card.streak-card .stat-val {
  color: var(--wood-gold);
}

/* Wood Species Selector Chips Bar */
.wood-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}
.wood-bar::-webkit-scrollbar {
  display: none;
}

.wood-chip {
  background: rgba(28, 22, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: 16px;
  font-size: 0.76rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.wood-chip:hover {
  background: rgba(220, 180, 130, 0.15);
  border-color: var(--wood-amber);
  color: #fff;
}

.wood-chip.active {
  background: rgba(230, 154, 88, 0.2);
  border-color: var(--wood-amber);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(230, 154, 88, 0.3);
}

/* Progress & Ribbon Length Meters */
.meters-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.meter-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
}

.meter-label {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
}

.meter-text {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--wood-amber);
  font-variant-numeric: tabular-nums;
}

.meter-track {
  width: 100%;
  height: 10px;
  background: rgba(14, 10, 8, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b86e33, var(--wood-amber));
  border-radius: 8px;
  transition: width 0.05s linear;
  box-shadow: 0 0 8px rgba(230, 154, 88, 0.5);
}

.ribbon-track .meter-fill {
  background: linear-gradient(90deg, #e69a58, #ffd700);
}

/* Arena & Wood Canvas Container */
.arena-container {
  flex: 1;
  position: relative;
  background: rgba(14, 11, 8, 0.92);
  border: 1px solid var(--bg-card-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), inset 0 0 24px rgba(220, 180, 130, 0.04);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

/* Overlays (Result / Pause) */
.canvas-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 4, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  padding: 16px;
  transition: opacity 0.25s ease;
}

.canvas-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-card {
  background: rgba(22, 17, 13, 0.96);
  border: 1px solid var(--bg-card-border);
  border-radius: 20px;
  padding: 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: popCard 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popCard {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.result-badge {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  padding: 6px 18px;
  border-radius: 16px;
  letter-spacing: 0.5px;
}

.primary-btn {
  background: linear-gradient(135deg, #e69a58 0%, #ffd700 100%);
  color: #0c0804;
  border: none;
  border-radius: 14px;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(230, 154, 88, 0.35);
  transition: all 0.2s ease;
  width: 100%;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 215, 0, 0.5);
}

/* Footer Hint */
.peel-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0;
}

.peel-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}
