/* Simos Camp — base theme tokens & shared UI primitives (owned by core; feature CSS files build on these).
 * Beach theme: sand beige, turquoise, white, warm wood. Rounded, playful, chunky.
 */
:root {
  --sand: #f6e7c6; --sand-light: #fcf5e3; --sand-dark: #e3cc9c; --sand-deep: #cdb07a;
  --turq: #2ec4c6; --turq-light: #86e6dc; --turq-dark: #1d8fa3; --sea: #2596c2; --deep: #1c6a9c;
  --white: #fffdf7; --paper: #fffaf0;
  --ink: #4a3b33; --ink-soft: #7a6558; --ink-faint: #a8958a;
  --wood: #c98f5a; --wood-light: #e2b27e; --wood-dark: #9b6a40; --wood-deep: #7a5132;
  --green: #43c46b; --green-dark: #2f9a50; --red: #ff5a5a; --red-dark: #d63d3d;
  --pink: #ff7fa8; --heart: #ff5c8a; --yellow: #ffd75e; --orange: #ff9f43; --blue: #2f6fb5; --purple: #a58bff;
  --panel-bg: var(--sand-light); --panel-border: var(--wood); --panel-shadow: 0 6px 0 rgba(122, 81, 50, .35), 0 14px 30px rgba(30, 50, 64, .28);
  --radius: 18px; --radius-sm: 12px; --radius-lg: 26px;
  --font: 'Fredoka', 'Baloo 2', 'Nunito', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease-soft: cubic-bezier(.45, .05, .35, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --wood-grain: repeating-linear-gradient(95deg, rgba(255,255,255,.07) 0 3px, rgba(0,0,0,.035) 3px 7px, rgba(255,255,255,0) 7px 13px);
  color-scheme: light;
}
/* dark devices: panels get a warm "night at camp" look; the world keeps its own day/night art */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --panel-bg: #3b2f28; --paper: #45372f; --sand-light: #4a3b32; --sand: #574538; --sand-dark: #6b5646;
    --ink: #fbefe0; --ink-soft: #e0cbb6; --ink-faint: #b39c88; --white: #fff7ea;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --panel-bg: #3b2f28; --paper: #45372f; --sand-light: #4a3b32; --sand: #574538; --sand-dark: #6b5646;
  --ink: #fbefe0; --ink-soft: #e0cbb6; --ink-faint: #b39c88; --white: #fff7ea;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #2596c2;
  font-family: var(--font); color: var(--ink); font-size: 16px;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  touch-action: none; overscroll-behavior: none; -webkit-font-smoothing: antialiased;
}
#game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#game-canvas:active { cursor: grabbing; }
#ui-root { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui-root > div { position: absolute; inset: 0; pointer-events: none; }
#hud-top { z-index: 20; } #hud-bottom { z-index: 20; } #panel-layer { z-index: 30; } #wheel-layer { z-index: 40; }
#toast-layer { z-index: 60; } #modal-layer { z-index: 70; } #fullscreen-layer { z-index: 50; } #fade-layer { z-index: 90; }
#ui-root .interactive, #ui-root button, #ui-root input, #ui-root textarea, #ui-root select, #ui-root a { pointer-events: auto; }
input, textarea, select { -webkit-user-select: text; user-select: text; font-family: var(--font); }
#test-report { position: fixed; left: 0; top: 0; z-index: 100000; max-height: 50vh; overflow: auto; background: #fff; color: #000; font: 10px monospace; }

/* ---------- boot screen ---------- */
#boot-screen {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: linear-gradient(180deg, #86e6dc 0%, #2ec4c6 45%, #2596c2 100%); transition: opacity .6s var(--ease-soft);
}
#boot-screen.hide { opacity: 0; pointer-events: none; }
.boot-card { text-align: center; color: #fff; text-shadow: 0 3px 0 rgba(28, 106, 156, .5); }
.boot-card h1 { font-size: 44px; margin: 10px 0 4px; letter-spacing: .5px; }
.boot-card p { margin: 0; font-size: 17px; opacity: .92; }
.boot-sun { width: 74px; height: 74px; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #fff3c4, #ffd75e 60%, #ff9f43);
  box-shadow: 0 0 0 10px rgba(255, 215, 94, .25), 0 0 40px rgba(255, 215, 94, .7); animation: sc-bob 2.4s ease-in-out infinite; }
@keyframes sc-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- shared primitives (use these in every UI module) ---------- */
.sc-btn {
  pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 3px solid var(--wood-dark);
  background: var(--wood-grain), linear-gradient(180deg, var(--wood-light), var(--wood));
  color: #fff; font: 600 16px/1.1 var(--font); text-shadow: 0 2px 0 rgba(122, 81, 50, .55);
  box-shadow: 0 4px 0 var(--wood-deep); cursor: pointer; transition: transform .12s var(--ease-spring), box-shadow .12s, filter .15s;
}
.sc-btn:hover { filter: brightness(1.05); }
.sc-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--wood-deep); }
.sc-btn:disabled, .sc-btn.disabled { filter: grayscale(.6) opacity(.6); pointer-events: none; }
.sc-btn.turq { border-color: var(--turq-dark); background: linear-gradient(180deg, #5fdad8, var(--turq)); box-shadow: 0 4px 0 #157186; text-shadow: 0 2px 0 rgba(21, 113, 134, .6); }
.sc-btn.green { border-color: var(--green-dark); background: linear-gradient(180deg, #6fdc8e, var(--green)); box-shadow: 0 4px 0 #237a3e; text-shadow: 0 2px 0 rgba(35, 122, 62, .6); }
.sc-btn.red { border-color: var(--red-dark); background: linear-gradient(180deg, #ff8a8a, var(--red)); box-shadow: 0 4px 0 #a82b2b; text-shadow: 0 2px 0 rgba(168, 43, 43, .6); }
.sc-btn.pink { border-color: #d9487a; background: linear-gradient(180deg, #ffa3c2, var(--pink)); box-shadow: 0 4px 0 #b3335f; text-shadow: 0 2px 0 rgba(179, 51, 95, .6); }
.sc-btn.white { border-color: #cdb07a; background: linear-gradient(180deg, #fff, #fcf5e3); color: #4a3b33; text-shadow: none; box-shadow: 0 4px 0 #cdb07a; }
.sc-btn.small { min-height: 34px; padding: 4px 12px; font-size: 14px; border-width: 2px; }
.sc-btn.round { width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 50%; font-size: 22px; }

.sc-panel {
  pointer-events: auto; background: var(--panel-bg); color: var(--ink);
  border: 4px solid var(--panel-border); border-radius: var(--radius-lg); box-shadow: var(--panel-shadow);
}
.sc-card { background: var(--paper); border-radius: var(--radius); border: 2px solid var(--sand-dark); padding: 10px 12px; }
.sc-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--sand); color: var(--ink); border: 2px solid var(--sand-dark);
}
.sc-chip.on { background: var(--turq); color: #fff; border-color: var(--turq-dark); }
.sc-chip.green { background: #dff6e6; border-color: var(--green); color: #226b3a; }
.sc-chip.red { background: #ffe1e1; border-color: var(--red); color: #9b2424; }
.sc-chip.pink { background: #ffe3ee; border-color: var(--pink); color: #a42c58; }
.sc-title { font-weight: 700; font-size: 22px; margin: 0; }
.sc-sub { color: var(--ink-soft); font-size: 14px; }
.sc-input {
  width: 100%; min-height: 44px; padding: 8px 14px; border-radius: 14px; border: 3px solid var(--sand-dark);
  background: var(--paper); color: var(--ink); font: 500 16px var(--font); outline: none;
}
.sc-input:focus { border-color: var(--turq); }
.sc-toggle { position: relative; width: 50px; height: 28px; border-radius: 999px; background: var(--sand-dark); border: 0; cursor: pointer; pointer-events: auto; transition: background .2s; flex: none; }
.sc-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.15); transition: transform .2s var(--ease-spring); }
.sc-toggle.on { background: var(--turq); }
.sc-toggle.on::after { transform: translateX(22px); }
.sc-meter { height: 12px; border-radius: 999px; background: rgba(0,0,0,.12); overflow: hidden; }
.sc-meter > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--turq), var(--green)); transition: width .4s var(--ease-soft); }
.sc-face { width: 40px; height: 40px; border-radius: 50%; background: var(--turq-light); border: 2px solid #fff; box-shadow: 0 2px 0 rgba(0,0,0,.12); overflow: hidden; flex: none; }
.sc-face canvas { width: 100%; height: 100%; display: block; }
.sc-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }
.sc-row { display: flex; align-items: center; gap: 10px; }
.sc-col { display: flex; flex-direction: column; gap: 10px; }
.sc-grow { flex: 1 1 auto; min-width: 0; }
.sc-hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
