/* JSA Costume Contest */
.jsacc {
  --jc-text: #1d2a51;
  --jc-head: #2456a5;
  --jc-muted: #6b7a99;
  --jc-border: #e0e6f0;
  --jc-soft: #e6edf8;
  --jc-orange: #f47b20;
  --jc-orange-dk: #d4630e;
  --jc-orange-bg: #fff4ea;
  --jc-purple: #3b2a5c;
  --jc-radius: 12px;
  font-family: 'Raleway', -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--jc-text);
  max-width: 1200px;
  margin: 0 auto;
  line-height: 1.45;
}
.jsacc *, .jsacc *::before, .jsacc *::after { box-sizing: border-box; }
.jsacc img { max-width: 100%; display: block; }

.jsacc-loading { padding: 48px 16px; text-align: center; color: var(--jc-muted); font-weight: 600; }
.jsacc-spin { display: inline-block; animation: jsacc-bob 1s ease-in-out infinite; font-size: 1.4em; }
@keyframes jsacc-bob { 50% { transform: translateY(-6px) rotate(-8deg); } }

/* header */
.jsacc-head { text-align: center; margin: 0 0 18px; }
.jsacc .jsacc-h { color: var(--jc-head); font-weight: 800; font-size: clamp(1.5rem, 4.5vw, 2.4rem); line-height: 1.15; margin: 0 0 6px; }
.jsacc-when { margin: 0; color: var(--jc-muted); font-weight: 600; font-size: .95rem; }

/* notices & banners */
.jsacc-notice { background: var(--jc-soft); border-radius: var(--jc-radius); padding: 22px; text-align: center; font-weight: 600; }
.jsacc-big { font-size: 1.2rem; padding: 40px 22px; }
.jsacc-banner { background: var(--jc-orange-bg); border: 1px solid #ffd6b3; border-radius: var(--jc-radius); padding: 14px 16px; margin: 0 auto 18px; font-size: 1rem; max-width: 900px; }
.jsacc-banner-preview { background: #f1ecfa; border-color: #d9cdf0; }
.jsacc-banner-login { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; text-align: center; }

/* buttons */
.jsacc .jsacc-btn {
  appearance: none; border: 0; cursor: pointer; font-family: inherit; font-weight: 800; letter-spacing: .02em;
  background: var(--jc-orange); color: #fff; border-radius: 999px; padding: 16px 28px; font-size: 1.1rem;
  min-height: 52px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s, opacity .15s; box-shadow: 0 4px 14px rgba(244,123,32,.35);
}
.jsacc .jsacc-btn:hover { background: var(--jc-orange-dk); color: #fff; }
.jsacc .jsacc-btn:active { transform: scale(.98); }
.jsacc .jsacc-btn:disabled { background: #c7cfdd; box-shadow: none; cursor: not-allowed; }
.jsacc .jsacc-btn-sm { padding: 8px 18px; min-height: 40px; font-size: .95rem; }
.jsacc .jsacc-btn-ghost { background: transparent; color: var(--jc-text); box-shadow: inset 0 0 0 2px var(--jc-border); }
.jsacc .jsacc-btn-ghost:hover { background: var(--jc-soft); color: var(--jc-text); }

/* entry grid */
.jsacc-grid { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 900px; }
@media (max-width: 520px) {
  .jsacc-grid { gap: 12px; }
  .jsacc .jsacc-body { padding: 10px 10px 12px; gap: 8px; }
  .jsacc .jsacc-costume { font-size: 1rem; }
  .jsacc .jsacc-who { font-size: .85rem; }
  .jsacc .jsacc-pick { min-height: 44px; font-size: .82rem; padding: 4px 6px; line-height: 1.15; text-align: center; }
  .jsacc .jsacc-check { width: 36px; height: 36px; font-size: 20px; top: 8px; right: 8px; }
}
.jsacc-form .jsacc-submitbar { max-width: 908px; margin-left: auto; margin-right: auto; }
.jsacc .jsacc-grid > li { margin: 0; padding: 0; }

.jsacc-card { position: relative; background: #fff; border-radius: var(--jc-radius); box-shadow: 0 1px 3px rgba(29,42,81,.12), 0 0 0 1px var(--jc-border); overflow: hidden; }
.jsacc-card label { display: block; cursor: pointer; margin: 0; -webkit-tap-highlight-color: transparent; }
.jsacc-photo { position: relative; display: block; background: var(--jc-soft); }
/* show the whole photo at its natural shape (no cropping) */
.jsacc .jsacc-photo img { width: 100%; height: auto; object-fit: contain; }
.jsacc-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; }
.jsacc-titles { display: flex; flex-direction: column; }
.jsacc-costume { font-weight: 800; font-size: 1.2rem; color: var(--jc-text); line-height: 1.2; }
.jsacc-who { color: var(--jc-muted); font-weight: 600; font-size: .98rem; margin-top: 2px; }
.jsacc-body > .jsacc-costume + .jsacc-who { margin-top: -8px; }

/* the "Pick this costume" control */
.jsacc-radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.jsacc-pick {
  display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 999px;
  border: 2px solid var(--jc-orange); color: var(--jc-orange-dk); font-weight: 800; font-size: 1.05rem;
  transition: background .15s, color .15s;
}
.jsacc-pick-on { display: none; }
.jsacc-card label:hover .jsacc-pick { background: var(--jc-orange-bg); }
.jsacc-check {
  position: absolute; top: 12px; right: 12px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--jc-orange); color: #fff; font-size: 26px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.3); transform: scale(0); transition: transform .2s cubic-bezier(.3,1.6,.6,1);
}

/* selected state (works with or without the JS class) */
.jsacc-radio:checked + label .jsacc-pick { background: var(--jc-orange); color: #fff; }
.jsacc-radio:checked + label .jsacc-pick-on { display: inline; }
.jsacc-radio:checked + label .jsacc-pick-off { display: none; }
.jsacc-radio:checked + label .jsacc-check { transform: scale(1); }
.jsacc-card.is-selected { box-shadow: 0 0 0 4px var(--jc-orange), 0 8px 24px rgba(244,123,32,.3); }
.jsacc-form.has-pick .jsacc-card:not(.is-selected) .jsacc-photo img { filter: saturate(.55) brightness(.92); transition: filter .2s; }
.jsacc-radio:focus-visible + label { outline: 3px solid var(--jc-head); outline-offset: 3px; border-radius: var(--jc-radius); }

/* submit bar: sits at the bottom of the list and sticks to the screen bottom while scrolling */
.jsacc-submitbar {
  position: sticky; bottom: 0; z-index: 20; margin: 22px -4px 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.97); backdrop-filter: blur(6px); border-top: 1px solid var(--jc-border);
  box-shadow: 0 -6px 20px rgba(29,42,81,.1); border-radius: var(--jc-radius) var(--jc-radius) 0 0;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.jsacc-choice { flex: 1 1 200px; font-size: 1rem; min-width: 0; }
.jsacc-choice-label { color: var(--jc-muted); font-weight: 600; }
.jsacc-choice-name { font-weight: 800; }
.jsacc-form:not(.has-pick) .jsacc-choice-name { color: var(--jc-muted); font-weight: 600; font-style: italic; }
.jsacc-submit { flex: 1 1 220px; }
.jsacc-submitbar.pulse { animation: jsacc-pulse .5s ease; }
@keyframes jsacc-pulse { 40% { box-shadow: 0 -6px 26px rgba(244,123,32,.45); } }

/* confirm modal */
.jsacc-modal { position: fixed; inset: 0; z-index: 99999; background: rgba(15,20,40,.65); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.jsacc-modal[hidden] { display: none; }
@media (min-width: 640px) { .jsacc-modal { align-items: center; padding: 20px; } }
.jsacc-modal-card {
  background: #fff; width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; overflow: hidden; text-align: center;
  padding-bottom: env(safe-area-inset-bottom); animation: jsacc-up .25s ease;
}
@media (min-width: 640px) { .jsacc-modal-card { border-radius: 18px; } }
@keyframes jsacc-up { from { transform: translateY(40px); opacity: 0; } }
.jsacc-modal-img { width: 100%; height: auto; max-height: 55vh; object-fit: contain; background: #111; }
.jsacc .jsacc-modal-h { margin: 18px 18px 2px; font-size: 1.35rem; font-weight: 800; color: var(--jc-text); }
.jsacc-modal-who { margin: 0 18px; color: var(--jc-muted); font-weight: 600; }
.jsacc-modal-note { margin: 10px 18px 0; font-size: .92rem; color: var(--jc-muted); }
.jsacc-modal-actions { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; }
.jsacc-modal-err { color: #b42318; font-weight: 700; margin: 0 18px 16px; min-height: 0; }
.jsacc-modal-err:empty { display: none; }
html.jsacc-noscroll, html.jsacc-noscroll body { overflow: hidden; }

/* thank-you / already voted */
.jsacc-thanks { max-width: 900px; margin: 0 auto; text-align: center; }
.jsacc-thanks-icon { font-size: 56px; line-height: 1; }
.jsacc-thanks.is-new .jsacc-thanks-icon { animation: jsacc-pop .6s cubic-bezier(.3,1.6,.6,1); }
@keyframes jsacc-pop { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }
.jsacc .jsacc-thanks-h { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; color: var(--jc-orange-dk); margin: 8px 0 4px; }
.jsacc-thanks-sub { color: var(--jc-muted); font-weight: 600; margin: 0 0 12px; }
.jsacc-thanks .jsacc-card { text-align: left; max-width: 440px; margin: 0 auto; }
.jsacc-card.is-mine { box-shadow: 0 0 0 3px var(--jc-orange); }
.jsacc-thanks-note { margin: 18px 0 4px; font-weight: 700; font-size: 1.05rem; }
.jsacc .jsacc-sub.jsacc-others-h { max-width: 900px; margin: 40px auto 14px; padding-top: 24px; border-top: 1px solid var(--jc-border); text-align: center; }
.jsacc-countdown { margin: 0; color: var(--jc-muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* results */
.jsacc-winners { max-width: 760px; margin: 0 auto 28px; display: grid; gap: 16px; }
.jsacc-winner-label { text-align: center; font-weight: 800; font-size: 1.4rem; color: var(--jc-orange-dk); }
.jsacc-card.is-winner { box-shadow: 0 0 0 4px var(--jc-orange), 0 10px 30px rgba(244,123,32,.25); }
.jsacc-card.is-winner .jsacc-costume { font-size: 1.4rem; }
.jsacc-stat { font-size: 1.05rem; color: var(--jc-muted); }
.jsacc-stat b { color: var(--jc-orange-dk); font-size: 1.3rem; }
.jsacc .jsacc-sub { font-size: 1.2rem; font-weight: 800; color: var(--jc-head); margin: 0 0 12px; }
.jsacc-sub span { font-weight: 600; color: var(--jc-muted); font-size: .95rem; }
.jsacc .jsacc-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.jsacc .jsacc-row {
  margin: 0; display: grid; grid-template-columns: auto 96px 1fr auto; gap: 12px; align-items: center;
  background: #fff; border-radius: var(--jc-radius); box-shadow: 0 0 0 1px var(--jc-border); padding: 10px 14px 10px 10px;
}
.jsacc-row.is-mine { box-shadow: 0 0 0 2px var(--jc-orange); }
.jsacc-rank { font-weight: 800; color: var(--jc-muted); min-width: 2.2em; text-align: center; }
.jsacc-thumb { display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 1160 / 700; background: var(--jc-soft); }
.jsacc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.jsacc-row-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.jsacc-row-title { display: flex; flex-direction: column; }
.jsacc-row-title .jsacc-costume { font-size: 1rem; }
.jsacc-row-title .jsacc-who { font-size: .88rem; }
.jsacc-yours { font-style: normal; font-size: .75rem; font-weight: 800; text-transform: uppercase; color: var(--jc-orange-dk); }
.jsacc-bar { display: block; height: 8px; border-radius: 999px; background: var(--jc-soft); overflow: hidden; }
.jsacc-bar span { display: block; height: 100%; background: var(--jc-orange); border-radius: 999px; }
.jsacc-row-stat { text-align: right; display: flex; flex-direction: column; min-width: 76px; }
.jsacc-row-stat b { font-size: 1.15rem; }
.jsacc-row-stat small { color: var(--jc-muted); font-weight: 600; white-space: nowrap; }
@media (max-width: 520px) {
  .jsacc .jsacc-row { grid-template-columns: auto 72px 1fr; }
  .jsacc-row-stat { grid-column: 3; flex-direction: row; gap: 8px; align-items: baseline; text-align: left; }
}

/* tester toolbar */
.jsacc-toolbar { background: #1d2a51; color: #fff; border-radius: var(--jc-radius); padding: 12px 14px; margin: 0 0 18px; font-size: .9rem; }
.jsacc-tb-meta { opacity: .75; }
.jsacc-tb-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.jsacc .jsacc-tb-btn { font-family: inherit; font-weight: 700; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.jsacc .jsacc-tb-btn.is-on { background: var(--jc-orange); border-color: var(--jc-orange); }
.jsacc .jsacc-tb-clear { margin-left: auto; border-color: #ff9a9a; color: #ffc4c4; }
.jsacc-tb-note { opacity: .7; font-size: .8rem; }

/* click-to-enlarge */
.jsacc [data-zoom] { cursor: zoom-in; }
.jsacc-zoom-hint {
  position: absolute; left: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(15,20,40,.6); color: #fff; display: flex; align-items: center; justify-content: center;
  pointer-events: none; transition: background .15s;
}
.jsacc [data-zoom]:hover .jsacc-zoom-hint { background: var(--jc-orange); }
.jsacc [data-zoom]:focus-visible { outline: 3px solid var(--jc-head); outline-offset: -3px; }

.jsacc-lb { position: fixed; inset: 0; z-index: 100000; background: rgba(10,12,25,.97); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 12px 16px; }
.jsacc-lb[hidden] { display: none; }
.jsacc-lb-fig { margin: 0; max-width: 1160px; width: 100%; display: flex; flex-direction: column; align-items: center; animation: jsacc-up .2s ease; }
.jsacc-lb-img { max-width: 100%; max-height: calc(100vh - 210px); width: auto; height: auto; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #222; }
.jsacc-lb-cap { color: #fff; text-align: center; margin-top: 12px; }
.jsacc-lb-cap .jsacc-costume { color: #fff; font-size: 1.3rem; display: block; }
.jsacc-lb-cap .jsacc-who { color: #c9d2e6; display: block; }
.jsacc-lb-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.jsacc .jsacc-lb-actions .jsacc-btn-ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.jsacc .jsacc-lb-actions .jsacc-btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.jsacc .jsacc-lb-close, .jsacc .jsacc-lb-nav {
  position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(255,255,255,.12); border-radius: 50%;
  width: 48px; height: 48px; font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.jsacc .jsacc-lb-close { top: 10px; right: 10px; }
.jsacc .jsacc-lb-nav { top: 50%; transform: translateY(-50%); }
.jsacc .jsacc-lb-prev { left: 10px; }
.jsacc .jsacc-lb-next { right: 10px; }
.jsacc .jsacc-lb-close:hover, .jsacc .jsacc-lb-nav:hover { background: var(--jc-orange); }
.jsacc-lb-count { position: absolute; top: 20px; left: 0; right: 0; text-align: center; color: #c9d2e6; font-weight: 600; font-size: .9rem; pointer-events: none; }
@media (max-width: 640px) { .jsacc .jsacc-lb-nav { top: auto; bottom: 18px; transform: none; } .jsacc-lb { padding-bottom: 80px; } }
.jsacc [hidden] { display: none !important; }
