/* Event sign-up: division cards with a live preview, and the JOIN list dialog. Square boxes, no rounded corners. */

.signup-status { margin-bottom: 18px; background: var(--wash); padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--grey-d); border-left: 4px solid var(--yellow); }
.signup-status.is-error { border-left-color: var(--red); color: var(--ink); }

.div-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.div-card { position: relative; background: var(--black); color: var(--white); padding: clamp(20px, 2.4vw, 28px); display: flex; flex-direction: column; min-height: 340px; overflow: hidden; isolation: isolate; }
.div-card::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 190px; height: 190px; background: url("../assets/img/cobra-head.png") center / contain no-repeat; opacity: 0.07; z-index: -1; transition: transform 500ms var(--ease-out); }
.div-years { font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--yellow); }
.div-name { font-size: clamp(34px, 3.6vw, 46px); letter-spacing: -0.02em; line-height: 1; margin-top: 10px; }

.div-preview { margin-top: auto; padding-top: 26px; }
.div-count { display: flex; align-items: baseline; gap: 10px; }
.div-count b { font-size: clamp(44px, 4.6vw, 60px); line-height: 0.9; letter-spacing: -0.04em; color: var(--yellow); font-variant-numeric: tabular-nums; min-width: 1ch; }
.div-count span { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ice); }
.div-faces { display: flex; margin-top: 14px; min-height: 34px; }
.div-faces li { width: 34px; height: 34px; display: grid; place-items: center; background: var(--white); color: var(--black); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; border: 2px solid var(--black); margin-left: -6px; animation: face-in 420ms var(--ease-out) calc(var(--i, 0) * 60ms) backwards; }
.div-faces li:first-child { margin-left: 0; background: var(--yellow); }
.div-faces li.more { background: var(--tint); color: var(--white); width: auto; padding-inline: 8px; }
@keyframes face-in { from { opacity: 0; transform: translateX(-8px) scale(0.9); } }
.div-who { margin-top: 12px; font-size: 14px; color: var(--ice); min-height: 2.6em; line-height: 1.35; }
.div-who b { color: var(--white); }
.div-join { margin-top: 18px; justify-content: space-between; width: 100%; font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; padding-block: 15px; }
.div-card.is-closed .div-join { background: var(--tint); color: var(--white); }
.div-card.is-closed .div-years::after { content: " · Closed"; color: var(--red); }

/* waiting for the first load */
.div-card.is-loading .div-count b { color: transparent; background: var(--tint); animation: pulse 1.2s ease-in-out infinite; }
.div-card.is-loading .div-who { color: var(--grey); }
@keyframes pulse { 50% { opacity: 0.45; } }

@media (hover: hover) and (pointer: fine) {
  .div-card { transition: transform 240ms var(--ease-out); }
  .div-card:hover { transform: translateY(-5px); }
  .div-card:hover::after { transform: rotate(-8deg) scale(1.06); }
}
.div-card:has(.div-join:active) { transform: scale(0.985); }

.signup-help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: clamp(28px, 4vw, 44px); }
.signup-help li { background: var(--wash); padding: 18px 20px; font-size: 15px; color: var(--grey-d); }
.signup-help b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.signup-help i { font-style: normal; display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center; background: var(--yellow); color: var(--black); font-weight: 700; margin-right: 8px; }

/* ---------- the list dialog ---------- */
dialog.signup { border: 0; padding: 0; border-radius: 0; background: var(--white); color: var(--ink); width: min(620px, calc(100vw - 24px)); max-height: min(90vh, 900px); overflow: auto; overscroll-behavior: contain;
  opacity: 1; transform: none; transition: opacity 200ms var(--ease-out), transform 260ms var(--ease-out); }
@starting-style { dialog.signup[open] { opacity: 0; transform: translateY(14px) scale(0.98); } }
dialog.signup::backdrop { background: rgba(0, 0, 0, 0.74); }
.signup-close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; width: 40px; height: 40px; border: 0; border-radius: 0; background: var(--yellow); color: var(--black); font-size: 22px; line-height: 1; cursor: pointer; z-index: 2; transition: transform 160ms var(--ease-out); }
.signup-close:active { transform: scale(0.94); }
.su-head { background: var(--black); color: var(--white); padding: clamp(22px, 4vw, 32px) clamp(20px, 4vw, 32px) 22px; }
.su-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--yellow); }
.su-head h2 { font-size: clamp(34px, 6vw, 48px); line-height: 1; letter-spacing: -0.02em; margin-top: 10px; }
.su-years { color: var(--ice); font-weight: 600; margin-top: 6px; }
.su-body { padding: 18px clamp(20px, 4vw, 32px) clamp(22px, 4vw, 30px); }
.su-count { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--grey-d); border-bottom: 4px solid var(--yellow); padding-bottom: 10px; }
.su-count b { font-size: 30px; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.su-sync { margin-left: auto; font-size: 11px; color: var(--grey); letter-spacing: 0.12em; }

.su-list { margin-top: 6px; }
.su-list li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 6px 6px 6px 10px; overflow: hidden; transition: opacity 220ms ease, transform 220ms var(--ease-out); }
.su-list li:nth-child(odd) { background: var(--wash); }
.su-n { font-weight: 700; color: var(--grey); font-variant-numeric: tabular-nums; font-size: 14px; }
.su-name { font-weight: 600; overflow-wrap: anywhere; }
.su-you { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; background: var(--black); color: var(--yellow); padding: 2px 7px; margin-left: 6px; vertical-align: 2px; }
.su-x { width: 36px; height: 36px; border: 0; border-radius: 0; background: none; color: var(--grey); font-size: 22px; line-height: 1; cursor: pointer; transition: color 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out); }
.su-x:active { transform: scale(0.9); }
@media (hover: hover) and (pointer: fine) { .su-x:hover { color: var(--white); background: var(--red); } }
.su-ask { position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 54px; background: var(--black); color: var(--white); font-weight: 600; font-size: 15px;
  clip-path: inset(0 0 0 100%); transition: clip-path 260ms var(--ease-out); }
.su-ask button { font: inherit; font-size: 13px; font-weight: 700; border: 0; border-radius: 0; padding: 8px 12px; cursor: pointer; transition: transform 160ms var(--ease-out); }
.su-ask button:active { transform: scale(0.95); }
.su-yes { margin-left: auto; background: var(--red); color: var(--white); }
.su-no { background: var(--white); color: var(--black); }
.su-list li.confirm .su-ask { clip-path: inset(0 0 0 0); }
.su-list li.leaving { opacity: 0; transform: translateX(24px); }
.su-list li.fresh { animation: fresh 1.6s var(--ease-out); }
@keyframes fresh { 0% { background: var(--yellow); transform: translateY(-6px); opacity: 0; } 20% { background: var(--yellow); transform: none; opacity: 1; } }
.su-empty { padding: 22px 4px; color: var(--grey-d); font-weight: 600; }

.su-form { margin-top: 22px; background: var(--wash); padding: 18px; }
.su-form label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 8px; }
.su-row { display: flex; gap: 8px; }
.su-row input { flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 12px 14px; border: 2px solid var(--black); border-radius: 0; background: var(--white); color: var(--ink); }
.su-row input:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px var(--yellow); }
.su-row .btn { flex: none; }
.su-row .btn:disabled { opacity: 0.6; cursor: progress; }
.su-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.su-msg { min-height: 1.5em; margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--grey-d); }
.su-msg.good { color: var(--ink); }
.su-msg.good::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--yellow); margin-right: 8px; }
.su-msg.bad { color: var(--red); }
.su-closed { margin-top: 22px; background: var(--black); color: var(--white); padding: 16px 18px; font-weight: 700; }
.su-note { margin-top: 14px; font-size: 13px; color: var(--grey); }

@media (max-width: 980px) { .div-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .signup-help { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .div-grid { gap: 10px; }
  .div-card { min-height: 0; padding: 18px 16px; }
  .div-name { font-size: 32px; }
  .div-count b { font-size: 42px; }
  .div-who { min-height: 0; font-size: 13px; }
  .div-join { font-size: 14px; padding: 13px 14px; }
  .su-row { flex-direction: column; }
  .su-row .btn { justify-content: center; }
  dialog.signup { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; }
  @starting-style { dialog.signup[open] { transform: translateY(40px); } }
}
@media (prefers-reduced-motion: reduce) {
  .div-faces li, .su-list li.fresh { animation: none; }
  .div-card:hover, .div-card:hover::after { transform: none; }
}

/* cards rise in one after another when the page opens */
.div-grid > li { animation: card-in 640ms var(--ease-out) backwards; }
.div-grid > li:nth-child(2) { animation-delay: 70ms; }
.div-grid > li:nth-child(3) { animation-delay: 140ms; }
.div-grid > li:nth-child(4) { animation-delay: 210ms; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) { .div-grid > li { animation: none; } }

/* register page: an event that is open for sign-ups */
.row.now-open { background: var(--black); color: var(--white); border-left: 6px solid var(--yellow); }
.row.now-open .row-meta { color: var(--ice); }
.row.now-open .arrow { color: var(--yellow); }
