/* CyberCon Mandatory Training, by Big Nuts Games.
   Corporate on the outside (title, results), dating sim on the inside (scenes). */

:root {
  --pink: #ff4fa3;
  --pink-2: #ff8cc6;
  --magenta: #c2187a;
  --purple: #6b2fa3;
  --deep: #2a0d47;
  --ink: #1d2433;
  --corp: #12325c;
  --corp-2: #2b5d9b;
  --paper: #f4f6f9;
  --line: #d9dee7;
  --sys: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sys);
  color: var(--ink);
  background: #16061f;
  display: flex;
  flex-direction: column;
}
main { flex: 1; display: flex; flex-direction: column; align-items: center; }
a { color: inherit; }
button { font: inherit; }
.noscript { color: #fff; padding: 2rem; }

.parody {
  font-size: 12px;
  line-height: 1.5;
  color: #b9a7c9;
  text-align: center;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  min-height: 44px;
}
.btn-primary { background: var(--corp-2); color: #fff; }
.btn-primary:hover { background: var(--corp); }
.btn-ghost { background: transparent; color: var(--corp-2); border: 1px solid var(--line); }
.btn-ghost:hover { background: #fff; }
.btn:focus-visible, .choice:focus-visible, .restart:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }

/* ---------- Corporate screens (title, results) ---------- */
.corp {
  width: 100%;
  max-width: 1280px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}
.corp-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(6px) brightness(.55);
  transform: scale(1.06);
}
.card {
  position: relative;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  width: 100%;
  max-width: 620px;
  overflow: hidden;
}
.card-head {
  background: var(--corp);
  color: #fff;
  padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px; letter-spacing: .02em;
}
.card-head .logo-cc svg { height: 26px; width: auto; display: block; }
.card-body { padding: 26px 24px 24px; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: #b3261e; margin: 0 0 6px; }
.card h1 { font-size: 28px; line-height: 1.2; margin: 0 0 14px; color: var(--corp); }
.card p { line-height: 1.55; margin: 0 0 12px; color: #3b4456; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: #5d6779; margin: 16px 0 20px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.partner { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 12px; color: #6b7385; }
.partner svg { height: 30px; width: auto; }

/* ---------- The game ---------- */
.game {
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
}
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #444;
  overflow: hidden;
}
.stage img, .stage video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hud {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px;
  gap: 8px;
  pointer-events: none;
}
.pill {
  pointer-events: auto;
  background: linear-gradient(180deg, #d4268f, #8e1a8a);
  color: #fff;
  border: 2px solid #ffd0ea;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  box-shadow: 0 2px 10px rgba(80,0,60,.4);
  max-width: 62%;
}
.pill small { display: block; font-weight: 500; opacity: .9; font-size: 11px; }
.gauge {
  display: flex; align-items: center;
  background: linear-gradient(180deg, #d4268f, #8e1a8a);
  border: 2px solid #ffd0ea;
  border-radius: 999px;
  padding: 3px 14px 3px 4px;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 2px 10px rgba(80,0,60,.4);
}
.gauge svg { width: 38px; height: 36px; margin-right: 6px; }
.gauge .fill { transition: y .6s ease, height .6s ease; }
.gauge.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.15); } }
.progress { height: 4px; background: rgba(255,255,255,.15); }
.progress i { display: block; height: 100%; background: var(--pink); transition: width .4s ease; }

.panel {
  background: linear-gradient(180deg, rgba(196,24,122,.96), rgba(107,47,163,.97));
  border-top: 2px solid #ffd0ea;
  color: #fff;
  padding: 12px 12px 14px;
}
.nameplate {
  display: inline-block;
  background: #fff;
  color: var(--magenta);
  font-weight: 800;
  font-size: 13px;
  border-radius: 6px;
  padding: 3px 10px;
  margin-bottom: 6px;
}
.nameplate span { color: #8a5a7a; font-weight: 600; }
.situation { font-size: 16px; line-height: 1.45; margin: 0 0 12px; }
.choices { display: grid; gap: 8px; }
.choice {
  appearance: none;
  text-align: center;
  border: 2px solid #ffd0ea;
  border-radius: 999px;
  background: linear-gradient(180deg, #e0359b, #9c1a86);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  padding: 10px 16px;
  min-height: 46px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 6px rgba(40,0,40,.3);
}
.choice:hover:not(:disabled) { background: linear-gradient(180deg, #ff5fb4, #b52296); }
.choice:disabled { cursor: default; opacity: .45; }
.choice.picked { opacity: 1; background: #fff; color: var(--magenta); }
.choice .key { display: none; }

.feedback {
  margin-top: 12px;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  animation: rise .25s ease;
}
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }
.feedback .you { grid-column: 1; font-size: 13px; color: #7a6a85; font-style: italic; }
.feedback .who { font-size: 12px; font-weight: 800; color: var(--magenta); text-transform: uppercase; letter-spacing: .05em; }
.feedback q { grid-column: 1; font-size: 16px; line-height: 1.4; quotes: "\201C" "\201D"; }
.feedback q.plain { quotes: none; }
.delta { grid-row: 1 / span 3; grid-column: 2; font-weight: 800; font-size: 18px; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.delta.up { color: #b0006b; background: #ffe0f0; }
.delta.down { color: #555; background: #eceef2; }
.feedback .btn { grid-column: 1 / -1; justify-self: end; background: var(--magenta); color: #fff; border-radius: 999px; }

.panel-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
.bng svg { height: 30px; width: auto; display: block; }
.restart {
  appearance: none; background: none; border: 1px solid rgba(255,255,255,.5); color: #fff;
  border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; min-height: 32px;
}
.restart:hover { background: rgba(255,255,255,.12); }

/* Module intro / end cards, over the scene */
.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  background: rgba(42,13,71,.35);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modcard {
  background: linear-gradient(180deg, #fff, #ffeaf5);
  border: 3px solid var(--pink-2);
  border-radius: 16px;
  padding: 16px 20px;
  text-align: center;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(60,0,60,.45);
}
.modcard .kicker { color: var(--magenta); }
.modcard h2 { margin: 0 0 8px; color: var(--deep); font-size: 24px; }
.modcard p { margin: 0 0 14px; line-height: 1.45; color: #4b3a55; }
.modcard .btn { background: var(--magenta); color: #fff; border-radius: 999px; }
.big-heart { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 34px; font-weight: 800; color: var(--magenta); margin: 4px 0 8px; }
.big-heart svg { width: 64px; height: 60px; }
.verdict { font-style: italic; }

/* ---------- Results & certificate ---------- */
.results .card { max-width: 760px; }
.score-big { font-size: 46px; font-weight: 800; color: var(--corp); margin: 0; line-height: 1; }
.score-big small { font-size: 20px; color: #6b7385; font-weight: 600; }
.status { display: inline-block; margin: 10px 0 14px; padding: 4px 10px; border-radius: 4px; font-size: 13px; font-weight: 700; }
.status.pass { background: #e3f4e8; color: #17663a; }
.status.fail { background: #fdecea; color: #a1281f; }
table.mods { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 18px; }
table.mods td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.mods td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
table.mods .v { display: block; color: #6b7385; font-style: italic; font-size: 13px; }
.cert-preview { width: 100%; border: 1px solid var(--line); border-radius: 4px; display: block; margin: 6px 0 14px; box-shadow: 0 4px 16px rgba(0,0,0,.12); }

/* ---------- Name modal ---------- */
dialog#namebox {
  border: 0;
  padding: 0;
  border-radius: 16px;
  width: min(92vw, 420px);
  background: linear-gradient(180deg, #fff, #ffeaf5);
  box-shadow: 0 20px 60px rgba(40,0,50,.5);
  color: var(--ink);
}
dialog#namebox::backdrop {
  background: rgba(30,8,50,.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#nameform { padding: 22px 22px 20px; display: flex; flex-direction: column; }
.namebox-logo { display: flex; justify-content: center; margin-bottom: 8px; }
.namebox-logo svg { height: 34px; width: auto; }
#nameform h2 { margin: 0 0 6px; text-align: center; color: var(--deep); font-size: 22px; }
#nameform p { margin: 0 0 14px; text-align: center; line-height: 1.45; color: #4b3a55; font-size: 15px; }
#nameform label { font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--deep); }
#name-input {
  font: inherit;
  font-size: 17px;      /* 16px or more: phones do not zoom in */
  padding: 12px;
  border: 2px solid #e2b5d0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
#name-input:focus { outline: none; border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(194,24,122,.2); }
#name-input[aria-invalid="true"] { border-color: #c62828; }
.name-error { color: #b3261e !important; font-size: 13px !important; min-height: 1.2em; margin: 6px 0 10px !important; text-align: left !important; }
#nameform .btn { background: var(--magenta); border-radius: 999px; }

/* ---------- Wide screens: the dialogue box sits on the scene, like the real thing ---------- */
@media (min-width: 860px) {
  .game { padding-top: 12px; }
  .stage-wrap { position: relative; }
  .panel {
    position: absolute; left: 10px; right: 10px; bottom: 10px;
    border: 2px solid #ffd0ea;
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 6px 30px rgba(60,0,60,.45);
  }
  .choices { grid-template-columns: repeat(3, 1fr); }
  .choice .key { display: inline; opacity: .7; font-weight: 600; margin-right: 4px; }
  .pill { font-size: 16px; padding: 8px 18px; }
  .pill small { font-size: 12px; }
  .gauge { font-size: 22px; }
  .gauge svg { width: 48px; height: 44px; }
  .situation { font-size: 18px; }
  .hud { padding: 14px; }
}
@media (min-width: 860px) and (max-height: 760px) {
  .game { max-width: calc((100vh - 70px) * 16 / 9); }
}
@media (max-width: 859px) {
  .stage-wrap { display: contents; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Dating-sim layer (Big Nuts Games house style) ---------- */
.game { --round: ui-rounded, "SF Pro Rounded", "Nunito", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif; font-family: var(--round); }
.glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(255,79,163,.28) 100%),
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.9) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 86% 30%, rgba(255,255,255,.8) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 70% 12%, rgba(255,210,236,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 25% 55%, rgba(255,210,236,.7) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 93% 62%, rgba(255,255,255,.7) 0 1.5px, transparent 2.5px);
  animation: twinkle 3.5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .75; } to { opacity: 1; } }

.gauge .gv { display: flex; flex-direction: column; line-height: 1; }
.gauge .gv small { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .9; margin-top: 3px; }

.panel { font-family: var(--round); }
.panel::before {           /* little hearts along the top edge of the dialogue box */
  content: "\2665  \2665  \2665"; position: absolute; right: 18px; top: -13px;
  color: #ffd0ea; font-size: 14px; letter-spacing: 2px; text-shadow: 0 1px 4px rgba(120,0,80,.6);
}
@media (max-width: 859px) { .panel { position: relative; } }
.nameplate { border-radius: 999px; padding: 4px 14px; box-shadow: 0 2px 8px rgba(80,0,60,.35); }

.choice { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 14px 10px; border-radius: 18px; }
.choice .act {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255,255,255,.2); border-radius: 999px; padding: 2px 9px 2px 6px;
}
.choice .ico { width: 15px; height: 15px; flex: none; }
.choice .key { display: none; margin-left: 4px; opacity: .65; font-weight: 700; }
.choice .txt { font-size: 15px; }
.choice.t-gift .act { background: #ffd23f; color: #6b2a00; }
.choice.t-date .act { background: #fff; color: var(--magenta); }
.choice.t-retreat .act, .choice.t-hr .act { background: rgba(0,0,0,.22); }
.choice:not(:disabled):hover .act { transform: scale(1.05); }

.feedback .you { display: flex; align-items: center; gap: 6px; }
.feedback .you .ico { width: 15px; height: 15px; color: var(--magenta); flex: none; }

.float-hearts { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.float-hearts i {
  position: absolute; left: var(--x); bottom: 38%;
  font-style: normal; font-size: calc(54px * var(--s)); color: #ff5fb4;
  text-shadow: 0 0 10px rgba(255,255,255,.9);
  animation: floatup 2s ease-out var(--d) forwards; opacity: 0;
}
@keyframes floatup { 0% { opacity: 0; transform: translateY(0) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-260%) scale(1.1); } }
.broken { position: absolute; left: 50%; top: 30%; font-size: 64px; transform: translate(-50%, 0); animation: drop 1.4s ease-in forwards; pointer-events: none; }
@keyframes drop { 0% { opacity: 0; transform: translate(-50%, -20px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 80px) rotate(12deg); } }

.route {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 auto 14px; padding: 8px 14px; border-radius: 14px;
  background: #fff; border: 2px dashed var(--pink-2); width: fit-content; text-align: left;
}
.route svg { width: 34px; height: 32px; }
.route span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8a5a7a; font-weight: 700; }
.route b { display: block; font-size: 18px; color: var(--deep); text-transform: none; letter-spacing: 0; }
.route small { display: block; font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.modcard { font-family: ui-rounded, "Nunito", "Arial Rounded MT Bold", system-ui, sans-serif; }
.status-chip { display: inline-block; background: #fff; border: 2px solid var(--pink-2); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
@media (min-width: 860px) {
  .choice .key { display: inline; }
  .choice .txt { font-size: 16px; }
  .gauge .gv small { font-size: 11px; }
}

/* Phones: a smaller HUD, so the top bar does not cover the colleague's face */
@media (max-width: 859px) {
  .hud { padding: 6px; }
  .pill { font-size: 11px; padding: 4px 10px; border-width: 1.5px; }
  .pill small { display: none; }
  .gauge { font-size: 14px; padding: 2px 10px 2px 3px; border-width: 1.5px; }
  .gauge svg { width: 26px; height: 24px; margin-right: 4px; }
  .gauge .gv small { font-size: 8px; margin-top: 2px; }
}
