:root {
  color-scheme: dark;
  --bg: #010101;
  --panel: #191a24;
  --panel-2: #222434;
  --line: #36394d;
  --text: #f7f7fb;
  --muted: #aeb3c7;
  --cyan: #42e8f4;
  --yellow: #ffda5c;
  --pink: #ff4f93;
  --green: #76f0a4;
  --danger: #ff6b6b;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(95, 229, 239, 0.15), transparent 32rem),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family:
    "Pretendard",
    "Noto Sans KR",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 42px;
}

.loading-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.brand,
.topbar nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 2px solid var(--cyan);
  border-radius: 8px;
  color: var(--yellow);
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 0 18px rgba(66, 232, 244, 0.35);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.18rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.topbar nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar nav button,
.ghost-btn,
.primary-btn,
.danger-btn {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.topbar nav button:hover,
.ghost-btn:hover,
.primary-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.topbar nav button.is-active,
.primary-btn {
  border-color: rgba(66, 232, 244, 0.8);
  background: linear-gradient(135deg, #1ccad8, #7a5cff);
  color: #ffffff;
  font-weight: 800;
}

.ghost-btn:disabled,
.danger-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.danger-btn {
  border-color: rgba(255, 107, 107, 0.52);
  color: #ffd7d7;
}

.hero-grid,
.hub-layout,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
}

.panel,
.game-card,
.game-stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0)),
    var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel-heading,
.section-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.panel-heading span,
.section-title span,
.card-kicker {
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.panel-heading strong,
.section-title strong {
  font-size: clamp(1.25rem, 2vw, 1.8rem);
}

.split-heading {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.stack-form,
.admin-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #11121a;
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(66, 232, 244, 0.16);
}

.profile-edit {
  color: var(--muted);
}

.profile-edit summary {
  cursor: pointer;
  margin-bottom: 12px;
}

.section-block,
.play-hub {
  margin-top: 24px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  display: grid;
  min-height: 250px;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
  overflow: hidden;
  position: relative;
}

.game-card.is-ready {
  border-color: rgba(255, 218, 92, 0.52);
}

.game-card.is-locked {
  opacity: 0.72;
}

.game-card h2 {
  margin: 9px 0 8px;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.game-card p {
  max-width: 26ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.scoreboard {
  overflow: hidden;
}

.rank-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.035);
}

.rank-list li:nth-child(1) {
  border-color: rgba(255, 218, 92, 0.7);
}

.rank-no {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #0f1018;
  color: var(--yellow);
  font-weight: 900;
}

.rank-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.rank-list strong {
  color: var(--green);
  font-size: 1.02rem;
}

.rank-list small {
  grid-column: 2 / -1;
  color: var(--muted);
}

.empty-rank,
.empty-state {
  color: var(--muted);
  line-height: 1.6;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.empty-state.full {
  margin-top: 18px;
}

.puzzle-list,
.saved-list {
  display: grid;
  gap: 12px;
}

.puzzle-item,
.saved-puzzle {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.saved-puzzle {
  grid-template-columns: 70px minmax(0, 1fr) auto auto;
}

.puzzle-thumb,
.saved-puzzle img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: #0f1018;
}

.puzzle-thumb img,
.saved-puzzle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.puzzle-item strong,
.saved-puzzle strong {
  display: block;
}

.puzzle-item span,
.saved-puzzle span {
  color: var(--muted);
  font-size: 0.86rem;
}

.play-ready {
  width: min(520px, 100%);
  margin: 72px auto 0;
}

.game-stage {
  position: relative;
  padding: 14px;
}

.stage-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 170px;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.stage-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}

.stage-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.stage-title strong {
  color: var(--yellow);
  font-size: 1.6rem;
}

.timer-pill {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(66, 232, 244, 0.55);
  border-radius: 999px;
  background: #10111a;
  text-align: center;
}

.timer-pill span {
  position: relative;
  z-index: 1;
  display: block;
  padding: 10px 12px;
  font-weight: 900;
}

.timer-pill i {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(118, 240, 164, 0.34), rgba(255, 79, 147, 0.4));
}

.image-duel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.spot-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #0f1018;
}

.spot-image-wrap img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #0f1018;
}

.found-marker,
.miss-marker {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.found-marker {
  border: 4px solid var(--green);
  box-shadow: 0 0 18px rgba(118, 240, 164, 0.65);
}

.miss-marker::before,
.miss-marker::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 2px;
  width: 4px;
  height: 34px;
  border-radius: 999px;
  background: var(--danger);
}

.miss-marker::before {
  transform: rotate(45deg);
}

.miss-marker::after {
  transform: rotate(-45deg);
}

.result-panel {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  width: min(420px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 218, 92, 0.75);
  border-radius: 8px;
  padding: 22px;
  background: rgba(18, 19, 28, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}

.result-panel span {
  color: var(--cyan);
  font-weight: 900;
  letter-spacing: 0.14em;
}

.result-panel strong {
  display: block;
  margin: 8px 0;
  color: var(--yellow);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
}

.result-panel p {
  color: var(--muted);
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.admin-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
}

.wide-label {
  max-width: 520px;
}

.upload-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-image-card {
  display: grid;
  gap: 8px;
}

.admin-image-card > strong {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-image-wrap {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: #10111a;
}

.admin-image-wrap:not(.is-empty) {
  cursor: crosshair;
}

.admin-image-wrap img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.admin-image-wrap > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.admin-marker {
  position: absolute;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid #10111a;
  border-radius: 50%;
  background: var(--yellow);
  color: #111;
  font-weight: 900;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(255, 218, 92, 0.28);
}

.admin-marker.is-selected {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(255, 79, 147, 0.28);
}

.spot-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.spot-toolbar span {
  color: var(--muted);
}

.spot-table {
  display: grid;
  gap: 8px;
}

.spot-row {
  display: grid;
  grid-template-columns: 44px 30px 30px minmax(110px, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.spot-row.is-selected {
  border-color: var(--pink);
}

.spot-row > button:first-child,
.spot-row > span {
  display: grid;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10111a;
}

.spot-row > button:first-child {
  color: var(--yellow);
  font-weight: 900;
}

.spot-row > span {
  color: #656b82;
  font-weight: 900;
}

.spot-row > span.is-set {
  color: var(--green);
}

.spot-row label {
  grid-template-columns: auto minmax(66px, 1fr);
  align-items: center;
}

.spot-row input {
  min-height: 34px;
}

.save-puzzle {
  justify-self: start;
}

.admin-lock {
  width: min(460px, 100%);
  margin: 72px auto 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  max-width: min(560px, calc(100% - 32px));
  transform: translate(-50%, 20px);
  border: 1px solid rgba(66, 232, 244, 0.55);
  border-radius: 8px;
  padding: 12px 16px;
  background: rgba(16, 17, 26, 0.95);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.stage-number {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid var(--cyan);
  border-radius: 8px;
  background: rgba(66, 232, 244, 0.08);
}

.stage-number span {
  color: var(--cyan);
  font-size: 1.2rem;
  font-weight: 900;
}

.stage-item {
  grid-template-columns: 48px minmax(0, 1fr);
}

.stage-start-btn {
  margin-top: 16px;
  width: 100%;
  min-height: 52px;
  font-size: 1.1rem;
}

.result-next-hint {
  color: var(--cyan);
  font-size: 0.9rem;
  animation: pulse-hint 1s ease infinite;
}

@keyframes pulse-hint {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 18, 0.92);
  backdrop-filter: blur(8px);
}

.countdown-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.countdown-label {
  color: var(--cyan);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.countdown-stage {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--text);
}

.countdown-name {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 16px;
}

.countdown-number {
  display: grid;
  width: 120px;
  height: 120px;
  place-items: center;
  border: 3px solid var(--cyan);
  border-radius: 50%;
  color: var(--yellow);
  font-size: 4rem;
  font-weight: 900;
  box-shadow: 0 0 40px rgba(66, 232, 244, 0.3);
  animation: countdown-pop 1s ease;
}

@keyframes countdown-pop {
  0% { transform: scale(1.3); opacity: 0; }
  30% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 900px) {
  .hero-grid,
  .hub-layout,
  .admin-layout,
  .game-grid,
  .admin-images,
  .upload-row,
  .image-duel {
    grid-template-columns: 1fr;
  }

  .stage-top {
    grid-template-columns: 1fr;
  }

  .stage-title {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar nav {
    width: 100%;
  }

  .topbar nav button {
    flex: 1;
    padding: 0 10px;
  }

  .puzzle-item,
  .saved-puzzle {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .stage-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .puzzle-item .primary-btn,
  .saved-puzzle button {
    grid-column: 1 / -1;
  }

  .spot-row {
    grid-template-columns: 40px 28px 28px 1fr;
  }

  .spot-row .danger-btn {
    grid-column: 1 / -1;
  }
}

/* Visual refresh: neon arcade dashboard */
:root {
  --bg: #070913;
  --panel: #111625;
  --panel-2: #171d31;
  --line: rgba(157, 170, 226, 0.18);
  --text: #f8f8ff;
  --muted: #98a0ba;
  --cyan: #42f2ef;
  --yellow: #ffd35c;
  --pink: #b45cff;
  --green: #55f4ad;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

html {
  background:
    radial-gradient(circle at 18% 6%, rgba(120, 86, 255, 0.28), transparent 28rem),
    radial-gradient(circle at 84% 14%, rgba(61, 240, 232, 0.12), transparent 24rem),
    linear-gradient(180deg, #070913 0%, #090c18 48%, #060814 100%);
  background-attachment: fixed;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 130px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 96px);
}

.app-shell {
  width: min(1440px, calc(100% - 48px));
  padding-top: 26px;
}

.topbar {
  min-height: 104px;
  margin: 0 calc(50% - 50vw) 28px;
  padding: 24px max(24px, calc((100vw - 1440px) / 2 + 24px));
  border-bottom: 1px solid rgba(154, 165, 225, 0.16);
  background: linear-gradient(180deg, rgba(9, 12, 25, 0.92), rgba(9, 12, 25, 0.62));
  backdrop-filter: blur(16px);
}

.brand {
  gap: 18px;
}

.brand-mark {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background:url('logo_sh.png') center center no-repeat;
  background-size: contain;
  color: #ffffff;
  font-size: 1.12rem;
  box-shadow:
    0 0 0 1px rgba(180, 92, 255, 0.45),
    0 0 30px rgba(76, 226, 255, 0.28),
    inset 0 0 24px rgba(180, 92, 255, 0.22);
}

.brand strong {
  font-size: clamp(1.55rem, 2vw, 2.15rem);
  letter-spacing: 0;
}

.brand small {
  margin-bottom: 4px;
  color: #a775ff;
  font-size: 0.82rem;
  font-weight: 900;
}

.topbar nav {
  padding: 8px;
  border: 1px solid rgba(154, 165, 225, 0.14);
  border-radius: 22px;
  background: rgba(17, 22, 37, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.topbar nav button,
.ghost-btn,
.primary-btn,
.danger-btn {
  min-height: 46px;
  border-radius: 16px;
  border-color: rgba(154, 165, 225, 0.18);
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.035);
  color: #d6dcf7;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.topbar nav button.is-active,
.primary-btn {
  border-color: rgba(87, 241, 237, 0.52);
  background: linear-gradient(135deg, #25ddec, #7658ff 68%, #a64dff);
  color: #ffffff;
  box-shadow:
    0 12px 28px rgba(86, 91, 255, 0.26),
    0 0 22px rgba(66, 242, 239, 0.18);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.04);
}

.panel,
.game-card,
.game-stage {
  border-color: rgba(154, 165, 225, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015)),
    rgba(18, 23, 39, 0.88);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.panel {
  padding: 24px;
}

.hero-grid,
.hub-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 26px;
}

.section-block,
.play-hub {
  margin-top: 28px;
}

.section-title {
  margin-bottom: 26px;
}

.panel-heading span,
.section-title span,
.card-kicker {
  color: #a775ff;
  font-size: 0.82rem;
  font-weight: 900;
}

.panel-heading strong,
.section-title strong {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 1.12;
}

.game-grid {
  grid-template-columns: minmax(320px, 1.05fr) repeat(2, minmax(240px, 0.8fr));
  gap: 22px;
}

.game-card {
  min-height: 430px;
  padding: 28px;
  isolation: isolate;
  background:
    radial-gradient(circle at 48% 34%, rgba(70, 241, 235, 0.2), transparent 0 21%, transparent 36%),
    radial-gradient(circle at 58% 36%, rgba(179, 85, 255, 0.26), transparent 0 18%, transparent 38%),
    linear-gradient(160deg, rgba(43, 65, 117, 0.9), rgba(18, 21, 43, 0.92) 48%, rgba(26, 17, 64, 0.9));
}

.game-card.is-ready {
  border: 2px solid rgba(66, 242, 239, 0.82);
  box-shadow:
    0 0 0 1px rgba(180, 92, 255, 0.55),
    0 28px 90px rgba(73, 69, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.game-card.is-locked {
  min-height: 390px;
  border-color: rgba(154, 165, 225, 0.18);
  background:
    radial-gradient(circle at 54% 38%, rgba(255, 198, 102, 0.2), transparent 0 19%, transparent 38%),
    linear-gradient(160deg, rgba(40, 45, 70, 0.92), rgba(20, 22, 38, 0.92));
  opacity: 1;
}

.game-card.is-locked:nth-child(3) {
  background:
    radial-gradient(circle at 56% 38%, rgba(180, 92, 255, 0.3), transparent 0 20%, transparent 40%),
    linear-gradient(160deg, rgba(44, 35, 91, 0.92), rgba(20, 22, 38, 0.92));
}

.game-card h2 {
  margin-top: 230px;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.06;
}

.game-card p {
  color: #b5bdd7;
  font-size: 1.02rem;
}

.card-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(2, 8, 20, 0.72);
  color: var(--cyan);
}

.card-meta span {
  border-color: rgba(154, 165, 225, 0.2);
  padding: 10px 15px;
  background: rgba(9, 13, 29, 0.55);
  color: #d6dcf7;
  font-weight: 800;
}

.scoreboard {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015)),
    rgba(19, 24, 41, 0.92);
}

.rank-list {
  gap: 12px;
}

.rank-list li {
  min-height: 74px;
  border-color: rgba(154, 165, 225, 0.12);
  border-radius: 18px;
  padding: 13px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
}

.rank-list li:nth-child(1) {
  border-color: rgba(255, 211, 92, 0.75);
  background:
    linear-gradient(135deg, rgba(255, 211, 92, 0.12), rgba(255, 255, 255, 0.026)),
    rgba(17, 22, 37, 0.82);
}

.rank-no {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    linear-gradient(145deg, #ffe782, #f49b36);
  color: #402713;
  box-shadow: 0 8px 20px rgba(255, 168, 52, 0.24);
}

.rank-list li:nth-child(n + 2) .rank-no {
  background: linear-gradient(145deg, #eef4ff, #6f7a98);
  color: #101522;
}

.rank-list li:nth-child(n + 4) .rank-no {
  background: #101522;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(154, 165, 225, 0.18);
}

.rank-list strong {
  color: var(--green);
  font-size: 1.16rem;
}

.profile-panel {
  background:
    radial-gradient(circle at 20% 0%, rgba(180, 92, 255, 0.16), transparent 24rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)),
    rgba(18, 23, 39, 0.9);
}

input {
  border-radius: 14px;
  border-color: rgba(154, 165, 225, 0.18);
  background: rgba(6, 9, 20, 0.72);
}

.puzzle-item,
.saved-puzzle,
.spot-row {
  border-color: rgba(154, 165, 225, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.game-stage {
  padding: 22px;
}

.stage-top {
  margin-bottom: 18px;
}

.timer-pill {
  border-color: rgba(66, 242, 239, 0.42);
  background: rgba(5, 9, 21, 0.78);
}

.spot-image-wrap,
.admin-image-wrap {
  border-color: rgba(154, 165, 225, 0.18);
  border-radius: 22px;
  background: rgba(5, 9, 21, 0.82);
}

.result-panel,
.countdown-content {
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(13, 17, 31, 0.94);
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 28px, 1180px);
  }

  .topbar {
    margin-bottom: 22px;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-card,
  .game-card.is-locked {
    min-height: 360px;
  }

  .game-card h2 {
    margin-top: 180px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .panel {
    padding: 18px;
  }

  .game-card {
    padding: 22px;
  }
}

/* Clean collectible card redesign */
:root {
  color-scheme: light;
  --bg: #f2f0ea;
  --panel: #ffffff;
  --panel-2: #f6f6f0;
  --line: rgba(25, 28, 40, 0.1);
  --text: #15151d;
  --muted: #6f7280;
  --cyan: #24c7d9;
  --yellow: #ffe84a;
  --pink: #ff77b8;
  --green: #27d68b;
  --danger: #f14f4f;
  --shadow: 0 18px 42px rgba(32, 32, 44, 0.12);
}

html {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.62) 0 2px, transparent 2px 38px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.62) 0 2px, transparent 2px 38px),
    linear-gradient(135deg, #f7f5ef 0%, #ededf5 46%, #e7f8ef 100%);
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 119, 184, 0.16), transparent 24rem),
    radial-gradient(circle at 85% 18%, rgba(36, 199, 217, 0.14), transparent 22rem);
}

.app-shell {
  width: min(1320px, calc(100% - 56px));
  padding: 22px 0 44px;
}

.topbar {
  min-height: auto;
  margin: 0 0 30px;
  padding: 16px 18px;
  border: 1px solid rgba(24, 28, 42, 0.1);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 42px rgba(24, 28, 42, 0.1);
  backdrop-filter: blur(18px);
}

.brand {
  gap: 14px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 18px;
  color: #10131f;
  font-weight: 1000;
  box-shadow: 0 12px 26px rgba(50, 91, 160, 0.22);
}

.brand small {
  color: #333;
  font-weight: 950;
}

.brand strong {
  color: #10131f;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
}

.topbar nav {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.topbar nav button,
.ghost-btn,
.primary-btn,
.danger-btn {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(24, 28, 42, 0.09);
  background: #f5f4f0;
  color: #202333;
  box-shadow: none;
}

.topbar nav button.is-active,
.primary-btn {
  border: 0;
  background: #141720;
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(20, 23, 32, 0.18);
}

.ghost-btn {
  background: #ffffff;
}

.panel,
.game-card,
.game-stage {
  border: 1px solid rgba(24, 28, 42, 0.09);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  color: var(--text);
}

.panel {
  padding: 24px;
}

.hero-grid,
.hub-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.82fr);
  gap: 24px;
}

.section-block,
.play-hub {
  margin-top: 28px;
}

.panel-heading span,
.section-title span,
.card-kicker {
  color: #333;
  font-size: 0.78rem;
  font-weight: 950;
}

.panel-heading strong,
.section-title strong {
  color: #11131d;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  letter-spacing: 0;
}

.section-title {
  margin-bottom: 22px;
}

.game-grid {
  grid-template-columns: minmax(280px, 1.08fr) repeat(2, minmax(220px, 0.86fr));
  gap: 22px;
  align-items: stretch;
}

.game-card {
  min-height: 440px;
  padding: 22px;
  border: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(145deg, #28e66d 0%, #20d96a 100%);
  box-shadow: 0 22px 42px rgba(36, 154, 85, 0.2);
}

.game-card.is-ready {
  border: 0;
  box-shadow:
    0 24px 48px rgba(36, 154, 85, 0.22),
    0 0 0 8px rgba(255, 255, 255, 0.58);
}

.game-card.is-locked {
  min-height: 390px;
  opacity: 1;
  background:
    linear-gradient(145deg, #ffae44 0%, #ffce65 100%);
  box-shadow: 0 20px 40px rgba(225, 143, 52, 0.18);
}

.game-card.is-locked:nth-child(3) {
  background:
    linear-gradient(145deg, #4cc8ff 0%, #397dff 100%);
  box-shadow: 0 20px 40px rgba(61, 125, 255, 0.18);
}

.game-card h2 {
  margin: 246px 0 10px;
  color: #10131f;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.02;
}

.game-card p {
  max-width: 22ch;
  color: rgba(16, 19, 31, 0.68);
  font-size: 1rem;
  font-weight: 700;
}

.card-kicker {
  display: inline-flex;
  width: fit-content;
  border-radius: 12px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.55);
  color: #10131f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.card-meta {
  position: relative;
  z-index: 1;
}

.card-meta span {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: #10131f;
  font-weight: 900;
}

.scoreboard,
.profile-panel {
  background: #ffffff;
}
.scoreboard{margin-top:1em;}
.rank-list {
  gap: 12px;
}

.rank-list li {
  min-height: 72px;
  border: 1px solid rgba(24, 28, 42, 0.08);
  border-radius: 22px;
  background: #f8f7f2;
}

.rank-list li:nth-child(1) {
  border-color: rgba(255, 187, 58, 0.72);
  background: #fff6d5;
}

.rank-no {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: #ffd84f;
  color: #10131f;
  box-shadow: none;
}

.rank-list li:nth-child(n + 2) .rank-no {
  background: #e4e7ef;
  color: #10131f;
}

.rank-list strong {
  color: #18b977;
}

.rank-name {
  color: #11131d;
}

.rank-list small,
.empty-rank,
.empty-state,
.puzzle-item span,
.saved-puzzle span,
.profile-edit {
  color: var(--muted);
}

input {
  border-radius: 18px;
  border-color: rgba(24, 28, 42, 0.1);
  background: #f7f6f1;
  color: #11131d;
}

.puzzle-item,
.saved-puzzle,
.spot-row {
  border: 0;
  border-radius: 22px;
  background: #f7f6f1;
}

.stage-number {
  border: 0;
  border-radius: 16px;
  background: #dff8ff;
}

.stage-number span {
  color: #11131d;
}

.game-stage {
  background: #ffffff;
}

.spot-image-wrap,
.admin-image-wrap {
  border: 0;
  border-radius: 24px;
  background: #f4f2ec;
}

.timer-pill {
  border: 0;
  background: #f2f0ea;
}

.timer-pill i {
  background: linear-gradient(90deg, #24c7d9, #ff77b8);
}

.result-panel,
.countdown-content {
  border: 0;
  border-radius: 28px;
  background: #ffffff;
  padding:2em;
  box-shadow: 0 24px 64px rgba(32, 32, 44, 0.18);
}

.countdown-overlay {
  background: rgba(242, 240, 234, 0.78);
}

.toast {
  border: 0;
  border-radius: 18px;
  background: #11131d;
  color: #ffffff;
  box-shadow: 0 18px 42px rgba(32, 32, 44, 0.18);
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 28px, 1180px);
  }

  .game-grid,
  .hero-grid,
  .hub-layout {
    grid-template-columns: 1fr;
  }

  .game-card,
  .game-card.is-locked {
    min-height: 360px;
  }

  .game-card h2 {
    margin-top: 190px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    border-radius: 22px;
    padding: 14px;
  }

  .game-card {
    padding: 20px;
  }
}

/* Header profile modal and slimmer ranking column */
.home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 24px;
  align-items: start;
}

.home-main .section-block {
  margin-top: 0;
}

.home-ranking {
  position: sticky;
  top: 22px;
}

.home-ranking .scoreboard {
  padding: 20px;
}

.home-ranking .panel-heading {
  margin-bottom: 12px;
}

.home-ranking .panel-heading strong {
  font-size: 1.35rem;
}

.home-ranking .rank-list {
  gap: 9px;
}

.home-ranking .rank-list li {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: auto;
  padding: 10px;
}

.home-ranking .rank-no {
  width: 34px;
  height: 34px;
  border-radius: 13px;
}

.home-ranking .rank-list strong {
  grid-column: 2;
  justify-self: start;
  font-size: 1rem;
}

.home-ranking .rank-list small {
  grid-column: 2;
  font-size: 0.78rem;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 16px;
}

.profile-chip::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #ffffff 0 4px, transparent 5px),
    radial-gradient(circle at 50% 75%, #ffffff 0 8px, transparent 9px),
    #141720;
}

.profile-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  padding: 96px 20px 32px;
  background: rgba(19, 21, 29, 0.28);
  backdrop-filter: blur(10px);
}

.profile-modal {
  position: relative;
  width: min(430px, 100%);
  border-radius: 30px;
  padding: 28px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(32, 32, 44, 0.22);
}

.profile-modal-head {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.profile-modal-head span {
  color: #333;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.14em;
}

.profile-modal-head strong {
  color: #11131d;
  font-size: 1.75rem;
  line-height: 1.08;
}

.profile-modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f3f1eb;
  color: #11131d;
  font-size: 1.5rem;
  line-height: 1;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

@media (max-width: 1000px) {
  .home-dashboard {
    grid-template-columns: 1fr;
  }

  .home-ranking {
    position: static;
  }
}

.card-thumb {
  border-radius: 18px;
  overflow: hidden;
  height: 200px;
  background: #f0eee8;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card.has-thumb {
  min-height: auto;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.game-card.has-thumb.is-ready {
  box-shadow:
    var(--shadow),
    0 0 0 8px rgba(255, 255, 255, 0.58);
}

.game-card.has-thumb::before {
  display: none;
}

.game-card.has-thumb h2 {
  margin-top: 0;
}

.game-card.has-thumb.is-locked {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

@media (max-width: 620px) {
  .topbar nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-chip {
    padding-inline: 10px;
  }

  .profile-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-modal-backdrop {
    align-items: end;
    padding: 20px 12px;
  }

  .profile-modal {
    border-radius: 26px;
    padding: 24px;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}
