/* Intro, Ethic, Cutscene, Win, Busted */
.screen.intro, .screen.ethic, .screen.title, .screen.win, .screen.busted, .screen.ending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.screen.intro, .screen.win, .screen.busted, .screen.ending { text-align: center; }

.comic-page {
  width: min(500px, 100%);
  display: grid;
  gap: 12px;
}
.panel {
  background: #fff;
  border: 3px solid #0f172a;
  border-radius: 16px;
  min-height: 290px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}
.panel-0 { background: #9bf6ff; }
.panel-1 { background: #b8f2c8; }
.panel-2 { background: #ffc2dd; }
.halftone {
  opacity: 0.16;
  pointer-events: none;
  background-image: radial-gradient(#1a120c 1.1px, transparent 1.2px);
  background-size: 9px 9px;
  position: absolute;
  inset: 0;
}
.panel-art { z-index: 1; display: flex; justify-content: center; position: relative; }
.comic-still {
  border: 3px solid #1a120c;
  border-radius: 14px;
  width: min(210px, 65%);
  height: 190px;
  object-fit: cover;
  object-position: top center;
}
.bubble {
  z-index: 1;
  color: #1a120c;
  text-align: left;
  background: #fff;
  border: 2.5px solid #1a120c;
  border-radius: 14px;
  padding: 10px 12px;
  position: relative;
  box-shadow: 3px 3px #1a120c;
}
.bubble strong { color: #1a120c; display: block; margin-bottom: 2px; font-size: 13px; }
.intro-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.intro-dots { display: flex; gap: 6px; }
.intro-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); display: block; }
.intro-dots i.on { width: 22px; border-radius: 999px; background: #fbbf24; }
.skip { position: absolute; top: 14px; right: 16px; min-height: 36px; padding: 6px 12px; font-size: 13px; }

.ethic-card, .comic {
  background: #162238;
  color: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 18px;
  width: min(460px, 100%);
  padding: 22px;
  display: grid;
  gap: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.pending-lock { display: grid; gap: 8px; background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.35); }

.util-bar { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.danger-txt { color: #fca5a5; }
.danger-btn { background: rgba(239, 68, 68, 0.25); border-color: #ef4444; color: #fecaca; }
.reset-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; }
.title-foot { text-align: center; font-size: 12px; }

/* Case Map (3-Chapter Portrait Grid) */
.hub-shell, .sub-shell {
  width: min(1060px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}
.sub-shell { width: min(780px, 100%); }
.sub-shell.narrow { width: min(500px, 100%); }
.hub-topbar, .sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.hub-title { font-size: 20px; letter-spacing: 0.04em; color: #fbbf24; }
.hub-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shady-card { display: grid; gap: 8px; border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.08); }

.chapter-sec { display: grid; gap: 8px; }
.chapter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chapter-head h2 { font-size: 17px; color: #f8fafc; }
.chapter-head .muted { font-size: 13px; }

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 10px;
}
.case-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 13px;
  text-align: left;
  background: var(--ui-panel);
  border: 1px solid var(--ui-border);
  color: #f1f5f9;
  transition: border-color 130ms ease, transform 100ms ease, background 130ms ease;
}
.case-card:hover:not(:disabled) {
  border-color: #38bdf8;
  background: var(--ui-surface);
  transform: translateY(-2px);
}
.case-card.frontier {
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.16);
}
.case-card.lock { opacity: 0.5; cursor: not-allowed; }
.case-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.case-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.case-card.lock .case-thumb { filter: grayscale() brightness(0.45); }
.case-num { font-size: 12px; font-weight: 700; color: var(--ui-muted); }
.case-card-info { display: grid; gap: 1px; }
.case-card-info strong { font-size: 14.5px; }
.case-app { font-size: 12px; }
.stars { color: #fbbf24; letter-spacing: 2px; font-size: 14px; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif; }
.case-status.next {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

/* Shop, How-to, Friend, Daily */
.shop-grid, .how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.shop-card, .how-card, .picker-card, .stack-card { display: grid; gap: 8px; align-content: start; }
.shop-top { font-size: 16px; font-weight: 700; }
.small-pill { width: fit-content; min-height: 24px; padding: 2px 8px; font-size: 12px; }
.owned-txt { font-size: 13px; color: #cbd5e1; }
.link-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: #080d1a;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 13px;
}

/* Win & Busted Screens */
.win-card, .mug-card {
  background: #121926;
  color: #f6f3ec;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 22px;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(860px, 100%);
  padding: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55);
}
.mug-card { width: min(460px, 100%); }
.access-banner {
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid #22c55e;
  border-radius: 14px;
  width: 100%;
  height: 112px;
  animation: 0.45s cubic-bezier(0.2, 1.6, 0.3, 1) slam;
}
@keyframes slam { 0% { opacity: 0.2; transform: scale(1.25); } to { opacity: 1; transform: none; } }
@media (min-width: 820px) {
  .win-card { grid-template-columns: minmax(0, 210px) minmax(0, 1fr); align-items: center; }
  .access-banner { grid-area: 1 / 1; height: 240px; }
  .win-copy { grid-area: 1 / 2; text-align: left; }
  .win-card > .btn, .win-secondary { grid-column: 1 / -1; }
}
.win-copy { display: grid; gap: 8px; min-width: 0; position: relative; z-index: 2; }
.win-title { display: flex; align-items: center; gap: 12px; }
.win-title .byte-face { width: 52px; height: 52px; border-radius: 12px; border: 2px solid #4ade80; }
.display { color: #d6ff6a; font-size: clamp(24px, 4vw, 34px); line-height: 1; }
.display.granted { color: #86efac; }
.win-rewards { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.password-pill {
  color: #fde68a;
  background: #080d1a;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 15px;
  font-weight: 700;
}
.outcome {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
}
.sil { display: flex; align-items: center; gap: 10px; text-align: left; }
.sil-wrap { position: relative; width: 64px; height: 64px; flex: none; }
.sil-portrait {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  object-position: top center;
  filter: grayscale() brightness(0.45) contrast(1.2);
  border: 2px solid #38bdf8;
}
.sil-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #38bdf8;
  color: #082f49;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.tease { font-size: 13px; color: #cbd5e1; }
.win-secondary { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.confetti { pointer-events: none; position: absolute; inset: 0; z-index: 0; }
.confetti i { position: absolute; top: 8px; width: 10px; height: 14px; border-radius: 2px; animation: 1.3s ease-in infinite fall; }
@keyframes fall { to { opacity: 0.2; transform: translateY(220px) rotate(160deg); } }

.mug-frame { width: min(260px, 100%); position: relative; overflow: hidden; border-radius: 14px; border: 2px solid #ef4444; }
.mug-photo { width: 100%; display: block; }
.flash { pointer-events: none; background: #fff; animation: 0.45s forwards flash; position: absolute; inset: 0; }
.bars { pointer-events: none; background: repeating-linear-gradient(90deg, #111 0 10px, transparent 10px 36px); animation: 0.5s 0.15s forwards drop; position: absolute; inset: 0; transform: translateY(-110%); }
@keyframes flash { 0% { opacity: 0.95; } to { opacity: 0; } }
@keyframes drop { to { transform: none; } }

@media (max-width: 540px) {
  .mode-grid { grid-template-columns: 1fr; }
}
