/* Streams — tension number game */
:root {
  --st-ink: #0b1c24;
  --st-deep: #123040;
  --st-teal: #1a5c6e;
  --st-foam: #e8f4f2;
  --st-mint: #7fd4c4;
  --st-amber: #f0b429;
  --st-coral: #e85d4c;
  --st-line: rgba(127, 212, 196, 0.28);
  --st-shadow: 0 18px 48px rgba(8, 24, 32, 0.35);
  --st-font-display: "Montserrat", "Noto Sans KR", sans-serif;
  --st-font-body: "Noto Sans KR", sans-serif;
}

.st-page { background: radial-gradient(1200px 600px at 10% -10%, #1a4a58 0%, transparent 55%),
  radial-gradient(900px 500px at 100% 0%, #2a2030 0%, transparent 50%),
  linear-gradient(165deg, #07151c 0%, #0e2430 45%, #122a36 100%);
  color: var(--st-foam); min-height: 100vh; }
.st-page .navbar, .st-page footer { position: relative; z-index: 2; }

.st-lobby, .st-intro { padding: 2rem 0 4rem; }
.st-eyebrow {
  display: inline-block; font-size: .72rem; letter-spacing: .18em; font-weight: 800;
  color: var(--st-mint); margin-bottom: .5rem;
}
.st-lobby h1, .st-intro h1, .st-hero h1 {
  font-family: var(--st-font-display); font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.15; margin: 0 0 .75rem;
}
.st-lobby p, .st-intro p { color: rgba(232,244,242,.78); max-width: 40rem; }

.st-action-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; margin: 1.5rem 0 2rem;
}
@media (max-width: 768px) {
  .st-action-grid { grid-template-columns: 1fr; }
}
.st-action-card {
  display: flex; gap: .9rem; align-items: flex-start; text-align: left;
  background: linear-gradient(145deg, rgba(26,92,110,.45), rgba(18,48,64,.85));
  border: 1px solid var(--st-line); border-radius: 16px; padding: 1.1rem 1.15rem;
  color: inherit; box-shadow: var(--st-shadow); transition: transform .2s, border-color .2s;
}
.st-action-card:hover { transform: translateY(-2px); border-color: var(--st-mint); }
.st-action-card i { font-size: 1.4rem; color: var(--st-amber); margin-top: .15rem; }
.st-action-card small { display: block; font-size: .68rem; letter-spacing: .12em; color: var(--st-mint); }
.st-action-card strong { display: block; font-size: 1.05rem; margin: .15rem 0; }
.st-action-card em { display: block; font-style: normal; font-size: .85rem; color: rgba(232,244,242,.65); }

.st-room-panel {
  background: rgba(11,28,36,.55); border: 1px solid var(--st-line);
  border-radius: 18px; padding: 1.2rem 1.25rem;
}
.st-room-panel h2 { font-size: 1.1rem; margin: 0; }
.st-mini-btn, .st-ready-btn, .st-start-btn, .st-place-hint button {
  border: 1px solid var(--st-line); background: rgba(127,212,196,.12);
  color: var(--st-foam); border-radius: 999px; padding: .45rem 1rem; font-weight: 700;
}
.st-mini-btn:hover, .st-ready-btn:hover { background: rgba(127,212,196,.25); }
.st-room-list { display: flex; flex-direction: column; gap: .65rem; margin-top: 1rem; }
.st-room {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: .85rem 1rem; border-radius: 12px; background: rgba(18,48,64,.7);
  border: 1px solid rgba(127,212,196,.15);
}
.st-room b { display: block; }
.st-room small { color: rgba(232,244,242,.6); }
.st-room button, .st-room a {
  border: 0; background: var(--st-amber); color: #1a1200; font-weight: 800;
  border-radius: 999px; padding: .4rem .95rem; text-decoration: none; white-space: nowrap;
}

/* Modals — class is on .modal-content itself */
.modal-content.st-create-modal {
  background: linear-gradient(165deg, #164554 0%, #0d2430 55%, #0a1c24 100%) !important;
  color: #e8f4f2 !important;
  border: 1px solid rgba(127, 212, 196, 0.35) !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55) !important;
  overflow: hidden;
}
.modal-content.st-create-modal .modal-header {
  border-bottom: 1px solid rgba(127, 212, 196, 0.22) !important;
  padding: 1.1rem 1.25rem .9rem;
  align-items: flex-start;
}
.modal-content.st-create-modal .modal-title {
  color: #fff !important;
  font-weight: 800;
  font-size: 1.25rem;
  margin: .15rem 0 0;
}
.modal-content.st-create-modal .st-eyebrow {
  color: #7fd4c4 !important;
}
.modal-content.st-create-modal .modal-body {
  color: rgba(232, 244, 242, 0.82) !important;
  padding: 1rem 1.25rem 1.25rem;
}
.modal-content.st-create-modal .modal-body > p {
  color: rgba(232, 244, 242, 0.72) !important;
  margin-bottom: 1rem;
}
.modal-content.st-create-modal .modal-footer {
  border-top: 1px solid rgba(127, 212, 196, 0.22) !important;
  padding: .85rem 1.25rem 1.1rem;
}
.modal-content.st-create-modal .btn-close {
  filter: invert(1) grayscale(1) brightness(1.4);
  opacity: .85;
}
.modal-content.st-create-modal .form-control {
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(127, 212, 196, 0.35) !important;
  color: #fff !important;
  letter-spacing: .12em;
  text-align: center;
  font-weight: 800;
}
.modal-content.st-create-modal .form-control::placeholder {
  color: rgba(232, 244, 242, 0.35);
  letter-spacing: normal;
  font-weight: 500;
}
.modal-content.st-create-modal .form-control:focus {
  box-shadow: 0 0 0 .2rem rgba(127, 212, 196, 0.25);
  border-color: #7fd4c4 !important;
}
.st-player-count-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: .65rem;
}
.st-player-count-grid button {
  border: 1px solid rgba(127, 212, 196, 0.28);
  background: linear-gradient(160deg, rgba(26, 92, 110, 0.55), rgba(8, 28, 36, 0.85));
  color: #e8f4f2;
  border-radius: 14px;
  padding: .85rem .55rem .75rem;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
  min-height: 4.6rem;
}
.st-player-count-grid button:hover,
.st-player-count-grid button:focus-visible {
  border-color: #f0b429;
  background: linear-gradient(160deg, rgba(240, 180, 41, 0.28), rgba(18, 48, 64, 0.95));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  outline: none;
}
.st-player-count-grid strong {
  display: block; font-size: 1.15rem; font-weight: 800; color: #fff;
}
.st-player-count-grid small {
  display: block; margin-top: .2rem;
  color: rgba(232, 244, 242, 0.55); font-size: .75rem;
}
.st-player-count-grid button[data-players="6"] {
  border-color: rgba(240, 180, 41, 0.55);
  box-shadow: inset 0 0 0 1px rgba(240, 180, 41, 0.2);
}
.st-player-count-grid button[data-players="6"] small { color: #f0b429; }

/* Intro */
.st-hero {
  position: relative; overflow: hidden; padding: 3.5rem 0 2.5rem;
  background: linear-gradient(120deg, rgba(26,92,110,.5), transparent 60%);
}
.st-hero::before {
  content: ""; position: absolute; inset: -20% 40% auto -10%; height: 70%;
  background: radial-gradient(circle, rgba(240,180,41,.18), transparent 70%);
  pointer-events: none;
}
.st-info-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0;
}
@media (max-width: 768px) { .st-info-grid { grid-template-columns: 1fr; } }
.st-info-grid article {
  background: rgba(11,28,36,.6); border: 1px solid var(--st-line);
  border-radius: 16px; padding: 1.2rem;
}
.st-info-grid b { color: var(--st-amber); font-size: .85rem; letter-spacing: .08em; }
.st-info-grid h2 { font-size: 1.15rem; margin: .4rem 0 .5rem; }
.st-rule-panel {
  display: grid; grid-template-columns: 1.4fr .8fr; gap: 1.2rem; align-items: center;
  background: rgba(18,48,64,.65); border-radius: 18px; padding: 1.4rem; border: 1px solid var(--st-line);
  margin-bottom: 2rem;
}
@media (max-width: 768px) { .st-rule-panel { grid-template-columns: 1fr; } }
.st-score-mini {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem .75rem;
  font-size: .82rem; color: rgba(232,244,242,.8);
}
.st-score-mini span { color: var(--st-mint); font-weight: 700; }

.st-shell {
  max-width: 1180px; margin: 0 auto; padding: .75rem 1rem 3rem;
}
.st-top {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.st-top a, .st-leave-btn {
  color: var(--st-mint); background: transparent; border: 1px solid var(--st-line);
  border-radius: 999px; padding: .35rem .85rem; text-decoration: none; font-size: .9rem;
}
.st-top strong { display: block; font-size: 1.05rem; }
.st-top span { font-size: .8rem; color: rgba(232,244,242,.55); }
.st-live-pill {
  font-size: .72rem; letter-spacing: .12em; font-weight: 800;
  color: var(--st-amber); border: 1px solid rgba(240,180,41,.4);
  border-radius: 999px; padding: .3rem .7rem;
}

/* Waiting */
.st-waiting {
  background: rgba(11,28,36,.78); border: 1px solid var(--st-line);
  border-radius: 22px; padding: 1.1rem 1.25rem 1.35rem; box-shadow: var(--st-shadow);
  overflow: hidden;
}
.st-waiting-hero {
  margin: 0 0 1rem; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(127,212,196,.18);
  background: #0a3d3a;
  max-height: none;
}
.st-banner-img {
  display: block; width: 100%; height: auto;
  max-height: 96px; object-fit: contain; object-position: center;
  background: #0a3d3a;
}
.st-banner-compact {
  max-height: 48px; height: auto; border-radius: 10px;
}
.st-waiting header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.st-waiting-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.st-waiting h2 { margin: .2rem 0 0; font-size: 1.35rem; }
.st-waiting-lead { color: rgba(232,244,242,.7); margin: .55rem 0 0; font-size: .92rem; }

.st-waiting-players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: .7rem; margin: 1rem 0;
  max-height: 340px; overflow: auto; min-height: 5rem;
}
.st-empty-players {
  grid-column: 1 / -1; margin: 0; padding: 1rem;
  color: rgba(232,244,242,.45); text-align: center;
}

/* Uniform player cards */
.st-pcard {
  display: grid;
  grid-template-columns: 2.2rem 1fr 2.2rem;
  align-items: center;
  gap: .55rem;
  height: 4.1rem;
  padding: .55rem .6rem;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(18,48,64,.95), rgba(11,28,36,.9));
  border: 1px solid rgba(127,212,196,.16);
  min-width: 0;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.st-pcard.me { border-color: rgba(127,212,196,.45); box-shadow: inset 0 0 0 1px rgba(127,212,196,.12); }
.st-pcard.ready {
  border-color: rgba(127,212,196,.55);
  background: linear-gradient(160deg, rgba(26,92,110,.55), rgba(18,48,64,.95));
}
.st-pcard-seat {
  width: 2.15rem; height: 2.15rem; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--st-teal); font-weight: 800; font-size: .82rem;
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.st-pcard-body { min-width: 0; overflow: hidden; }
.st-pcard-name {
  display: flex; align-items: center; gap: .28rem;
  min-width: 0; font-weight: 800; font-size: .9rem; line-height: 1.2;
}
.st-pcard-name > span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.st-pcard-name .st-host {
  flex-shrink: 0; color: var(--st-amber); font-size: .78rem;
}
.st-pcard-name .st-me-tag {
  flex-shrink: 0; font-size: .68rem; font-weight: 700;
  color: rgba(232,244,242,.45);
}
.st-pcard-status {
  width: 2.15rem; height: 2.15rem; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 1rem; border: 1px solid transparent;
}
.st-pcard-status.is-ready {
  background: rgba(127,212,196,.2); color: var(--st-mint);
  border-color: rgba(127,212,196,.45);
  box-shadow: 0 0 12px rgba(127,212,196,.25);
}
.st-pcard-status.is-wait {
  background: rgba(232,244,242,.06); color: rgba(232,244,242,.4);
  border-color: rgba(232,244,242,.12);
}
.st-pcard-status.is-wait i { animation: st-wait-tick 1.4s ease-in-out infinite; }
@keyframes st-wait-tick {
  0%, 100% { opacity: .45; transform: rotate(0deg); }
  50% { opacity: 1; transform: rotate(12deg); }
}

.st-waiting-chat {
  border-top: 1px solid var(--st-line); padding-top: .85rem; margin-top: .5rem;
}
.st-chat-messages {
  height: 120px; overflow: auto; font-size: .88rem; margin-bottom: .5rem;
  color: rgba(232,244,242,.8);
}
.st-chat-messages .empty { color: rgba(232,244,242,.4); }
.st-waiting-chat form { display: flex; gap: .5rem; }
.st-waiting-chat input {
  flex: 1; border-radius: 999px; border: 1px solid var(--st-line);
  background: rgba(0,0,0,.25); color: var(--st-foam); padding: .5rem 1rem;
}
.st-waiting-chat button {
  border: 0; border-radius: 999px; background: var(--st-mint); color: #062018;
  font-weight: 800; padding: .5rem 1rem;
}
.st-waiting-actions {
  display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; justify-content: flex-end;
}
.st-ready-btn.is-ready { background: rgba(240,180,41,.2); border-color: var(--st-amber); color: var(--st-amber); }
.st-start-btn {
  background: linear-gradient(120deg, var(--st-amber), #f5d76e); color: #1a1200;
  border: 0; padding: .55rem 1.3rem;
}
.st-start-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ===== Game sheet (scoresheet-inspired) ===== */

.st-sheet {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 220px;
  gap: .85rem; align-items: start;
}
@media (max-width: 980px) {
  .st-sheet { grid-template-columns: 1fr; }
  .st-scorecard { order: 2; }
  .st-sheet-side { order: 3; }
}

.st-scorecard {
  background: linear-gradient(180deg, #f4f1ea 0%, #e8e2d6 100%);
  color: #1a1a1a; border-radius: 16px; padding: .75rem .65rem;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: var(--st-shadow);
}
.st-scorecard-title {
  display: flex; justify-content: space-between; font-weight: 900;
  font-size: .85rem; margin-bottom: .45rem; color: #2a2a2a;
}
.st-score-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.st-score-list { list-style: none; margin: 0; padding: 0; }
.st-score-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: .18rem .28rem; border-radius: 6px; font-size: .72rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.st-score-list li em { font-style: normal; font-weight: 800; color: #555; }
.st-score-list li b { font-weight: 800; color: #0d5c4d; }
.st-score-list li.hot b { color: #b45309; }
@media (max-width: 980px) {
  .st-scorecard { padding: .7rem 1rem; }
  .st-score-cols { grid-template-columns: repeat(4, 1fr); }
  .st-score-list li { font-size: .78rem; }
}

.st-sheet-main {
  background: rgba(11,28,36,.72); border: 1px solid var(--st-line);
  border-radius: 20px; padding: .9rem 1rem 1.15rem; box-shadow: var(--st-shadow);
  min-width: 0;
}
.st-sheet-brand {
  display: flex; align-items: center; gap: .65rem; margin-bottom: .65rem;
}
.st-sheet-brand .st-banner-compact {
  flex: 1; min-width: 0; width: 100%; height: auto; max-height: 44px;
  object-fit: contain; object-position: left center;
  border: 1px solid rgba(127,212,196,.2); border-radius: 10px;
  background: #0a3d3a;
}
.st-logo-word {
  font-family: var(--st-font-display); font-size: clamp(1rem, 2.6vw, 1.35rem);
  letter-spacing: .04em; color: #fff;
  text-shadow: 0 2px 0 #1a5c6e, 0 6px 18px rgba(0,0,0,.35);
  white-space: nowrap; flex-shrink: 0;
}

.st-sheet-side { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.st-tile-legend .st-tiles {
  display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .45rem;
}
.st-tile {
  display: inline-grid; place-items: center;
  min-width: 2.4rem; height: 1.85rem; padding: 0 .45rem;
  border-radius: 8px; font-size: .72rem; font-weight: 800;
  background: linear-gradient(180deg, #fff8e7, #f0e0c0); color: #2a2112;
  box-shadow: 0 2px 0 rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.7);
}
.st-tile.stack { background: linear-gradient(180deg, #e8f6f3, #c5e8e0); color: #0d4a40; }
.st-tile.joker {
  background: linear-gradient(180deg, #ffe08a, #f0b429); color: #3a2a00;
  font-size: 1rem; min-width: 1.85rem;
}
.st-tile-note {
  margin: 0; font-size: .75rem; color: rgba(232,244,242,.55);
  display: flex; flex-wrap: wrap; gap: .35rem .7rem;
}

/* Stream path board */
.st-board-wrap {
  background: linear-gradient(180deg, rgba(244,241,234,.97), rgba(232,226,214,.95));
  border: 2px solid rgba(255,255,255,.4);
  border-radius: 18px; padding: .9rem .85rem 1rem; margin-bottom: 0;
  color: #1a1a1a;
}
.st-board-wrap h3 {
  font-size: .88rem; margin: 0 0 .75rem; color: #2f5d55; font-weight: 800;
}
.st-stream {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: .32rem .28rem;
}
.st-stream .st-cell {
  aspect-ratio: 1.15 / 1;
  border-radius: 0;
  clip-path: polygon(0% 0%, 78% 0%, 100% 50%, 78% 100%, 0% 100%, 14% 50%);
  border: none;
  background: linear-gradient(160deg, #ffffff, #ebe4d6);
  box-shadow: 0 2px 0 rgba(0,0,0,.12), inset 0 0 0 1.5px rgba(0,0,0,.08);
  color: #1f1f1f;
  font-weight: 800;
}
.st-stream .st-cell:nth-child(n+11) {
  clip-path: polygon(22% 0%, 100% 0%, 86% 50%, 100% 100%, 22% 100%, 0% 50%);
}
.st-stream .st-cell.empty-hint { color: rgba(0,0,0,.18); }
.st-stream .st-cell.placeable {
  background: linear-gradient(160deg, #fff6d6, #ffe08a);
  box-shadow: 0 0 0 2px rgba(240,180,41,.55), 0 4px 12px rgba(240,180,41,.25);
  animation: st-cell-glow 1.2s ease-in-out infinite alternate;
}
@keyframes st-cell-glow {
  from { filter: brightness(1); }
  to { filter: brightness(1.06); }
}
.st-stream .st-cell.placeable:hover,
.st-stream .st-cell.placeable:focus-visible {
  transform: scale(1.06); background: linear-gradient(160deg, #ffe9a8, #f0b429);
}
.st-stream .st-cell.filled {
  background: linear-gradient(160deg, #1a5c6e, #123040);
  color: #e8f4f2;
  box-shadow: 0 3px 0 rgba(0,0,0,.2), inset 0 0 0 1px rgba(127,212,196,.35);
  cursor: default;
}
.st-stream .st-cell.filled.is-joker {
  background: linear-gradient(160deg, #f0b429, #c98912);
  color: #1a1200;
}
.st-stream .st-cell.pending {
  background: linear-gradient(160deg, #7fd4c4, #1a5c6e); color: #062018;
}
.st-stream .st-cell.disabled:not(.filled):not(.placeable) { opacity: .7; }
.st-stream .st-cell.stream-hi {
  box-shadow: 0 0 0 2px #f0b429, 0 4px 14px rgba(240,180,41,.35);
}
@media (max-width: 560px) {
  .st-stream { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .st-stream .st-cell:nth-child(n+11) {
    clip-path: polygon(0% 0%, 78% 0%, 100% 50%, 78% 100%, 0% 100%, 14% 50%);
  }
  .st-stream .st-cell:nth-child(n+6):nth-child(-n+10),
  .st-stream .st-cell:nth-child(n+16) {
    clip-path: polygon(22% 0%, 100% 0%, 86% 50%, 100% 100%, 22% 100%, 0% 50%);
  }
}

.st-peek-board.st-stream {
  background: transparent;
}
.st-peek-board .st-cell { font-size: .8rem; pointer-events: none; cursor: default; }

/* Game area */
.st-game { display: none; }
.st-game.is-on { display: block; }
.st-waiting.is-off { display: none; }

.st-reveal-stage {
  position: relative; min-height: 200px; display: grid; place-items: center;
  margin: .5rem 0 1.1rem; border-radius: 20px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(240,180,41,.22), transparent 55%),
    linear-gradient(160deg, rgba(26,92,110,.55), rgba(11,28,36,.9));
  border: 1px solid var(--st-line);
}
.st-reveal-stage.is-writing {
  background: linear-gradient(160deg, rgba(18,48,64,.9), rgba(11,28,36,.95));
}
.st-reveal-stage.is-scrambling {
  animation: st-stage-shake .35s ease-in-out infinite;
}
@keyframes st-stage-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}
.st-reveal-pulse {
  position: absolute; inset: 18% 22%; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,180,41,.35), transparent 70%);
  opacity: 0; pointer-events: none;
}
.st-reveal-pulse.is-on { animation: st-pulse-ring 1.1s ease-out infinite; }
@keyframes st-pulse-ring {
  0% { opacity: .7; transform: scale(.6); }
  100% { opacity: 0; transform: scale(1.35); }
}
.st-reveal-caption {
  position: absolute; bottom: .85rem; left: 0; right: 0;
  text-align: center; font-size: .78rem; letter-spacing: .14em;
  font-weight: 800; color: rgba(232,244,242,.55); z-index: 2;
  text-transform: uppercase;
}
.st-reveal-caption.is-hot { color: var(--st-amber); }
.st-round-meta {
  position: absolute; top: .75rem; left: 1rem; right: 1rem;
  display: flex; justify-content: space-between; font-size: .8rem;
  color: rgba(232,244,242,.65); z-index: 2;
}
.st-timer {
  font-variant-numeric: tabular-nums; font-weight: 800; color: var(--st-amber);
}
.st-timer.is-urgent { color: var(--st-coral); animation: st-pulse .6s ease infinite alternate; }
@keyframes st-pulse { from { opacity: 1; } to { opacity: .55; } }

.st-reveal-number {
  font-family: var(--st-font-display);
  font-size: clamp(3.5rem, 14vw, 6.5rem);
  line-height: 1; color: #fff; text-shadow: 0 0 40px rgba(240,180,41,.55), 0 8px 24px rgba(0,0,0,.45);
  transform: scale(.85); opacity: .35; filter: blur(4px);
  z-index: 1;
}
.st-reveal-number.is-scramble {
  opacity: .85; filter: blur(0); transform: scale(1);
  animation: st-tick-blur .08s linear infinite;
}
@keyframes st-tick-blur {
  0%, 100% { filter: blur(0); letter-spacing: 0; }
  50% { filter: blur(1px); letter-spacing: .04em; }
}
.st-reveal-number.is-show {
  animation: st-slam 1.25s cubic-bezier(.15,1.35,.35,1) forwards;
}
.st-reveal-number.is-joker { color: var(--st-amber); }
.st-reveal-number.is-idle {
  transform: scale(1); opacity: 1; filter: none; animation: none;
  font-size: clamp(2.4rem, 8vw, 3.8rem);
}
@keyframes st-slam {
  0% { transform: scale(2.6) rotate(-10deg); opacity: 0; filter: blur(18px); }
  40% { transform: scale(.82) rotate(4deg); opacity: 1; filter: blur(0); }
  62% { transform: scale(1.14) rotate(-2deg); }
  82% { transform: scale(.97); }
  100% { transform: scale(1); opacity: 1; filter: none; }
}
.st-reveal-flash {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 0;
  background: radial-gradient(circle, rgba(255,255,255,.55), transparent 60%);
}
.st-reveal-flash.is-on { animation: st-flash .7s ease-out forwards; }
@keyframes st-flash {
  0% { opacity: .9; }
  100% { opacity: 0; }
}
.st-status-line {
  text-align: center; font-size: .92rem; color: rgba(232,244,242,.75); margin: 0 0 .9rem;
}
.st-warn-banner {
  text-align: center; margin: 0 0 .85rem; padding: .55rem .9rem;
  border-radius: 12px; border: 1px solid rgba(240,180,41,.45);
  background: rgba(240,180,41,.12); color: var(--st-amber); font-weight: 700; font-size: .88rem;
}
.st-warn-banner.is-out {
  border-color: rgba(232,93,76,.5); background: rgba(232,93,76,.15); color: #ffb4a8;
}
.st-panel h3 small { font-weight: 500; color: rgba(232,244,242,.4); margin-left: .35rem; }
.st-submit-list button.st-player-link {
  all: unset; cursor: pointer; color: inherit; display: flex;
  justify-content: space-between; gap: .5rem; align-items: center; width: 100%;
  padding: .35rem 0; border-bottom: 1px solid rgba(127,212,196,.08);
  min-width: 0;
}
.st-submit-list button.st-player-link:hover .st-player-name { color: var(--st-amber); }
.st-player-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1;
  font-weight: 700;
}
.st-player-state {
  flex-shrink: 0; font-size: .78rem; display: inline-flex; align-items: center; gap: .2rem;
  white-space: nowrap;
}
.st-submit-list .out { opacity: .55; }
.st-submit-list .out .st-player-state { color: var(--st-coral); }
.st-submit-list .warn .st-player-state { color: var(--st-amber); }
.st-submit-list .ok .st-player-state { color: var(--st-mint); }

.st-peek-modal {
  background: linear-gradient(160deg, #143848, #0d2430); color: var(--st-foam);
  border: 1px solid var(--st-line);
}
.st-peek-meta { color: rgba(232,244,242,.65); font-size: .88rem; }
.st-peek-board { pointer-events: none; }
.st-peek-board .st-cell { cursor: default; font-size: .85rem; }
.st-rank-row.out { opacity: .7; }
.st-rank-row .st-out-badge {
  display: inline-block; margin-left: .35rem; padding: .1rem .4rem;
  border-radius: 999px; background: rgba(232,93,76,.25); color: #ffb4a8;
  font-size: .68rem; font-weight: 800; letter-spacing: .04em;
}

.st-progress {
  display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin-bottom: 1rem;
}
.st-progress i {
  width: .55rem; height: .55rem; border-radius: 50%;
  background: rgba(232,244,242,.2); display: block;
}
.st-progress i.done { background: var(--st-mint); }
.st-progress i.now { background: var(--st-amber); box-shadow: 0 0 8px rgba(240,180,41,.7); }

/* Legacy square board fallback (peek / ranking mini) */
.st-board {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: .4rem;
}
@media (max-width: 560px) {
  .st-board { grid-template-columns: repeat(5, 1fr); gap: .35rem; }
}
.st-cell {
  aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed rgba(127,212,196,.35);
  background: rgba(0,0,0,.22); display: grid; place-items: center;
  font-family: var(--st-font-display); font-size: clamp(.95rem, 3.2vw, 1.25rem);
  color: var(--st-foam); cursor: pointer; transition: transform .12s, border-color .12s, background .12s;
  user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.st-cell.empty-hint { color: rgba(232,244,242,.22); font-size: clamp(.7rem, 2.4vw, .9rem); font-weight: 700; }
.st-cell.placeable {
  border-color: rgba(240,180,41,.55); background: rgba(240,180,41,.08);
  box-shadow: 0 0 0 1px rgba(240,180,41,.15);
}
.st-cell.placeable:hover, .st-cell.placeable:focus-visible {
  border-color: var(--st-amber); background: rgba(240,180,41,.2); transform: scale(1.05);
  outline: none;
}
.st-cell:hover:not(.filled):not(.disabled) {
  border-color: var(--st-amber); background: rgba(240,180,41,.12); transform: scale(1.04);
}
.st-cell.filled {
  border-style: solid; border-color: rgba(127,212,196,.45);
  background: linear-gradient(160deg, rgba(26,92,110,.75), rgba(18,48,64,.9));
  cursor: default; color: var(--st-foam);
}
.st-cell.filled.is-joker { color: var(--st-amber); border-color: rgba(240,180,41,.55); }
.st-cell.pending { border-style: solid; border-color: var(--st-mint); color: var(--st-mint); }
.st-cell.disabled { opacity: .55; cursor: not-allowed; }
.st-cell.disabled.empty-hint { opacity: .35; }
.st-cell.stream-hi { box-shadow: inset 0 0 0 2px var(--st-amber); }
.st-cell.placeable:not(.disabled) { opacity: 1; }

.st-submit-list > div {
  display: flex; justify-content: space-between; gap: .5rem; align-items: baseline;
}
.st-submit-list > div b { font-weight: 700; }
.st-submit-list > div span { font-size: .8rem; }

.st-toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(120%);
  background: rgba(11,28,36,.95); color: var(--st-foam); border: 1px solid var(--st-line);
  border-radius: 999px; padding: .7rem 1.25rem; font-weight: 700; font-size: .92rem;
  z-index: 9999; opacity: 0; transition: transform .25s ease, opacity .25s ease;
  box-shadow: var(--st-shadow); pointer-events: none; max-width: min(92vw, 360px); text-align: center;
}
.st-toast.is-on { transform: translateX(-50%) translateY(0); opacity: 1; }

.st-side {
  display: grid; grid-template-columns: 1fr 1fr; gap: .9rem;
}
@media (max-width: 720px) { .st-side { grid-template-columns: 1fr; } }
.st-panel {
  background: rgba(11,28,36,.55); border: 1px solid var(--st-line);
  border-radius: 14px; padding: .9rem 1rem;
}
.st-panel h3 { font-size: .88rem; margin: 0 0 .5rem; color: var(--st-mint); }
.st-history {
  display: flex; flex-wrap: wrap; gap: .35rem; min-height: 2rem;
}
.st-history span {
  min-width: 1.8rem; height: 1.8rem; border-radius: 8px; display: grid; place-items: center;
  background: rgba(127,212,196,.15); font-size: .8rem; font-weight: 700;
}
.st-submit-list {
  max-height: 140px; overflow: auto; font-size: .85rem;
  display: flex; flex-direction: column; gap: .3rem;
}
.st-submit-list .ok { color: var(--st-mint); }
.st-submit-list .wait { color: rgba(232,244,242,.45); }

/* Ranking */
.st-ranking {
  display: none; margin-top: 1rem;
  background: rgba(11,28,36,.75); border: 1px solid var(--st-line);
  border-radius: 20px; padding: 1.25rem; box-shadow: var(--st-shadow);
}
.st-ranking.is-on { display: block; animation: st-rank-in .5s ease; }
@keyframes st-rank-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.st-ranking h2 { font-family: var(--st-font-display); margin: 0 0 .25rem; }
.st-ranking > p { color: rgba(232,244,242,.65); margin-bottom: 1rem; }
.st-rank-list { display: flex; flex-direction: column; gap: .55rem; }
.st-rank-row {
  display: grid; grid-template-columns: 2.5rem 1fr auto; gap: .75rem; align-items: center;
  background: rgba(18,48,64,.75); border-radius: 12px; padding: .7rem .9rem;
  border: 1px solid transparent;
}
.st-rank-row.me { border-color: var(--st-mint); }
.st-rank-row.top1 { background: linear-gradient(120deg, rgba(240,180,41,.28), rgba(18,48,64,.85)); }
.st-rank-row.top2 { background: linear-gradient(120deg, rgba(180,200,210,.2), rgba(18,48,64,.85)); }
.st-rank-row.top3 { background: linear-gradient(120deg, rgba(205,127,80,.22), rgba(18,48,64,.85)); }
.st-rank-num { font-family: var(--st-font-display); font-size: 1.2rem; color: var(--st-amber); }
.st-rank-row b { display: block; }
.st-rank-row small { color: rgba(232,244,242,.55); }
.st-rank-score { font-family: var(--st-font-display); font-size: 1.35rem; color: var(--st-mint); }
.st-rank-board {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(10, 1fr); gap: .25rem;
  margin-top: .35rem;
}
@media (max-width: 560px) { .st-rank-board { grid-template-columns: repeat(5, 1fr); } }
.st-rank-board span {
  aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center;
  font-size: .72rem; font-weight: 700; background: rgba(0,0,0,.25);
  border: 1px solid rgba(127,212,196,.2);
}
.st-rank-board span.hi { border-color: var(--st-amber); color: var(--st-amber); }

.st-practice-bar {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; justify-content: center;
}
.st-practice-bar button {
  border: 1px solid var(--st-line); background: rgba(127,212,196,.15);
  color: var(--st-foam); border-radius: 999px; padding: .45rem 1rem; font-weight: 700;
}
.st-practice-bar button.primary {
  background: var(--st-amber); color: #1a1200; border-color: transparent;
}
