/* Direction A "Clubhouse tabs": shared kit for every screen.
   Tokens are the app's own (ui/theme.ts toy + E entry kit + gacha/look.ts).
   Evolutions from today's kit are marked EVOLVED. */

@font-face { font-family: Fredoka; font-weight: 500; src: url(assets/fonts/Fredoka_500Medium.ttf); }
@font-face { font-family: Fredoka; font-weight: 600; src: url(assets/fonts/Fredoka_600SemiBold.ttf); }
@font-face { font-family: Fredoka; font-weight: 700; src: url(assets/fonts/Fredoka_700Bold.ttf); }
@font-face { font-family: Lilita; font-weight: 400; src: url(assets/fonts/LilitaOne_400Regular.ttf); }

:root {
  /* toy kit */
  --wood: #d9965a; --wood-dark: #a86a3e; --wood-light: #f2c48a; --ink: #4a2a14;
  --gold: #ffd24a; --gold-dark: #d99a1e; --gold-edge: #b97d14; --coin-light: #ffe48a; --coin-edge: #a86a1e;
  --paper: #fff3dc; --cream: #fffaf0; --muted: #7a5a3e; --edge-soft: #c89466;
  --leaf: #4f9a3a; --leaf-edge: #3c7a2b; --leaf-tint: #e4f1d3; --leaf-ink: #33661f;
  --bad: #b8322f; --pink-dot: #e8456b; --you: #3b2a8a; --turn: #e0782e;
  /* EVOLVED: one dark "bark glass" for chrome that floats over the 3D field */
  --bark: rgba(52, 30, 14, 0.82); --bark-solid: #3a2212; --bark-line: rgba(255, 228, 170, 0.16);
  /* gacha tiers */
  --t-common: #cfc8b8; --t-rare: #4f8dff; --t-epic: #b25cff; --t-legendary: #ffb81a; --t-ultra: #ff5fa8;
  --t-common-l: #f4efe4; --t-rare-l: #cfe0ff; --t-epic-l: #ead4ff; --t-legendary-l: #ffecb8; --t-ultra-l: #ffd6ea;
  --g-ink: #24183f; --g-night: #120d2e; --g-dusk: #1c1450;
  /* category tabs */
  --c-grief: #cc5460; --c-chaos: #e0a830; --c-nice: #2ba040; --c-defense: #3b6fd0;
  --shadow-soft: 0 10px 18px -10px rgba(30, 16, 4, 0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { font-family: Fredoka, system-ui, sans-serif; font-weight: 600; color: var(--ink); background: #2a1a0e; -webkit-font-smoothing: antialiased; }
::selection { background: var(--gold); color: var(--ink); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; user-select: none; -webkit-user-drag: none; }
.ico { width: 24px; height: 24px; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.display { font-family: Lilita, Fredoka, sans-serif; font-weight: 400; letter-spacing: 0.01em; }
/* outlined display text, the game's StrokeText */
.stroke { font-family: Lilita, sans-serif; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 6px var(--ink); text-shadow: 0 3px 0 var(--ink); }

/* a screen fills its iframe exactly */
.screen { position: relative; width: 100vw; height: 100vh; overflow: hidden; }
.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- top bar (slim) ---------- */
.topbar { position: absolute; left: 0; right: 0; top: 0; height: 60px; display: flex; align-items: center; gap: 8px; padding: 8px 10px 0; z-index: 20;
  background: linear-gradient(180deg, rgba(30, 16, 6, 0.55), rgba(30, 16, 6, 0)); }
.topbar .spacer { flex: 1; }
.avatar { position: relative; width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--leaf) calc(var(--xp, 0.6) * 1turn), rgba(255, 255, 255, 0.28) 0); padding: 4px; box-shadow: 0 2px 0 rgba(0,0,0,0.25); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.avatar .lvl { position: absolute; right: -4px; bottom: -3px; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--leaf-edge); color: #fff; border: 2px solid var(--ink);
  font-size: 12px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.avatar .dot { position: absolute; top: -1px; right: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--pink-dot); border: 2px solid #fff; }
.who { display: flex; flex-direction: column; line-height: 1.05; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.who b { font-size: 15px; font-weight: 700; }
.who span { font-size: 12px; font-weight: 600; opacity: 0.92; display: flex; align-items: center; gap: 4px; }
.pill { height: 36px; border-radius: 18px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px 0 5px; background: var(--bark); color: #fff; font-weight: 700; font-size: 15px;
  border: 1.5px solid var(--bark-line); box-shadow: 0 2px 0 rgba(0,0,0,0.25); }
.pill .ico { width: 26px; height: 26px; }
.pill .plus { width: 22px; height: 22px; border-radius: 7px; background: var(--leaf); display: grid; place-items: center; margin-left: 2px; border: 1.5px solid var(--leaf-edge); }
.pill .plus .ico { width: 14px; height: 14px; color: #fff; }
.iconbtn { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--bark); color: #fff; border: 1.5px solid var(--bark-line); box-shadow: 0 2px 0 rgba(0,0,0,0.25); flex: none; }
.iconbtn .ico { width: 24px; height: 24px; }

/* ---------- bottom tab bar (Clash-style, wooden shelf) ---------- */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; z-index: 20; display: flex; align-items: flex-end; padding: 0 6px 8px; gap: 4px;
  background: linear-gradient(180deg, #8a5530 0, #6e4022 100%); border-top: 3px solid #b77a48; box-shadow: 0 -6px 16px rgba(20, 10, 2, 0.35); }
.tabbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: rgba(255, 220, 170, 0.35); }
.tab { flex: 1; height: 56px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #f6dcb8; font-size: 12px; font-weight: 700; position: relative; }
.tab .ico { width: 30px; height: 30px; }
.tab.on { background: linear-gradient(180deg, #fff3dc, #f2dcb4); color: var(--ink); box-shadow: 0 3px 0 #b8875a, inset 0 2px 0 #fff; }
.tab .badge { position: absolute; top: 6px; right: calc(50% - 22px); min-width: 18px; height: 18px; border-radius: 9px; background: #c92f52; color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #6e4022; }
/* the big central Play tab sits proud of the shelf */
.tab.play { flex: 1.35; height: 78px; margin-top: -22px; border-radius: 20px; background: linear-gradient(180deg, #ffe48a, #ffc93a 55%, #f0a91e); color: var(--ink);
  border: 3px solid var(--gold-edge); box-shadow: 0 5px 0 #9a6410, inset 0 3px 0 rgba(255,255,255,0.7); }
.tab.play .ico { width: 38px; height: 38px; }
.tab.play span { font-family: Lilita, sans-serif; font-size: 17px; font-weight: 400; letter-spacing: 0.02em; }
.tab.play.off { filter: saturate(0.6) brightness(0.92); }
.swipe-dots { position: absolute; left: 50%; transform: translateX(-50%); bottom: 76px; display: flex; gap: 5px; z-index: 19; }
.swipe-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.45); }
.swipe-dots i.on { width: 16px; background: #fff; }

/* ---------- buttons ---------- */
.btn { height: 48px; border-radius: 14px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 16px;
  background: linear-gradient(180deg, var(--cream), var(--paper)); border: 2.5px solid var(--wood-dark); box-shadow: 0 4px 0 var(--wood-dark), inset 0 2px 0 #fff; color: var(--ink); }
.btn.gold { background: linear-gradient(180deg, #ffe48a, #ffcf3f 60%, #f6b62a); border-color: var(--gold-edge); box-shadow: 0 4px 0 #9a6410, inset 0 2px 0 rgba(255,255,255,0.75); }
.btn.leaf { background: linear-gradient(180deg, #7cc95e, #5aa83f); border-color: var(--leaf-edge); color: #fff; box-shadow: 0 4px 0 #2f6420, inset 0 2px 0 rgba(255,255,255,0.4); text-shadow: 0 1px 0 rgba(0,0,0,0.25); }
.btn.dark { background: var(--bark); border-color: rgba(255,228,170,0.25); color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,0.35); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--wood-dark); }
.btn-play { width: 100%; height: 68px; border-radius: 20px; font-family: Lilita, sans-serif; font-weight: 400; font-size: 32px; letter-spacing: 0.02em; color: var(--ink);
  background: linear-gradient(180deg, #ffe48a, #ffcf3f 55%, #f4ad22); border: 3px solid var(--gold-edge); box-shadow: 0 6px 0 #9a6410, 0 14px 24px -8px rgba(60, 30, 0, 0.6), inset 0 3px 0 rgba(255,255,255,0.75);
  display: flex; align-items: center; justify-content: center; gap: 10px; position: relative; overflow: hidden; }
.btn-play::after { content: ""; position: absolute; top: 0; bottom: 0; width: 60px; left: -80px; background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent); animation: sheen 3.6s ease-in-out infinite; }
@keyframes sheen { 0%, 60% { left: -80px; } 100% { left: 110%; } }

/* ---------- chips ---------- */
.chip { height: 38px; border-radius: 12px; padding: 0 12px 0 6px; display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--ink);
  background: rgba(255, 243, 220, 0.94); border: 2px solid var(--wood-dark); box-shadow: 0 3px 0 var(--wood-dark); white-space: nowrap; }
.chip img.thumb { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; border: 1.5px solid var(--wood-dark); }
.chip img.face { width: 28px; height: 28px; border-radius: 50%; }
.chip small { font-size: 11px; color: var(--muted); font-weight: 600; display: block; line-height: 1; }
.chip .stack { display: flex; flex-direction: column; line-height: 1.05; }
.chip.on { background: var(--gold); border-color: var(--gold-edge); box-shadow: 0 3px 0 #9a6410; }
.chip .ico { width: 18px; height: 18px; }

/* ---------- board / panel ---------- */
.board { background: var(--paper); border: 3px solid var(--wood-dark); border-radius: 18px; box-shadow: 0 5px 0 var(--wood-dark), var(--shadow-soft); }
.key { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 5px; font-size: 11px; font-weight: 700; color: var(--ink); background: #fff; border: 1.5px solid var(--wood-dark); box-shadow: 0 2px 0 var(--wood-dark); line-height: 1; }
.key.dark { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.35); box-shadow: 0 2px 0 rgba(0,0,0,0.35); }

/* ---------- tiers ---------- */
.tier-common { --t: var(--t-common); --tl: var(--t-common-l); }
.tier-rare { --t: var(--t-rare); --tl: var(--t-rare-l); }
.tier-epic { --t: var(--t-epic); --tl: var(--t-epic-l); }
.tier-legendary { --t: var(--t-legendary); --tl: var(--t-legendary-l); }
.tier-ultra { --t: var(--t-ultra); --tl: var(--t-ultra-l); }
.stars { display: inline-flex; gap: 1px; }
.stars .ico { width: 12px; height: 12px; color: var(--gold); }

/* desktop: wider tab shelf, key caps instead of swipe dots */
.desk .tabbar { left: 50%; right: auto; width: 640px; transform: translateX(-50%); bottom: 14px; border-radius: 22px; border: 3px solid #b77a48; height: 76px; padding: 0 8px 7px; }
.desk .tab { font-size: 13px; }
.desk .tabkeys { position: absolute; bottom: 38px; z-index: 21; }
