@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&display=swap');

/* Piled — front end rebuilt to match the approved prototype (theme.css):
   warm cream / deep green / game red / sun yellow, Baloo 2 game type. */
:root {
  color-scheme: light dark;
  --bg: #efe9d8;
  --surface: #fbf8ef;
  --surface-2: #f1ead6;
  --text: #1c2420;
  --dim: #5f6a62;
  --border: #d9d0b8;
  --accent: #0e3b2e;
  --red: #e63946;
  --sun: #ffc53d;
  --green: #2fa84f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101613;
    --surface: #1b211d;
    --surface-2: #232a25;
    --text: #f0ecdc;
    --dim: #a3ada1;
    --border: #333b34;
    --accent: #2e7d5f;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.font-game { font-family: "Baloo 2", system-ui, sans-serif; }
.hidden { display: none !important; }
button, input { font: inherit; }
button { min-height: 2.25rem; }
a { color: var(--accent); }
img { -webkit-user-drag: none; }

.wrap { max-width: 36rem; margin: 0 auto; padding: 0.5rem 0.75rem 7rem; }
.view { display: flex; flex-direction: column; gap: 0.75rem; }
.view-title { font-size: 1.5rem; font-weight: 700; margin: 0.25rem 0 0; }
.sub-note { margin-top: -0.5rem; }
.mt { margin-top: 1rem; }
.mt-sm { margin-top: 0.5rem; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.start { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.gap-sm { gap: 0.5rem; }
.grow { flex: 1; }
.shrink { flex: none; }
.min0 { min-width: 0; flex: 1; }
.dim { color: var(--dim); }
.dim-sm { color: var(--dim); font-size: 0.875rem; }
.dim-xs { color: var(--dim); font-size: 0.75rem; }
.normal { font-weight: 400; }
.bold-sm { font-weight: 700; font-size: 0.875rem; }
.error { color: var(--red); font-size: 0.875rem; font-weight: 600; min-height: 1em; margin: 0.25rem 0 0; }
.ok-msg { color: #1e7a3c; font-size: 0.875rem; font-weight: 600; margin: 0.25rem 0 0; min-height: 1em; }
@media (prefers-color-scheme: dark) { .ok-msg { color: #6fd598; } }
.stack-col { display: flex; flex-direction: column; gap: 0.5rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"] {
  width: 100%; border: 1px solid var(--border); border-radius: 0.75rem;
  background: var(--surface); color: var(--text);
  padding: 0.5rem 0.75rem; font-size: 1rem;
}

/* ---------- account lifecycle (auth extras, verify banner, deletion) ---------- */
.auth-birthdate { display: grid; gap: 0.3rem; font-size: 0.82rem; color: var(--dim); font-weight: 600; text-align: left; }
.linklike {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-weight: 700; font-size: 0.9rem; padding: 0.25rem; min-height: 0;
  text-decoration: underline;
}
.verify-banner {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  max-width: 680px; margin: 0.75rem auto 0; padding: 0.6rem 0.9rem;
  background: #fdf3d8; color: #5c4a12; border: 1px solid #e4cf8a; border-radius: 1rem;
  font-size: 0.9rem; font-weight: 600;
}
@media (prefers-color-scheme: dark) { .verify-banner { background: #3a3112; color: #f0dfa0; border-color: #6b5c22; } }
.verify-msg { font-size: 0.8rem; }
.danger-zone { margin-top: 1.1rem; border-top: 1px solid var(--border); padding-top: 0.9rem; display: grid; gap: 0.5rem; }
.btn-danger {
  background: #b3372c; color: #fff; border: none; cursor: pointer;
  border-radius: 0.75rem; padding: 0.5rem 1rem; font-weight: 700;
}

/* ---------- buttons ---------- */
.btn-accent {
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  border-radius: 0.75rem; padding: 0.5rem 1rem; font-weight: 700;
}
.btn-accent.big { width: 100%; padding: 0.75rem 1rem; font-size: 1.05rem; border-radius: 1rem; }
.btn-red {
  background: var(--red); color: #fff; border: none; cursor: pointer;
  border-radius: 0.75rem; padding: 0.5rem 1rem; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.btn-red:disabled { opacity: 0.4; }
.btn-red.big-throw {
  width: 100%; border-radius: 1rem; padding: 0.75rem 1rem;
  font-size: 1.25rem; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.btn-outline {
  background: var(--surface); color: var(--text); cursor: pointer;
  border: 1px solid var(--border); border-radius: 0.75rem; padding: 0.5rem 1rem; font-weight: 700;
}
.btn-pill-outline {
  background: var(--surface); color: var(--text); cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.75rem;
  font-size: 0.875rem; font-weight: 700; min-height: 2rem;
}

/* ---------- cards ---------- */
.card {
  background: var(--surface); border-radius: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.card.pad { padding: 1rem; }
.card-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.25rem; }
.card-title-sm { font-size: 1.125rem; font-weight: 700; margin: 0 0 0.5rem; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card {
  background: var(--surface); border-radius: 1.5rem; padding: 2rem;
  max-width: 380px; width: 100%; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}
.logo { font-size: 2.4rem; font-weight: 800; }
.tagline { color: var(--dim); }
.auth-tabs { display: flex; gap: 0.5rem; justify-content: center; margin: 1rem 0; }
.tab {
  background: var(--surface); border: 2px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 0.4rem 1.1rem; cursor: pointer; font-weight: 700;
  font-family: "Baloo 2", system-ui, sans-serif;
}
.tab.active { background: var(--red); border-color: var(--red); color: #fff; }
#authForm { display: flex; flex-direction: column; gap: 0.6rem; text-align: left; }
.fineprint { color: var(--dim); font-size: 0.82rem; }

/* ---------- avatars / faces ---------- */
.avatar-img {
  border-radius: 50%; object-fit: cover; flex: none;
  border: 2px solid rgba(255,255,255,0.7);
}
.avatar-initials {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 50%; color: #fff; font-weight: 700;
  font-family: "Baloo 2", system-ui, sans-serif;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  border: 2px solid rgba(255,255,255,0.7);
}
.face-btn {
  position: relative; display: inline-block; flex: none; line-height: 0;
  background: none; border: none; padding: 0; cursor: pointer; border-radius: 50%;
  min-height: 0;
}
.face-btn:disabled { opacity: 0.6; }
.face-badge {
  position: absolute; right: -4px; bottom: -4px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #fff; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; font-weight: 700; line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  font-family: "Baloo 2", system-ui, sans-serif;
}
.face-badge.plus { background: var(--red); }
.face-badge.check { background: var(--green); }
.face-static { position: relative; display: inline-block; flex: none; line-height: 0; }

/* ---------- wild badge ---------- */
.wild-badge {
  display: inline-flex; align-items: center; gap: 0.25rem; flex: none;
  background: var(--sun); color: #3a2c00;
  border-radius: 999px; padding: 0.25rem 0.75rem;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 0.875rem; font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

/* ---------- pile switcher ---------- */
.switcher-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.switcher-head h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.chips { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; }
.chip {
  flex: none; white-space: nowrap; cursor: pointer;
  border-radius: 999px; padding: 0.5rem 0.875rem;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 0.875rem; font-weight: 700;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.chip.active { background: var(--red); border-color: var(--red); color: #fff; }
.chip .count { margin-left: 0.375rem; font-size: 0.75rem; font-weight: 600; opacity: 0.8; }
.chip.make { border-style: dashed; border-color: var(--accent); }
.new-pile-form { padding: 0.75rem; }
.new-pile-form input { flex: 1; min-width: 0; }

/* ---------- the slim translucent me-strip ---------- */
.me-strip {
  position: relative; overflow: hidden; border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 8px 20px rgba(0,0,0,0.22);
  background: rgba(10,14,12,0.38);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.me-banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.45; }
.me-banner-color { position: absolute; inset: 0; opacity: 0.5; }
.me-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.05) 70%, transparent);
}
.me-row { position: relative; display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.75rem; color: #fff; }
.me-meta { min-width: 0; flex: 1; line-height: 1.25; }
.me-name { display: block; font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.me-sub { display: block; font-size: 0.6875rem; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- the rim + flip card ---------- */
.rim {
  border-radius: 26px; padding: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
  transition: background 0.4s ease;
}
.rim-thinking { position: relative; overflow: hidden; isolation: isolate; }
.rim-thinking::before {
  content: ""; position: absolute; inset: -60%; z-index: -1;
  background: conic-gradient(#e63946, #f4842b, #ffc53d, #2fa84f, #2b7de9, #7b4fe0, #ef6fb0, #e63946);
  animation: rim-spin 1.1s linear infinite;
}
@keyframes rim-spin { to { transform: rotate(360deg); } }
.flip-scene { perspective: 1200px; }
.flip-inner { transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1); position: relative; }
.flip-inner.flipped { transform: rotateY(180deg); }
.flip-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-back {
  position: absolute; inset: 0; transform: rotateY(180deg);
  background: var(--surface); border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column;
}
.photo-btn { display: block; width: 100%; padding: 0; border: none; background: none; cursor: pointer; min-height: 0; }
.hero-img { display: block; width: 100%; aspect-ratio: 3/4; max-height: 68vh; object-fit: cover; border-radius: 20px; }
.inspect-img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 20px; }
.card-label-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.375rem 0.25rem 0.125rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.card-label-row.on-light { color: #26221f; }
.card-label-row.on-dark { color: #fff; }
.label-subject { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label-hint { flex: none; font-size: 0.75rem; font-weight: 600; opacity: 0.9; }
@keyframes pop-in { from { transform: scale(0.94); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
.pop-in { animation: pop-in 0.35s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .flip-inner { transition: none; }
  .pop-in { animation: none; }
  .rim-thinking::before { animation: none; }
}

/* ---------- card back ---------- */
.back-band { padding: 0.75rem 1rem; background: var(--surface-2); }
.back-band.starter { background: #7a4a21; color: #fff; }
.back-band-row { display: flex; align-items: center; gap: 0.75rem; }
.back-who { min-width: 0; }
.back-name { font-size: 1.125rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-handle { font-size: 0.875rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-band.starter .back-handle { color: rgba(255,255,255,0.85); }
.back-face-hint { font-size: 0.75rem; font-weight: 600; color: var(--red); }
.back-band.starter .back-face-hint { color: #ffd9a8; }
.back-body { flex: 1; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.back-threw { font-size: 0.875rem; margin: 0; }
.caption-line { font-style: italic; margin: 0; font-size: 0.875rem; }
.wild-note { color: #b97f06; font-size: 0.85rem; font-weight: 700; margin: 0; }
@media (prefers-color-scheme: dark) { .wild-note { color: var(--sun); } }
.stat-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.stat-tile { background: var(--surface-2); border-radius: 1rem; padding: 0.75rem 0.5rem; text-align: center; }
.stat-tile .n { font-family: "Baloo 2", system-ui, sans-serif; font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-tile .l { margin-top: 0.25rem; font-size: 0.75rem; font-weight: 600; color: var(--dim); }
section > .stat-grid-3 .stat-tile, #profileStats .stat-tile {
  background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#profileStats .stat-tile .n { font-size: 1.875rem; }
.follow-big {
  width: 100%; border: none; cursor: pointer; color: #fff;
  border-radius: 1rem; padding: 0.875rem 1rem;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1.125rem; font-weight: 700;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  background: var(--red);
}
.follow-big.friends { background: var(--green); }
.follow-big:disabled { opacity: 0.6; }
.follow-caption { margin: -0.375rem 0 0; text-align: center; font-size: 0.75rem; color: var(--dim); }
.back-note-box { background: var(--surface-2); border-radius: 0.75rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; margin: 0; }
.like-row { display: flex; gap: 0.5rem; }
.like-btn2 {
  flex: 1; cursor: pointer; border-radius: 0.75rem; padding: 0.5rem;
  font-family: "Baloo 2", system-ui, sans-serif; font-size: 0.875rem; font-weight: 700;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.like-btn2.liked { background: var(--red); color: #fff; border-color: var(--red); }
.like-btn2:disabled { opacity: 0.5; }
.back-foot-links { margin-top: auto; display: flex; gap: 0.5rem; padding-top: 0.25rem; }
.link-btn {
  flex: 1; background: none; border: none; cursor: pointer; min-height: 2rem;
  font-size: 0.75rem; font-weight: 600; color: var(--dim); text-decoration: underline; padding: 0.375rem;
}
.flip-back-btn {
  width: 100%; cursor: pointer; border-radius: 0.75rem; padding: 0.5rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: "Baloo 2", system-ui, sans-serif; font-weight: 700;
}

/* ---------- comments ---------- */
.comments-box { background: var(--surface); border-radius: 1rem; padding: 0.75rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.back-body .comments-box { box-shadow: none; padding: 0; }
.friend-row {
  display: flex; align-items: center; gap: 0.625rem;
  background: var(--surface-2); border-radius: 0.75rem;
  padding: 0.5rem 0.625rem; margin-bottom: 0.75rem;
}
.friend-row .fr-meta { min-width: 0; flex: 1; line-height: 1.25; }
.friend-row .fr-name { display: block; font-size: 0.875rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-row .fr-hint { display: block; font-size: 0.75rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-row .fr-btn {
  flex: none; border: none; cursor: pointer; color: #fff;
  border-radius: 0.75rem; padding: 0.5rem 0.875rem;
  font-family: "Baloo 2", system-ui, sans-serif; font-size: 0.875rem; font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15); background: var(--red);
}
.friend-row .fr-btn.friends { background: var(--green); }
.friend-row .fr-btn:disabled { opacity: 0.6; }
.comments-title { font-size: 1rem; font-weight: 700; margin: 0 0 0.25rem; }
.comment-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.comment-item { display: flex; gap: 0.625rem; }
.comment-bubble { min-width: 0; flex: 1; background: var(--surface-2); border-radius: 0.75rem; padding: 0.5rem 0.75rem; }
.comment-head { font-size: 0.75rem; font-weight: 700; margin: 0; }
.comment-head .ctime { font-weight: 400; color: var(--dim); }
.comment-body { font-size: 0.875rem; margin: 0; overflow-wrap: break-word; }
.comment-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.comment-form input { flex: 1; min-width: 0; }
.comment-post {
  flex: none; border: none; cursor: pointer;
  background: var(--accent); color: #fff; border-radius: 0.75rem; padding: 0.5rem 1rem;
  font-family: "Baloo 2", system-ui, sans-serif; font-weight: 700;
}
.comment-post:disabled { opacity: 0.4; }

/* ---------- action bar under the photo ---------- */
.action-bar {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface); border-radius: 1rem;
  padding: 0.5rem 0.75rem; margin-top: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.action-bar .ab-text { min-width: 0; flex: 1; font-size: 0.75rem; line-height: 1.3; color: var(--dim); }
.ab-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  border: none; cursor: pointer; border-radius: 0.75rem; padding: 0.375rem 0.75rem;
  background: var(--surface-2); color: var(--text);
  font-family: "Baloo 2", system-ui, sans-serif; font-size: 0.875rem; font-weight: 700;
}
.ab-btn .ab-icon { font-size: 1.125rem; line-height: 1; }
.ab-btn .ab-count { font-size: 0.6875rem; }
.ab-btn.liked { background: var(--red); color: #fff; }
.ab-btn.open { background: var(--accent); color: #fff; }
.ab-btn:disabled { opacity: 0.5; }

/* ---------- call row / empty pile ---------- */
.call-row { display: flex; align-items: center; gap: 0.5rem; }
.call-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid rgba(0,0,0,0.1); }
.call-text { min-width: 0; flex: 1; font-size: 0.875rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-pile {
  border: 2px dashed var(--border); background: var(--surface);
  border-radius: 26px; padding: 2.5rem 1.25rem; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.empty-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.empty-text { max-width: 24rem; margin: 0.5rem auto 0; }

/* ---------- inspect + history ---------- */
.inspect { background: var(--surface-2); border-radius: 1.5rem; padding: 0.75rem; }
.inspect-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.inspect-head h3 { font-size: 1.125rem; font-weight: 700; margin: 0; }
.history-title { font-size: 1rem; font-weight: 700; margin: 0 0 0.375rem; }
.history-help { margin: 0 0 0.5rem; }
.history-scroll { max-height: 26rem; overflow-y: auto; padding-right: 2px; }
.chain-row { background: var(--surface); border-radius: 1rem; padding: 0.625rem 0.75rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 0.5rem; }
.chain-main { display: flex; align-items: center; gap: 0.625rem; }
.chain-open { display: flex; align-items: center; gap: 0.625rem; min-width: 0; flex: 1; background: none; border: none; cursor: pointer; text-align: left; padding: 0; color: var(--text); }
.chain-thumb { width: 56px; height: 48px; flex: none; border-radius: 0.5rem; object-fit: cover; }
.chain-meta { min-width: 0; flex: 1; }
.chain-subject { display: block; font-size: 0.875rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chain-sub { display: block; font-size: 0.75rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-btn {
  flex: none; border: none; cursor: pointer; border-radius: 999px; padding: 0.375rem 0.625rem;
  background: var(--surface-2); color: var(--text);
  font-family: "Baloo 2", system-ui, sans-serif; font-size: 0.875rem; font-weight: 700;
}
.pill-btn.liked { background: var(--red); color: #fff; }
.pill-btn.open { background: var(--accent); color: #fff; }
.pill-btn:disabled { opacity: 0.5; }
.chain-comments { margin-top: 0.625rem; }

/* ---------- throw screen ---------- */
.throwing-on { border-radius: 1rem; padding: 0.625rem 1rem; }
.over-label { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--dim); }
.throwing-name { margin: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.25; }
.top-context { border-radius: 1rem; padding: 0.75rem 1rem; display: flex; align-items: center; gap: 0.75rem; }
.top-context img { width: 56px; height: 48px; flex: none; border-radius: 0.5rem; object-fit: cover; }
.top-context p { margin: 0; font-size: 0.875rem; line-height: 1.4; }
.thrown-note { background: var(--accent); color: #fff; text-align: center; border-radius: 1rem; padding: 0.75rem 1rem; font-weight: 700; margin: 0; }
.choose-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 640px) { .choose-grid { grid-template-columns: 1fr 1fr; } }
.choose-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  border-radius: 1.5rem; padding: 1.75rem 1rem; cursor: pointer;
  font-size: 1.25rem; font-weight: 700;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.choose-take { background: var(--accent); color: #fff; border: none; }
.choose-upload { background: var(--surface); color: var(--text); border: 2px solid var(--accent); }
.choose-sub { font-size: 0.875rem; font-weight: 600; opacity: 0.85; }
.choose-upload .choose-sub { opacity: 1; }
.reading { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 1.5rem 0; text-align: center; }
.reading-rim { width: 224px; height: 176px; border-radius: 26px; padding: 10px; box-shadow: 0 8px 20px rgba(0,0,0,0.22); }
.reading-inner {
  height: 100%; width: 100%; border-radius: 20px; background: var(--surface);
  display: flex; align-items: center; justify-content: center; font-size: 1.125rem; font-weight: 700;
}
.preview-frame { border-radius: 26px; padding: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.preview-img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 20px; }
.read-back { display: flex; align-items: center; gap: 0.625rem; border-radius: 1rem; padding: 0.75rem 1rem; font-size: 0.875rem; margin: 0.75rem 0 0; }
.read-dot { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 2px solid rgba(0,0,0,0.1); }
#confirmSection label { display: block; margin-bottom: 0.25rem; }

/* ---------- your plays ---------- */
.play-card { overflow: hidden; border-radius: 1.5rem; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.play-card-main { display: flex; gap: 0.75rem; padding: 0.75rem; }
.play-card-img { width: 96px; height: 80px; flex: none; border-radius: 0.75rem; object-fit: cover; }
.play-card-meta { min-width: 0; flex: 1; }
.play-card-subject { font-size: 1.125rem; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.play-card-pile { font-size: 0.75rem; font-weight: 700; color: var(--accent); margin: 0; }
.play-card-sub { font-size: 0.75rem; color: var(--dim); margin: 0; }
.play-card-stack { font-size: 1rem; font-weight: 700; margin: 0.25rem 0 0; }
.play-card-pill {
  margin-top: 0.25rem; border: none; cursor: pointer; border-radius: 999px; padding: 0.25rem 0.625rem;
  background: var(--surface-2); color: var(--text);
  font-family: "Baloo 2", system-ui, sans-serif; font-size: 0.75rem; font-weight: 700;
}
.play-card-comments { padding: 0 0.75rem 0.75rem; }
.run-toggle {
  width: 100%; border: none; border-top: 1px solid var(--border); cursor: pointer;
  background: none; color: var(--text); padding: 0.625rem 1rem;
  font-family: "Baloo 2", system-ui, sans-serif; font-size: 0.875rem; font-weight: 700;
}
.run-note { border-top: 1px solid var(--border); padding: 0.625rem 1rem; font-size: 0.875rem; color: var(--dim); margin: 0; }
.run-list { list-style: none; margin: 0; padding: 0 0.75rem 0.75rem; display: flex; flex-direction: column; gap: 0.375rem; }
.run-row { display: flex; align-items: center; gap: 0.625rem; background: var(--surface-2); border-radius: 0.75rem; padding: 0.5rem 0.625rem; }
.run-num { width: 24px; flex: none; text-align: center; font-size: 0.875rem; font-weight: 700; font-family: "Baloo 2", system-ui, sans-serif; }
.run-thumb { width: 44px; height: 36px; flex: none; border-radius: 0.375rem; object-fit: cover; }
.run-text { min-width: 0; flex: 1; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-plays { border-radius: 1.5rem; background: var(--surface); padding: 2rem 1.25rem; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.empty-plays h2 { font-size: 1.5rem; font-weight: 700; margin: 0; }

/* ---------- profile ---------- */
.profile-header { overflow: hidden; border-radius: 1.5rem; }
.profile-banner { position: relative; height: 7rem; width: 100%; }
.banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 600; color: rgba(255,255,255,0.9); }
.profile-head-body { position: relative; padding: 0 1rem 0.75rem; }
.profile-avatar-ring { display: inline-block; margin-top: -2.25rem; border-radius: 50%; background: var(--surface); padding: 4px; line-height: 0; }
.profile-name { font-size: 1.25rem; font-weight: 700; line-height: 1.25; margin: 0.25rem 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.premium-card { background: var(--accent); color: #fff; border-radius: 1.5rem; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.premium-list { margin: 0.25rem 0 0; padding-left: 1.25rem; font-size: 0.875rem; line-height: 1.6; opacity: 0.95; }
.premium-note { margin: 0.75rem 0 0; font-size: 0.875rem; font-weight: 600; background: rgba(255,255,255,0.14); border-radius: 0.75rem; padding: 0.5rem 0.75rem; }
.my-pile-row { display: flex; align-items: center; gap: 0.75rem; background: var(--surface-2); border-radius: 1rem; padding: 0.625rem 0.75rem; }
.my-pile-emoji { font-size: 1.25rem; }
.my-pile-meta { min-width: 0; flex: 1; }
.my-pile-name { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-pile-sub { display: block; font-size: 0.75rem; color: var(--dim); }
.open-pile-btn {
  flex: none; border: none; cursor: pointer; border-radius: 0.75rem; padding: 0.5rem 0.75rem;
  background: var(--accent); color: #fff;
  font-family: "Baloo 2", system-ui, sans-serif; font-size: 0.875rem; font-weight: 700;
}
.how-list { margin: 0; padding-left: 1.25rem; font-size: 0.875rem; line-height: 1.6; }
.profile-foot { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 0.5rem 0 1rem; }
.report-row { display: flex; gap: 0.7rem; background: var(--surface-2); padding: 0.6rem; border-radius: 0.75rem; align-items: center; }
.report-row img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.report-row .rmeta { flex: 1; font-size: 0.9rem; min-width: 0; }
.badge { background: var(--red); color: #fff; border-radius: 999px; padding: 0.1rem 0.55rem; font-size: 0.75rem; font-weight: 700; }
.badge.dim { background: var(--surface); color: var(--dim); }
.btn-sm {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 0.75rem; padding: 0.35rem 0.7rem; cursor: pointer; font-size: 0.85rem; font-weight: 600; flex: none;
}
.btn-sm.danger { border-color: #c0453a; color: var(--red); }

/* ---------- gift shop ---------- */
.coin-badge {
  display: inline-flex; align-items: center; gap: 0.375rem; flex: none;
  background: var(--sun); color: #3a2c00;
  border-radius: 999px; padding: 0.375rem 0.875rem;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1rem; font-weight: 800;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.coin-badge.big { font-size: 1.375rem; padding: 0.5rem 1.125rem; }
.coin-badge.earn { background: var(--accent); color: #fff; }
.coin-badge .coin-ico { flex: none; }
.coin-badge.big .coin-ico { width: 22px; height: 22px; }
.test-stamp {
  flex: none; color: var(--red); border: 2px solid var(--red); border-radius: 0.5rem;
  padding: 0.2rem 0.6rem; transform: rotate(-3deg);
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
.pack-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-top: 0.75rem; }
.pack-card {
  background: var(--surface-2); border-radius: 1rem; padding: 0.75rem 0.5rem;
  text-align: center; display: flex; flex-direction: column; gap: 0.25rem; align-items: center;
}
.pack-coins { font-size: 1.375rem; font-weight: 800; margin: 0; display: inline-flex; align-items: center; gap: 0.3rem; }
.pack-coins .coin-ico { width: 20px; height: 20px; }
.pack-price { font-size: 0.875rem; font-weight: 700; margin: 0; }
.pack-btn { width: 100%; font-size: 0.8125rem; padding: 0.5rem 0.25rem; margin-top: 0.25rem; }
.gift-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 0.5rem; }
.gift-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.125rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 1rem;
  padding: 0.625rem 0.25rem 0.5rem; cursor: pointer; color: var(--text);
  font-family: "Baloo 2", system-ui, sans-serif;
}
button.gift-tile:hover { border-color: var(--red); }
button.gift-tile:disabled { opacity: 0.5; }
.gift-tile.static { cursor: default; }
.gift-art { display: block; width: 40px; height: 40px; }
.gift-art svg { width: 100%; height: 100%; }
.gift-name { font-size: 0.8125rem; font-weight: 700; line-height: 1.1; }
.gift-price { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.75rem; font-weight: 700; color: #8a6100; }
@media (prefers-color-scheme: dark) { .gift-price { color: var(--sun); } }
.gift-price .coin-ico { width: 13px; height: 13px; }
.gift-open-btn.open { background: var(--sun); color: #3a2c00; border-color: var(--sun); }
.gift-shelf {
  background: var(--surface-2); border-radius: 1rem; padding: 0.75rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.shelf-title { font-size: 1rem; font-weight: 700; }
.gift-shelf .gift-grid { margin-top: 0.25rem; }
.gift-shelf .gift-tile { background: var(--surface); }
.shelf-coins-link { text-align: left; padding: 0.25rem 0; }
.gift-summary { display: flex; flex-direction: column; gap: 0.375rem; }
.gift-summary.empty { background: var(--surface-2); border-radius: 0.75rem; padding: 0.5rem 0.75rem; }
.gift-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.gift-chip {
  display: inline-flex; align-items: center; gap: 0.375rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.25rem 0.625rem 0.25rem 0.375rem;
  font-family: "Baloo 2", system-ui, sans-serif; font-size: 0.8125rem; font-weight: 700;
}
.gift-chip-art { display: inline-block; width: 22px; height: 22px; }
.gift-chip-art svg { width: 100%; height: 100%; }
.gift-total { font-size: 0.875rem; margin: 0; }

/* ---------- TikTok-mirror: levels, gallery, combo, rankings, big gift -- */
.gifter-badge {
  display: inline-block; vertical-align: 2px; margin-left: 0.375rem;
  background: var(--green, #0e3b2e); color: #fff;
  border-radius: 999px; padding: 0.05rem 0.5rem;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap;
}
.gift-records { list-style: none; margin: 0.25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.gift-record { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; flex-wrap: wrap; }
.gift-record .gr-name { font-weight: 700; }
.gift-record .gr-gift { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 700; }
.gift-record .avatar-initials, .gift-record .avatar-img { border-radius: 50%; }

.gift-gallery .gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 0.5rem; }
.gallery-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.125rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 1rem;
  padding: 0.5rem 0.25rem;
  font-family: "Baloo 2", system-ui, sans-serif;
}
.gallery-name { font-size: 0.75rem; font-weight: 700; line-height: 1.1; text-align: center; }
.gallery-count { font-size: 0.75rem; font-weight: 800; color: var(--red); }
.back-gallery { margin-top: 0.25rem; }
.back-gallery .gift-gallery .gallery-grid { margin-top: 0.25rem; }

.combo-bar {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  background: var(--sun); color: #3a2c00; border-radius: 0.75rem;
  padding: 0.5rem 0.75rem; margin-top: 0.25rem; position: relative; overflow: hidden;
}
.combo-art { display: block; width: 30px; height: 30px; flex: none; }
.combo-art svg { width: 100%; height: 100%; }
.combo-count { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.combo-label { font-size: 0.8125rem; font-weight: 700; flex: 1; min-width: 8rem; }
.combo-total { display: inline-flex; align-items: center; gap: 0.2rem; font-weight: 800; font-size: 0.875rem; }
.combo-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(58,44,0,0.18); }
.combo-timer-fill { display: block; height: 100%; width: 100%; background: var(--red); }

.rank-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.rank-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.rank-n {
  flex: none; width: 1.625rem; height: 1.625rem; border-radius: 50%;
  background: var(--sun); color: #3a2c00; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.875rem;
}
.rank-name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { display: inline-flex; align-items: center; gap: 0.2rem; font-weight: 800; flex: none; }
.rank-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 0.5rem; flex: none; }
.rank-row .avatar-initials, .rank-row .avatar-img { border-radius: 50%; flex: none; }

.big-gift-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(14, 59, 46, 0.88);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; cursor: pointer;
}
.big-gift-overlay.hidden { display: none; }
.big-gift-card { text-align: center; color: #fff; animation: bigGiftPop 0.45s ease-out; }
.big-gift-art { width: 150px; height: 150px; margin: 0 auto; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.45)); }
.big-gift-art svg { width: 100%; height: 100%; }
.big-gift-name { font-size: 2.25rem; font-weight: 800; margin: 0.5rem 0 0; }
.big-gift-sub { font-size: 1rem; margin: 0.25rem 0 0; opacity: 0.92; }
.big-gift-price { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 1.125rem; font-weight: 800; margin-top: 0.5rem; background: var(--sun); color: #3a2c00; border-radius: 999px; padding: 0.3rem 0.9rem; }
@keyframes bigGiftPop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- bottom tab bar ---------- */
#tabBar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-inner { max-width: 36rem; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }

/* ---------- gift layer off (GIFTS_ENABLED feature flag) ----------
   While the flag is off the server stamps class="gifts-off" on <html>
   (app.js keeps it in sync from the features payload): every surface
   tagged data-gifts-ui disappears and the tab bar falls back to the
   original four tabs. All gift code and data stay in place underneath —
   flipping the flag on restores the section exactly as built. */
.gifts-off [data-gifts-ui] { display: none !important; }
.gifts-off .tab-inner { grid-template-columns: repeat(4, 1fr); }
.tab-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  padding: 0.625rem 0.5rem; font-size: 0.75rem; font-weight: 700;
  color: var(--dim);
}
.tab-btn.active { color: var(--red); }
