:root {
  --frame-margin: 14px;
  --wine-900: #650800;
  --wine-800: #7f0c03;
  --source-burgundy: #700b06;
  --source-burgundy-dark: #5a0805;
  --gold-500: #ffcc3d;
  --gold-300: #ffe08a;
  --cream-100: #fff6d8;
  --cream-200: #fff3cf;
  --cream-300: #f1d48a;
  --shell-line: #d0a54b;
  --ink: #24100c;
  --muted: #704834;
  --ok: #1f7a45;
  --bad: #9b1d13;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream-100);
  font-family: Arial, Helvetica, sans-serif;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

a {
  color: inherit;
}

.page-header {
  margin: 8px var(--frame-margin) 0;
  min-height: 302px;
  padding: 8px;
  border-radius: 14px;
  background: var(--source-burgundy);
  overflow: hidden;
}

.image-banner {
  display: grid;
  place-items: center start;
  min-height: 286px;
  border-radius: 14px;
  background: var(--source-burgundy);
  overflow: hidden;
  text-decoration: none;
}

.image-banner img {
  display: block;
  width: min(1120px, 100%);
  height: auto;
  max-width: 1120px;
}

.app-layout {
  min-height: calc(100vh - 390px);
  margin: 18px var(--frame-margin) 24px;
  display: grid;
  grid-template-columns: 230px 1fr;
  border: 1px solid var(--shell-line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--cream-100);
  box-shadow: 0 18px 44px rgba(89, 43, 8, 0.12);
}

.site-footer {
  margin: 0 var(--frame-margin) 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--source-burgundy), var(--source-burgundy-dark));
  color: #fff8dc;
  text-align: center;
  padding: 14px 18px;
}

.site-footer p {
  margin: 0;
}

.side-panel {
  padding: 22px;
  color: var(--cream-100);
  background: linear-gradient(180deg, var(--source-burgundy), var(--source-burgundy-dark));
  border-radius: 13px 0 0 13px;
  box-shadow: inset -1px 0 0 rgba(255, 231, 163, 0.16);
}

.side-title {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 224, 138, 0.25);
}

.side-title span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: var(--gold-500);
  border-radius: 6px;
  font-weight: 900;
}

.side-title strong,
.side-title small {
  display: block;
}

.side-title small {
  grid-column: 2;
  margin-top: -7px;
  color: var(--gold-300);
}

.app-tabs {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.tab-button {
  padding: 12px 10px;
  color: var(--cream-100);
  text-align: left;
  background: transparent;
  border-left: 3px solid transparent;
  border-radius: 4px;
}

.tab-button:hover,
.tab-button.is-active {
  color: var(--gold-500);
  background: rgba(255, 204, 61, 0.09);
  border-color: var(--gold-500);
}

.source-card {
  margin-top: 28px;
  padding: 14px;
  color: var(--ink);
  background: var(--gold-300);
  border-radius: 7px;
}

.source-card p {
  margin: 6px 0 0;
  line-height: 1.4;
}

.content-stage {
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(112, 11, 6, 0.06), rgba(112, 11, 6, 0) 90px),
    var(--cream-100);
}

.stage-top {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--wine-800);
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stage-top h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1.06;
}

.article-subtitle {
  max-width: 930px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.35;
}

.article-authors {
  display: block;
  margin-top: 3px;
  color: var(--wine-800);
  font-size: 0.92rem;
}

.doi-card {
  min-width: 190px;
  padding: 12px 14px;
  color: var(--wine-900);
  background: var(--gold-300);
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-weight: 800;
}

.doi-card span,
.doi-card a {
  display: block;
}

.doi-card span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.content-panel {
  display: none;
}

.content-panel.is-visible {
  display: block;
}

.overview-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.overview-hero,
.overview-card,
.overview-facts,
.authors-card,
.panel-card,
.figure-card {
  border: 1px solid var(--cream-300);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(91, 19, 6, 0.08);
}

.overview-hero {
  grid-column: 1 / 2;
  padding: 24px;
  color: var(--cream-100);
  background: linear-gradient(135deg, var(--source-burgundy), var(--source-burgundy-dark));
}

.overview-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 7px 10px;
  color: var(--wine-900);
  background: var(--gold-300);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-hero h2 {
  max-width: 820px;
  margin: 0;
  color: #fff8dc;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.08;
}

.overview-hero p {
  max-width: 860px;
  margin: 16px 0 0;
  color: #f5d9a0;
  font-size: 1.05rem;
  line-height: 1.5;
}

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

.overview-card,
.overview-facts,
.authors-card,
.panel-card,
.figure-card {
  background: rgba(255, 251, 238, 0.82);
}

.overview-card {
  padding: 16px;
}

.overview-card span {
  color: var(--wine-800);
  font-size: 0.78rem;
  font-weight: 900;
}

.overview-card h3 {
  margin: 7px 0 8px;
  color: var(--ink);
  font-size: 1.05rem;
}

.overview-card p,
.clean-list,
.procedure-card li,
.panel-card p {
  color: var(--muted);
  line-height: 1.42;
}

.overview-card p {
  margin: 0;
}

.overview-facts {
  grid-column: 2 / 3;
  grid-row: 1 / span 2;
  padding: 18px;
}

.overview-facts h2,
.authors-card h2,
.panel-card h2,
.conclusion-card h2 {
  margin: 0 0 14px;
  color: var(--wine-900);
  font-size: 1.35rem;
}

.overview-facts dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.overview-facts div {
  padding: 11px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--cream-300);
  border-radius: 7px;
}

.overview-facts dt {
  color: var(--wine-800);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-facts dd {
  margin: 4px 0 0;
  color: var(--ink);
  line-height: 1.35;
}

.authors-card {
  grid-column: 1 / 3;
  padding: 18px;
}

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

.author-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--cream-300);
  border-radius: 7px;
}

.author-row strong {
  color: var(--wine-800);
}

.author-row span,
.author-row a {
  color: var(--muted);
  line-height: 1.32;
}

.split-view {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.panel-card {
  min-width: 0;
  padding: 18px;
}

.clean-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.flow-grid {
  display: grid;
  gap: 12px;
}

.flow-step {
  padding: 14px;
  color: var(--cream-100);
  background: linear-gradient(135deg, var(--wine-900), var(--wine-800));
  border-radius: 8px;
}

.flow-step span {
  color: var(--gold-500);
  font-size: 0.8rem;
  font-weight: 900;
}

.flow-step h3 {
  margin: 6px 0 7px;
  color: #fff8dc;
}

.flow-step p {
  margin: 0;
  color: #f5d9a0;
  line-height: 1.35;
}

.procedure-grid,
.figures-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.procedure-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--cream-300);
  border-radius: 7px;
}

.procedure-card h3 {
  margin: 0 0 10px;
  color: var(--wine-800);
}

.procedure-card ol {
  margin: 0;
  padding-left: 20px;
}

.responsive-table {
  overflow-x: auto;
  border: 1px solid var(--cream-300);
  border-radius: 7px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.56);
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--cream-300);
  color: var(--ink);
  text-align: left;
  vertical-align: top;
  line-height: 1.32;
}

thead th {
  color: var(--wine-900);
  background: var(--gold-300);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody th {
  color: var(--wine-800);
}

.table-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.figures-grid {
  margin-bottom: 18px;
}

.figure-card {
  margin: 0;
  padding: 12px;
}

.figure-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 430px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--cream-300);
  border-radius: 6px;
}

.figure-card figcaption {
  margin-top: 10px;
  color: var(--wine-900);
  font-weight: 900;
  line-height: 1.3;
}

.game-shell {
  position: relative;
  overflow: hidden;
  padding: 18px;
  color: #dff8ff;
  background:
    linear-gradient(90deg, rgba(88, 214, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(88, 214, 255, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 12% 10%, rgba(53, 242, 139, 0.18), transparent 24%),
    radial-gradient(circle at 85% 18%, rgba(255, 204, 61, 0.14), transparent 20%),
    #071927;
  background-size: 36px 36px, 36px 36px, auto, auto, auto;
  border: 1px solid rgba(88, 214, 255, 0.26);
  border-radius: 10px;
  box-shadow: 0 20px 44px rgba(5, 20, 32, 0.34);
}

.game-shell button,
.game-shell select {
  font: inherit;
}

.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
  padding: 20px;
  background: rgba(8, 35, 53, 0.78);
  border: 1px solid rgba(88, 214, 255, 0.24);
  border-radius: 10px;
  box-shadow: inset 0 0 32px rgba(88, 214, 255, 0.05);
}

.game-kicker {
  margin: 0 0 8px;
  color: #35f28b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-hero h2 {
  max-width: 900px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.75rem, 3vw, 3rem);
  line-height: 1.04;
}

.game-hero p,
.simulation-note,
.event-card p,
.research-basis p,
.privacy-meter p {
  color: #a9c6d2;
  line-height: 1.45;
}

.game-actions,
.panel-title-row,
.dashboard-filters,
.final-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.game-actions {
  margin-top: 18px;
}

.game-shell button {
  padding: 10px 13px;
  color: #061822;
  background: #58d6ff;
  border-radius: 7px;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.game-shell button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(88, 214, 255, 0.18);
}

.game-actions button:nth-child(2),
.game-actions button:nth-child(3),
.panel-title-row button,
.final-actions button {
  color: #dff8ff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(88, 214, 255, 0.24);
}

.difficulty-card,
.score-card,
.campus-map,
.phone-panel,
.control-panel,
.event-panel,
.game-subpanel,
.research-basis {
  background: rgba(7, 25, 39, 0.78);
  border: 1px solid rgba(88, 214, 255, 0.22);
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.difficulty-card {
  display: grid;
  gap: 10px;
  align-content: center;
  padding: 16px;
}

.difficulty-card label {
  color: #35f28b;
  font-weight: 900;
  text-transform: uppercase;
}

.difficulty-card select,
.dashboard-filters select {
  min-height: 40px;
  color: #dff8ff;
  background: #0c2434;
  border: 1px solid rgba(88, 214, 255, 0.24);
  border-radius: 7px;
}

.game-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.score-card {
  padding: 13px;
}

.score-card span {
  display: block;
  color: #a9c6d2;
  font-size: 0.77rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-card strong {
  display: block;
  margin: 6px 0;
  color: #ffffff;
  font-size: 1.9rem;
}

.score-pop {
  animation: scorePop 260ms ease;
}

.score-track,
.meter-track {
  height: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.score-track i,
.meter-track span {
  display: block;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, #35f28b, #58d6ff);
  border-radius: inherit;
  transition: width 240ms ease;
}

.game-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  margin-bottom: 16px;
}

.secondary-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
}

.campus-map,
.phone-panel,
.control-panel,
.event-panel {
  min-width: 0;
  padding: 16px;
}

.map-head,
.event-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.map-head h3,
.panel-title-row h3,
.architecture-info h3,
.privacy-meter h3,
.research-basis h3,
.tech-card h3,
.privacy-choice h3 {
  margin: 0;
  color: #ffffff;
}

.map-head p {
  margin: 4px 0 0;
  color: #a9c6d2;
}

#roundBadge {
  padding: 7px 9px;
  color: #061822;
  background: #ffcc3d;
  border-radius: 999px;
  font-weight: 900;
}

.campus-canvas {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: rgba(5, 16, 26, 0.86);
  border: 1px solid rgba(88, 214, 255, 0.18);
  border-radius: 10px;
}

.map-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-lines path {
  fill: none;
  stroke: rgba(88, 214, 255, 0.5);
  stroke-width: 0.6;
  stroke-dasharray: 5 4;
  animation: routeMove 2.6s linear infinite;
}

.campus-zone {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 132px;
  min-height: 78px;
  padding: 10px;
  color: #dff8ff;
  background: rgba(8, 35, 53, 0.92);
  border: 1px solid rgba(88, 214, 255, 0.3);
  border-radius: 9px;
  transform: translate(-50%, -50%);
  cursor: default;
  user-select: none;
}

.campus-zone span {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  margin-bottom: 6px;
  color: #071927;
  background: #35f28b;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 900;
}

.campus-zone strong {
  display: block;
  font-size: 0.85rem;
  line-height: 1.15;
}

.avatar-token,
.data-packet {
  position: absolute;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #061822;
  background: #58d6ff;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 900;
  box-shadow: 0 0 22px rgba(88, 214, 255, 0.38);
}

.student-token {
  opacity: 0;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  font-size: 0.58rem;
  animation: studentRoute 30s ease-in-out both;
  animation-delay: var(--student-delay);
}

.admin-token {
  background: #ffcc3d;
  border-radius: 9px;
  animation: adminRoute 10s ease-in-out infinite;
}

.data-packet {
  width: 16px;
  height: 16px;
  background: #35f28b;
  animation: packetRoute 3s linear infinite;
}

.phone-frame {
  width: min(100%, 250px);
  margin: 0 auto;
  padding: 12px;
  background: #020910;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
}

.phone-top {
  width: 72px;
  height: 5px;
  margin: 0 auto 9px;
  background: #243748;
  border-radius: 999px;
}

.phone-screen {
  display: grid;
  gap: 9px;
  padding: 14px;
  min-height: 380px;
  background: linear-gradient(180deg, #0b2434, #06121f);
  border-radius: 20px;
}

.phone-label {
  color: #35f28b;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.phone-screen h3,
.phone-screen p {
  margin: 0;
}

.phone-screen h3 {
  color: #ffffff;
}

#phoneIds,
#qrStatus {
  color: #a9c6d2;
  font-size: 0.84rem;
}

.qr-box {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  aspect-ratio: 1;
  padding: 10px;
  background: #dff8ff;
  border-radius: 10px;
  overflow: hidden;
}

.qr-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(88, 214, 255, 0.42), transparent);
  animation: scanBeam 1.8s linear infinite;
}

.qr-box span {
  background: transparent;
  border-radius: 2px;
}

.qr-box span.dark {
  background: #061822;
}

.qr-box.is-expired {
  background: #ffd1d1;
}

.qr-box.is-expired::after {
  background: rgba(155, 29, 19, 0.24);
}

.timer-ring-game {
  --qr-progress: 100%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  background:
    radial-gradient(circle at center, #0b2434 57%, transparent 58%),
    conic-gradient(#35f28b var(--qr-progress), rgba(255, 255, 255, 0.15) 0);
  border-radius: 50%;
}

.timer-ring-game b {
  color: #ffffff;
}

.simulation-note {
  margin: 12px 0 0;
  font-size: 0.86rem;
}

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

.control-toggle {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(88, 214, 255, 0.14);
  border-radius: 8px;
}

.control-toggle input {
  position: absolute;
  opacity: 0;
}

.control-toggle span {
  position: relative;
  width: 42px;
  height: 23px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.control-toggle span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 15px;
  height: 15px;
  background: #a9c6d2;
  border-radius: 50%;
  transition: transform 160ms ease, background 160ms ease;
}

.control-toggle input:checked + span {
  background: rgba(53, 242, 139, 0.25);
}

.control-toggle input:checked + span::after {
  background: #35f28b;
  transform: translateX(19px);
}

.control-toggle strong {
  color: #dff8ff;
  font-size: 0.88rem;
  line-height: 1.25;
}

.event-card {
  min-height: 330px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 204, 61, 0.24);
  border-radius: 9px;
}

.event-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #061822;
  background: #ffcc3d;
  border-radius: 9px;
  font-weight: 900;
}

.event-head strong,
.event-head small {
  display: block;
}

.event-head strong {
  color: #ffffff;
  font-size: 1.2rem;
}

.event-head small {
  color: #ffcc3d;
}

.event-countdown {
  height: 8px;
  overflow: hidden;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.event-countdown span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ffcc3d, #9b1d13);
  animation: eventTimer 14s linear infinite;
}

.event-options {
  display: grid;
  gap: 9px;
}

.event-options button {
  color: #dff8ff;
  background: rgba(88, 214, 255, 0.12);
  border: 1px solid rgba(88, 214, 255, 0.22);
  text-align: left;
}

.event-result {
  margin-top: 12px;
  padding: 11px;
  border-radius: 8px;
}

.event-result strong {
  color: #ffffff;
}

.event-result p {
  margin: 6px 0 0;
}

.event-result.attack-blocked {
  background: rgba(53, 242, 139, 0.14);
  border: 1px solid rgba(53, 242, 139, 0.28);
}

.event-result.attack-partially-blocked {
  background: rgba(255, 204, 61, 0.14);
  border: 1px solid rgba(255, 204, 61, 0.3);
}

.event-result.attack-successful {
  background: rgba(155, 29, 19, 0.2);
  border: 1px solid rgba(155, 29, 19, 0.36);
}

.game-tabs-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.mini-tab {
  color: #dff8ff !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(88, 214, 255, 0.16) !important;
}

.mini-tab.is-active {
  color: #061822 !important;
  background: #58d6ff !important;
}

.game-subpanel {
  display: none;
  padding: 16px;
}

.game-subpanel.is-visible {
  display: block;
}

.architecture-game,
.privacy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.7fr);
  gap: 16px;
}

.architecture-nodes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.arch-node {
  min-height: 88px;
  color: #dff8ff !important;
  background: rgba(88, 214, 255, 0.1) !important;
  border: 1px solid rgba(88, 214, 255, 0.22) !important;
}

.arch-node span {
  display: block;
  color: #35f28b;
  font-size: 0.8rem;
}

.arch-node.is-active,
.arch-node.is-pulse {
  border-color: #35f28b !important;
  box-shadow: 0 0 24px rgba(53, 242, 139, 0.22);
}

.architecture-info,
.privacy-meter {
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(88, 214, 255, 0.16);
  border-radius: 9px;
}

.latency-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.latency-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 7px;
}

.latency-list span {
  color: #a9c6d2;
}

.latency-list strong {
  color: #35f28b;
}

.tech-lab {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.tech-card {
  min-width: 190px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(88, 214, 255, 0.16);
  border-radius: 9px;
}

.metric-row {
  display: grid;
  grid-template-columns: 88px 1fr 30px;
  gap: 8px;
  align-items: center;
  margin-top: 9px;
  color: #a9c6d2;
  font-size: 0.82rem;
}

.metric-row div {
  height: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.metric-row i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #35f28b, #58d6ff);
}

.tech-card ul {
  margin: 12px 0 0;
  padding-left: 17px;
  color: #a9c6d2;
  font-size: 0.85rem;
  line-height: 1.35;
}

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

.privacy-choice {
  padding: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(88, 214, 255, 0.16);
  border-radius: 9px;
}

.privacy-choice button {
  width: 100%;
  margin-top: 9px;
  color: #dff8ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(88, 214, 255, 0.16);
  text-align: left;
}

.privacy-choice button.is-selected {
  color: #061822;
  background: #35f28b;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.kpi-grid article {
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(88, 214, 255, 0.14);
  border-radius: 8px;
}

.kpi-grid span,
.kpi-grid strong {
  display: block;
}

.kpi-grid span {
  color: #a9c6d2;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.kpi-grid strong {
  margin-top: 4px;
  color: #ffffff;
  font-size: 1.35rem;
}

.dark-table table {
  background: rgba(7, 25, 39, 0.72);
}

.dark-table th,
.dark-table td {
  color: #dff8ff;
  border-color: rgba(88, 214, 255, 0.16);
}

.dark-table thead th {
  color: #061822;
  background: #58d6ff;
}

.risk-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
}

.risk-badge.low {
  color: #061822;
  background: #35f28b;
}

.risk-badge.medium {
  color: #061822;
  background: #ffcc3d;
}

.risk-badge.high,
.risk-badge.critical {
  color: #ffffff;
  background: #9b1d13;
}

.final-report {
  margin-top: 14px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(88, 214, 255, 0.18);
  border-radius: 9px;
}

.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  gap: 10px;
  max-width: 340px;
}

.toast {
  padding: 12px 14px;
  color: #dff8ff;
  background: rgba(7, 25, 39, 0.96);
  border: 1px solid rgba(88, 214, 255, 0.3);
  border-radius: 8px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
  animation: toastIn 240ms ease;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(2, 9, 16, 0.72);
}

.info-modal.is-open {
  display: flex;
}

.info-dialog {
  width: min(960px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  padding: 20px;
  color: #dff8ff;
  background:
    linear-gradient(90deg, rgba(88, 214, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(88, 214, 255, 0.07) 1px, transparent 1px),
    #071927;
  background-size: 30px 30px;
  border: 1px solid rgba(88, 214, 255, 0.32);
  border-radius: 12px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.46);
}

.info-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.info-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

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

.how-grid article {
  padding: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(88, 214, 255, 0.18);
  border-radius: 9px;
}

.how-grid span {
  color: #35f28b;
  font-size: 0.78rem;
  font-weight: 900;
}

.how-grid h3 {
  margin: 7px 0 8px;
  color: #ffffff;
}

.how-grid p {
  margin: 0;
  color: #a9c6d2;
  line-height: 1.4;
}

@keyframes routeMove {
  to { stroke-dashoffset: -18; }
}

@keyframes studentRoute {
  0% { left: 8%; top: var(--entry-y); opacity: 0; transform: scale(0.82); }
  6% { opacity: 1; transform: scale(1); }
  20% { left: 8%; top: var(--entry-y); opacity: 1; }
  42% { left: var(--class-a-x); top: var(--class-a-y); opacity: 1; }
  63% { left: var(--class-b-x); top: var(--class-b-y); opacity: 1; }
  84% { left: 88%; top: var(--exit-y); opacity: 1; }
  100% { left: 98%; top: var(--exit-y); opacity: 0; transform: scale(0.82); }
}

@keyframes adminRoute {
  0% { left: 66%; top: 63%; }
  35% { left: 78%; top: 32%; }
  70% { left: 38%; top: 66%; }
  100% { left: 66%; top: 63%; }
}

@keyframes packetRoute {
  0% { left: 18%; top: 54%; opacity: 0.2; }
  45% { left: 78%; top: 32%; opacity: 1; }
  100% { left: 88%; top: 54%; opacity: 0.2; }
}

@keyframes scanBeam {
  from { transform: translateY(-100%); }
  to { transform: translateY(100%); }
}

@keyframes eventTimer {
  from { width: 100%; }
  to { width: 0; }
}

@keyframes scorePop {
  50% { transform: scale(1.12); color: #35f28b; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* BRAIN visual skin for the simulator, aligned with the rest of the page. */
.game-shell {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(112, 11, 6, 0.06), rgba(112, 11, 6, 0) 90px),
    var(--cream-100);
  border-color: var(--cream-300);
  box-shadow: 0 10px 24px rgba(91, 19, 6, 0.08);
}

.game-hero,
.difficulty-card,
.score-card,
.campus-map,
.phone-panel,
.control-panel,
.event-panel,
.game-subpanel,
.research-basis,
.info-dialog {
  color: var(--ink);
  background: rgba(255, 251, 238, 0.86);
  border-color: var(--cream-300);
  box-shadow: 0 10px 24px rgba(91, 19, 6, 0.08);
}

.game-hero {
  background: linear-gradient(135deg, var(--source-burgundy), var(--source-burgundy-dark));
}

.game-hero h2,
.game-hero .game-kicker {
  color: #fff8dc;
}

.game-kicker,
.difficulty-card label,
.phone-label,
.latency-list strong,
.arch-node span,
.how-grid span {
  color: var(--wine-800);
}

.game-hero p {
  color: #f5d9a0;
}

.simulation-note,
.event-card p,
.research-basis p,
.privacy-meter p,
.map-head p,
.phone-screen p,
#phoneIds,
#qrStatus,
.tech-card ul,
.metric-row,
.how-grid p {
  color: var(--muted);
}

.game-shell button {
  color: var(--wine-900);
  background: var(--gold-500);
}

.game-actions button:nth-child(2),
.game-actions button:nth-child(3),
.panel-title-row button,
.final-actions button,
.mini-tab,
.event-options button,
.privacy-choice button {
  color: var(--cream-100) !important;
  background: var(--wine-800) !important;
  border-color: rgba(255, 204, 61, 0.28) !important;
}

.mini-tab.is-active,
.privacy-choice button.is-selected {
  color: var(--wine-900) !important;
  background: var(--gold-500) !important;
}

.difficulty-card select,
.dashboard-filters select {
  color: var(--ink);
  background: #fffaf0;
  border-color: var(--cream-300);
}

.score-card span,
.kpi-grid span,
.event-head small {
  color: var(--wine-800);
}

.score-card strong,
.map-head h3,
.panel-title-row h3,
.architecture-info h3,
.privacy-meter h3,
.research-basis h3,
.tech-card h3,
.privacy-choice h3,
.event-head strong,
.event-result strong,
.info-head h2,
.how-grid h3 {
  color: var(--wine-900);
}

.score-track,
.meter-track,
.event-countdown,
.metric-row div {
  background: rgba(112, 11, 6, 0.12);
}

.score-track i,
.meter-track span,
.metric-row i {
  background: linear-gradient(90deg, var(--gold-500), var(--wine-800));
}

.campus-canvas {
  background:
    linear-gradient(90deg, rgba(112, 11, 6, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(112, 11, 6, 0.06) 1px, transparent 1px),
    rgba(255, 251, 238, 0.72);
  background-size: 34px 34px;
  border-color: var(--cream-300);
}

.map-lines path {
  stroke: rgba(112, 11, 6, 0.38);
}

.campus-zone,
.event-card,
.architecture-info,
.privacy-meter,
.tech-card,
.privacy-choice,
.kpi-grid article,
.latency-list div,
.how-grid article,
.final-report {
  background: rgba(255, 255, 255, 0.58);
  border-color: var(--cream-300);
}

.campus-zone {
  color: var(--ink);
}

.campus-zone span,
.avatar-token,
.data-packet,
.event-icon,
.risk-badge.low,
.risk-badge.medium {
  color: var(--wine-900);
  background: var(--gold-500);
}

.student-token {
  box-shadow: 0 0 18px rgba(112, 11, 6, 0.2);
}

.admin-token {
  background: var(--wine-800);
  color: var(--cream-100);
}

.phone-frame {
  background: var(--source-burgundy-dark);
}

.phone-screen {
  background: linear-gradient(180deg, #fffaf0, var(--cream-200));
}

.phone-screen h3,
.timer-ring-game b {
  color: var(--wine-900);
}

.qr-box {
  background: #fffdf4;
  border: 1px solid var(--cream-300);
}

.qr-box span.dark {
  background: var(--wine-900);
}

.qr-box::after {
  background: linear-gradient(180deg, transparent, rgba(255, 204, 61, 0.42), transparent);
}

.timer-ring-game {
  background:
    radial-gradient(circle at center, #fffaf0 57%, transparent 58%),
    conic-gradient(var(--wine-800) var(--qr-progress), rgba(112, 11, 6, 0.14) 0);
}

.control-toggle,
.arch-node {
  background: rgba(255, 255, 255, 0.58) !important;
  border-color: var(--cream-300) !important;
}

.control-toggle strong,
.arch-node {
  color: var(--ink) !important;
}

.control-toggle span {
  background: rgba(112, 11, 6, 0.16);
}

.control-toggle span::after {
  background: var(--muted);
}

.control-toggle input:checked + span {
  background: rgba(255, 204, 61, 0.46);
}

.control-toggle input:checked + span::after {
  background: var(--wine-800);
}

.event-result.attack-blocked {
  background: rgba(31, 122, 69, 0.12);
  border-color: rgba(31, 122, 69, 0.28);
}

.event-result.attack-partially-blocked {
  background: rgba(255, 204, 61, 0.18);
  border-color: rgba(208, 165, 75, 0.5);
}

.event-result.attack-successful {
  background: rgba(155, 29, 19, 0.12);
  border-color: rgba(155, 29, 19, 0.32);
}

.dark-table table {
  background: rgba(255, 255, 255, 0.58);
}

.dark-table th,
.dark-table td {
  color: var(--ink);
  border-color: var(--cream-300);
}

.dark-table thead th {
  color: var(--wine-900);
  background: var(--gold-300);
}

.toast {
  color: var(--cream-100);
  background: var(--source-burgundy-dark);
  border-color: rgba(255, 204, 61, 0.34);
}

.info-modal {
  background: rgba(36, 16, 12, 0.56);
}

.latency-list div {
  background: #fffaf0;
  border: 1px solid var(--cream-300);
  box-shadow: 0 4px 12px rgba(91, 19, 6, 0.06);
}

.latency-list span {
  color: var(--wine-900);
  font-weight: 800;
}

.latency-list strong {
  color: var(--wine-800);
  font-weight: 900;
}

.panel-title-row button {
  padding-top: 8px;
  padding-bottom: 8px;
  transform: translateY(-3px);
}

.panel-title-row button:hover {
  transform: translateY(-4px);
}

.kpi-grid strong {
  color: var(--wine-900);
  font-weight: 900;
}

.kpi-grid article {
  background: #fffaf0;
}

@media (max-width: 980px) {
  .app-layout,
  .overview-shell,
  .split-view,
  .procedure-grid,
  .figures-grid,
  #authorsList {
    grid-template-columns: 1fr;
  }

  .overview-hero,
  .overview-grid,
  .overview-facts,
  .authors-card {
    grid-column: auto;
    grid-row: auto;
  }

  .side-panel {
    display: grid;
    gap: 16px;
    border-radius: 12px 12px 0 0;
  }

  .app-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .source-card {
    margin-top: 0;
  }

  .image-banner {
    min-height: 0;
    border-radius: 12px;
  }

  .game-hero,
  .game-main-grid,
  .secondary-grid,
  .architecture-game,
  .privacy-layout,
  .game-status-grid {
    grid-template-columns: 1fr;
  }

  .control-grid,
  .privacy-choices,
  .kpi-grid,
  .how-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .architecture-nodes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  :root {
    --frame-margin: 10px;
  }

  body {
    padding: 6px;
  }

  .page-header {
    margin-top: 4px;
    min-height: 0;
    padding: 4px;
    border-radius: 12px;
  }

  .image-banner {
    min-height: 0;
    border-radius: 12px;
  }

  .content-stage {
    padding: 10px;
  }

  .app-layout {
    gap: 10px;
    margin-top: 10px;
    border-radius: 12px;
  }

  .overview-grid,
  .app-tabs {
    grid-template-columns: 1fr;
  }

  .stage-top h1 {
    font-size: 1.65rem;
  }

  th,
  td {
    min-width: 150px;
    padding: 9px 10px;
  }

  .game-shell {
    padding: 10px;
  }

  .game-hero,
  .campus-map,
  .phone-panel,
  .control-panel,
  .event-panel,
  .game-subpanel {
    padding: 12px;
  }

  .control-grid,
  .privacy-choices,
  .kpi-grid,
  .architecture-nodes,
  .how-grid {
    grid-template-columns: 1fr;
  }

  .campus-canvas {
    min-height: 560px;
  }

  .campus-zone {
    width: 118px;
  }

  .toast-region {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }
}
