/* Simos Camp — points, daily goals & leaderboard styles (owner: points; class prefix `pts-`).
 * Builds on css/base.css tokens (--sand, --turq, --wood, --ink, --paper, --panel-bg ...) so dark mode follows automatically.
 */
.pts-panel {
  --pts-gold: #f5c542; --pts-silver: #c3cfda; --pts-bronze: #e0a36b;
  --pts-soft-green: var(--ui-green-soft, #e3f7e9); --pts-soft-red: var(--ui-red-soft, #ffe6e6);
  --pts-soft-turq: var(--ui-turq-soft, #dcf6f3); --pts-soft-yellow: var(--ui-yellow-soft, #fff1c9);
  --pts-line: var(--ui-line, rgba(155, 106, 64, .2));
}
.pts-root { display: flex; flex-direction: column; gap: 12px; }

@keyframes pts-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pts-pop { 0% { opacity: 0; transform: scale(.5); } 65% { opacity: 1; transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes pts-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pts-bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-4px) rotate(6deg); } }
@keyframes pts-wave { 0%, 100% { transform: skewY(0deg) scaleX(1); } 50% { transform: skewY(-10deg) scaleX(.84); } }
@keyframes pts-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 127, 168, .55); } 50% { box-shadow: 0 0 0 5px rgba(255, 127, 168, 0); } }
@keyframes pts-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- waving flag (red / green) ---------- */
.pts-flag { position: relative; display: inline-block; width: 17px; height: 21px; flex: none; vertical-align: middle; }
.pts-flag-pole { position: absolute; left: 2px; top: 0; width: 3px; height: 21px; border-radius: 2px; background: var(--wood-dark); box-shadow: 1px 0 0 rgba(0, 0, 0, .08); }
.pts-flag-pole::after { content: ''; position: absolute; left: -1.5px; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.pts-flag-cloth {
  position: absolute; left: 5px; top: 2px; width: 12px; height: 9px; border-radius: 1px 3px 3px 1px; background: var(--pts-flag);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14); transform-origin: 0 50%; animation: pts-wave 1.3s ease-in-out infinite;
}
.pts-flag.red { --pts-flag: #ff5252; }
.pts-flag.green { --pts-flag: #43c46b; }

/* ---------- "You" card ---------- */
.pts-me {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center;
  padding: 14px 14px 12px; border-radius: var(--radius); border: 3px solid var(--sand-dark);
  background: radial-gradient(circle at 92% -10%, rgba(255, 215, 94, .35), transparent 45%), linear-gradient(160deg, var(--paper), var(--sand-light));
  box-shadow: 0 4px 0 var(--sand-deep);
}
.pts-me.green { border-color: var(--green); box-shadow: 0 4px 0 var(--green-dark); background: radial-gradient(circle at 92% -10%, rgba(67, 196, 107, .28), transparent 50%), linear-gradient(160deg, var(--paper), var(--sand-light)); }
.pts-me.red { border-color: #ff9b9b; box-shadow: 0 4px 0 #e06a6a; }
.pts-fresh .pts-me { animation: pts-in .42s var(--ease-spring) backwards; }
.pts-me-face { position: relative; }
.pts-me-face .sc-face { width: 64px; height: 64px; border: 3px solid #fff; box-shadow: 0 0 0 3px var(--wood), 0 4px 10px rgba(30, 50, 64, .22); }
.pts-me-face .pts-flag { position: absolute; right: -9px; top: -8px; transform: scale(1.25); transform-origin: 0 100%; }
.pts-me-main { min-width: 0; }
.pts-me-name { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 18px; line-height: 1.15; }
.pts-me-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pts-me-pts { margin-top: 2px; color: var(--ink-soft); font-weight: 600; font-size: 15px; }
.pts-me-pts b { font-size: 32px; line-height: 1; color: var(--ink); letter-spacing: -.5px; }
.pts-me.green .pts-me-pts b { color: var(--green-dark); }
.pts-me.red .pts-me-pts b { color: var(--red-dark); }
.pts-me-rank {
  display: inline-block; margin-top: 5px; padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 13.5px;
  background: var(--pts-soft-yellow); border: 2px solid var(--sand-dark);
}
.pts-me-meter { grid-column: 1 / -1; }
.pts-meter { height: 12px; background: rgba(0, 0, 0, .1); }
.pts-meter > i { background: linear-gradient(90deg, #ffd75e, #7ad98f 60%, var(--green)); }
.pts-meter.green > i { background: linear-gradient(90deg, #7ad98f, var(--green)); }
.pts-meter.red > i { background: linear-gradient(90deg, #ff8a8a, #ffc36b); }
.pts-me-hint { margin-top: 5px; font-size: 13.5px; color: var(--ink-soft); font-weight: 500; }
.pts-you {
  display: inline-block; margin-left: 5px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 18px;
  background: var(--turq); color: #fff; vertical-align: middle; flex: none;
}
.pts-me-name .pts-you { margin-left: 0; font-size: 12px; line-height: 20px; }
.pts-guest { grid-template-columns: auto 1fr; }
.pts-guest-ico { font-size: 44px; line-height: 1; animation: ui-bob 2.6s ease-in-out infinite; }
.pts-guest-t { font-size: 14.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.35; }

/* goals chip inside the "You" card */
.pts-goalchip {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 12px; cursor: pointer;
  border-radius: 999px; background: var(--pts-soft-turq); border: 2px dashed var(--turq); font-weight: 600; font-size: 14px;
  transition: transform .15s var(--ease-spring), filter .15s;
}
.pts-goalchip:hover { filter: brightness(1.03); }
.pts-goalchip:active { transform: scale(.97); }
.pts-goalchip.all { background: var(--pts-soft-green); border-color: var(--green); border-style: solid; }
.pts-gc-t { white-space: nowrap; }
.pts-gc-icons { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; }
.pts-gc-i {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; flex: none;
  background: var(--paper); border: 2px solid var(--sand-dark); filter: grayscale(.25);
}
.pts-gc-i.done { background: var(--green); border-color: var(--green-dark); filter: none; position: relative; }
.pts-gc-i.done::after { content: '✓'; position: absolute; right: -4px; bottom: -4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; color: var(--green-dark); font-size: 10px; line-height: 14px; text-align: center; font-weight: 700; box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.pts-gc-n { font-weight: 700; color: var(--turq-dark); }
.pts-goalchip.all .pts-gc-n { color: var(--green-dark); }
.pts-gc-go { font-size: 22px; line-height: 1; color: var(--ink-faint); margin-left: -2px; }

/* required workshop (own card only) — calm & friendly, never alarming */
.pts-wschip {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 7px 8px 7px 10px;
  border-radius: 16px; background: var(--pts-soft-yellow); border: 2px solid var(--sand-dark); box-shadow: 0 2px 0 var(--sand-dark);
}
.pts-fresh .pts-wschip { animation: pts-fade .4s var(--ease-soft) .2s backwards; }
.pts-ws-ico {
  width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
  background: var(--paper); border: 2px solid var(--sand-dark);
}
.pts-ws-main { flex: 1 1 auto; min-width: 0; }
.pts-ws-t { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.pts-ws-s { font-size: 12.5px; color: var(--ink-soft); line-height: 1.3; margin-top: 1px; }
.pts-ws-go { flex: none; min-height: 40px; min-width: 64px; }

/* ---------- tabs ---------- */
.pts-tabs {
  display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--sand); border: 2px solid var(--sand-dark);
  position: sticky; top: -14px; z-index: 3;
  box-shadow: 0 -12px 0 6px var(--panel-bg), 0 4px 10px rgba(30, 50, 64, .1); /* hides rows scrolling under it */
}
@media (min-width: 700px) { .pts-tabs { top: -16px; } }
.pts-tab {
  flex: 1 1 0; min-height: 40px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: 600 15px/1 var(--font); color: var(--ink-soft); transition: background .2s, color .2s, transform .12s var(--ease-spring);
}
.pts-tab:active { transform: scale(.96); }
.pts-tab.on {
  background: linear-gradient(180deg, #5fdad8, var(--turq)); color: #fff; text-shadow: 0 1px 0 rgba(21, 113, 134, .6);
  box-shadow: 0 3px 0 #157186;
}
.pts-tabin { animation: pts-fade .28s var(--ease-soft) backwards; }

/* ---------- podium ---------- */
.pts-podium { display: grid; grid-template-columns: 1fr 1.18fr 1fr; align-items: end; gap: 8px; padding: 18px 2px 0; }
.pts-podium.n1 { grid-template-columns: minmax(0, 150px); justify-content: center; }
.pts-podium.n2 { grid-template-columns: 1fr 1.18fr; }
.pts-pod { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; cursor: pointer; border-radius: 16px; outline-offset: 3px; }
.pts-fresh .pts-pod { animation: pts-in .5s var(--ease-spring) backwards; animation-delay: calc(.08s + var(--i, 0) * .09s); }
.pts-pod-top { position: relative; margin-bottom: 4px; }
.pts-pod .sc-face { border: 3px solid #fff; box-shadow: 0 0 0 3px var(--pts-medal, var(--wood)), 0 5px 12px rgba(30, 50, 64, .22); background: var(--turq-light); }
.pts-pod.first .sc-face { width: 66px; height: 66px; }
.pts-pod-medal { position: absolute; left: -6px; bottom: -6px; font-size: 22px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .15)); }
.pts-pod-top .pts-flag { position: absolute; right: -8px; top: -4px; }
.pts-crown { position: absolute; left: 50%; top: -24px; margin-left: -13px; font-size: 24px; line-height: 1; animation: pts-bob 2.4s ease-in-out infinite; z-index: 1; }
.pts-pod-name { max-width: 100%; font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.pts-pod-name .pts-you { margin-left: 3px; }
.pts-pod-pts { font-size: 13px; color: var(--ink-soft); margin: 1px 0 5px; }
.pts-pod-pts b { font-size: 17px; color: var(--ink); }
.pts-pod-block {
  width: 100%; height: var(--pts-h, 34px); border-radius: 14px 14px 6px 6px; display: grid; place-items: center; transform-origin: 50% 100%;
  background: var(--wood-grain), linear-gradient(180deg, var(--wood-light), var(--wood)); border: 3px solid var(--wood-dark); border-bottom-width: 4px;
  color: #fff; font-weight: 700; font-size: 22px; text-shadow: 0 2px 0 rgba(122, 81, 50, .6);
}
.pts-fresh .pts-pod-block { animation: pts-rise .5s var(--ease-spring) backwards; animation-delay: calc(.12s + var(--i, 0) * .09s); }
.pts-pod-block span {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 17px;
  background: var(--pts-medal, var(--wood-light)); border: 2px solid rgba(255, 255, 255, .8); color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}
.pts-pod.r1 { --pts-medal: var(--pts-gold); --pts-h: 70px; }
.pts-pod.r2 { --pts-medal: var(--pts-silver); --pts-h: 50px; }
.pts-pod.r3 { --pts-medal: var(--pts-bronze); --pts-h: 36px; }
.pts-pod.r4 { --pts-h: 28px; }
.pts-pod.me .pts-pod-name { color: var(--turq-dark); }
.pts-pod:active { transform: scale(.97); }

/* ---------- ranking rows ---------- */
.pts-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.pts-row {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 6px 12px 6px 8px; cursor: pointer;
  border-radius: 16px; background: var(--paper); border: 2px solid var(--sand-dark); box-shadow: 0 2px 0 var(--sand-dark);
  transition: transform .15s var(--ease-spring), filter .15s; outline-offset: 2px;
}
.pts-fresh .pts-row { animation: pts-in .38s var(--ease-spring) backwards; animation-delay: calc(.2s + var(--i, 0) * .03s); }
.pts-row:hover { filter: brightness(1.02); }
.pts-row:active { transform: scale(.985); }
.pts-row.me { background: var(--pts-soft-turq); border-color: var(--turq); box-shadow: 0 3px 0 var(--turq-dark); }
.pts-row.red:not(.me) { background: linear-gradient(90deg, var(--pts-soft-red), var(--paper) 55%); }
.pts-row.green:not(.me) { background: linear-gradient(90deg, var(--pts-soft-green), var(--paper) 55%); }
.pts-rank {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  color: var(--ink-soft); background: var(--sand); border: 2px solid var(--sand-dark);
}
.pts-row.me .pts-rank { background: var(--turq); border-color: var(--turq-dark); color: #fff; }
.pts-row .sc-face { width: 40px; height: 40px; }
.pts-name { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; font-weight: 600; font-size: 16px; }
.pts-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pts-pts { flex: none; text-align: right; min-width: 52px; }
.pts-pts b { font-size: 18px; }
.pts-pts small { margin-left: 3px; font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.pts-row .pts-flag { margin-right: 2px; }
.pts-note { margin: 12px 4px 2px; text-align: center; font-size: 13.5px; color: var(--ink-soft); line-height: 1.4; }

/* ---------- cards (goals, history) ---------- */
.pts-mebody { display: flex; flex-direction: column; gap: 12px; }
.pts-card { background: var(--paper); border: 2px solid var(--sand-dark); border-radius: var(--radius); padding: 12px 12px 8px; box-shadow: 0 2px 0 var(--sand-dark); }
.pts-fresh .pts-card, .pts-tabin .pts-card { animation: pts-in .4s var(--ease-spring) backwards; }
.pts-fresh .pts-history, .pts-tabin .pts-history { animation-delay: .07s; }
.pts-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 17px; margin: 0 2px 6px; }
.pts-muted { color: var(--ink-soft); font-size: 14.5px; padding: 6px 2px 8px; }

.pts-goal { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 9px 2px; border-top: 2px dashed var(--pts-line); }
.pts-goal-ico {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 21px;
  background: var(--pts-soft-yellow); border: 2px solid var(--sand-dark);
}
.pts-goal.done .pts-goal-ico { background: var(--pts-soft-green); border-color: var(--green); }
.pts-goal-main { min-width: 0; }
.pts-goal-text { font-weight: 600; font-size: 15.5px; line-height: 1.25; }
.pts-goal.done .pts-goal-text { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(67, 196, 107, .8); text-decoration-thickness: 2px; }
.pts-gmeter { height: 9px; margin-top: 6px; }
.pts-goal-state {
  min-width: 38px; height: 30px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--sand); border: 2px solid var(--sand-dark); color: var(--ink-soft);
}
.pts-goal.done .pts-goal-state { background: var(--green); border-color: var(--green-dark); color: #fff; font-size: 16px; }
.pts-fresh .pts-goal.done .pts-goal-state, .pts-tabin .pts-goal.done .pts-goal-state { animation: pts-pop .45s var(--ease-spring) backwards; animation-delay: calc(.25s + var(--i, 0) * .08s); }
.pts-goal-foot { margin: 4px 2px 4px; padding-top: 8px; border-top: 2px dashed var(--pts-line); font-size: 13px; color: var(--ink-soft); text-align: center; }

.pts-away {
  margin: 2px 0 6px; padding: 6px 10px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  background: var(--ui-pink-soft, #ffe8f0); color: #b3335f; border: 2px solid rgba(255, 127, 168, .6);
}
.pts-hist { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 2px; border-top: 2px dashed var(--pts-line); }
.pts-away + .pts-hist { border-top: 0; }
.pts-hist.new { background: linear-gradient(90deg, rgba(255, 127, 168, .12), transparent 70%); border-radius: 10px; }
.pts-delta {
  min-width: 48px; height: 32px; padding: 0 9px; border-radius: 999px; display: grid; place-items: center;
  font-weight: 700; font-size: 16px; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
}
.pts-delta.pos { background: linear-gradient(180deg, #6fdc8e, var(--green)); box-shadow: 0 2px 0 #237a3e; }
.pts-delta.neg { background: linear-gradient(180deg, #ff8a8a, var(--red)); box-shadow: 0 2px 0 #a82b2b; }
.pts-hist-main { min-width: 0; }
.pts-hist-label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; line-height: 1.25; }
.pts-hist-ico { font-size: 16px; flex: none; }
.pts-hist-detail { font-size: 13.5px; font-weight: 600; color: var(--turq-dark); margin-top: 2px; }
.pts-hist-tip { font-size: 13px; color: var(--ink-soft); margin-top: 2px; line-height: 1.32; }
.pts-hist-day { font-size: 12px; color: var(--ink-faint); font-weight: 600; white-space: nowrap; align-self: start; margin-top: 7px; }
.pts-newb {
  padding: 0 7px; border-radius: 999px; font-size: 11px; line-height: 17px; font-weight: 700; color: #fff; background: var(--pink);
  animation: pts-glow 1.6s ease-in-out infinite;
}

/* ---------- guide ---------- */
.pts-guide { border-radius: var(--radius); border: 2px solid var(--sand-dark); background: var(--sand-light); overflow: hidden; }
.pts-guide > summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 8px 14px; cursor: pointer;
  font-weight: 700; font-size: 16px;
}
.pts-guide > summary::-webkit-details-marker { display: none; }
.pts-guide-arrow { font-size: 24px; line-height: 1; color: var(--ink-faint); transition: transform .25s var(--ease-spring); }
.pts-guide[open] .pts-guide-arrow { transform: rotate(90deg); }
.pts-guide-body { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0 12px 12px; animation: pts-fade .3s var(--ease-soft); }
.pts-gcol { display: flex; flex-direction: column; gap: 3px; }
.pts-gh { font-weight: 700; font-size: 14.5px; margin: 2px 0 4px; }
.pts-gi { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 14px; }
.pts-gi-ico { width: 22px; text-align: center; flex: none; }
.pts-gi-l { flex: 1 1 auto; min-width: 0; }
.pts-gi-cap { flex: none; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); padding: 1px 7px; border-radius: 999px; background: var(--sand); }
.pts-gi-d { flex: none; min-width: 38px; text-align: right; font-weight: 700; }
.pts-gi-d.pos { color: var(--green-dark); }
.pts-gi-d.neg { color: var(--red-dark); }
.pts-gnote { grid-column: 1 / -1; margin: 2px 0 0; font-size: 13px; line-height: 1.42; color: var(--ink-soft); }
@media (min-width: 560px) { .pts-guide-body { grid-template-columns: 1fr 1fr; } }

/* ---------- fallback face (ui missing) ---------- */
.pts-face-fb { display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--turq); text-shadow: 0 1px 0 rgba(0, 0, 0, .2); }
.pts-empty { text-align: center; padding: 24px; color: var(--ink-soft); }

/* phones: slightly tighter */
@media (max-width: 380px) {
  .pts-me { padding: 12px 10px 10px; gap: 8px 10px; }
  .pts-me-face .sc-face { width: 56px; height: 56px; }
  .pts-me-pts b { font-size: 28px; }
  .pts-pod .sc-face { width: 48px; height: 48px; }
  .pts-pod.first .sc-face { width: 58px; height: 58px; }
  .pts-tab { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .pts-flag-cloth, .pts-crown, .pts-newb { animation: none; }
}
