:root {
  --bg: #0b0b0c;
  --panel: #111214;
  --panel-2: #17181b;
  --line: #222428;
  --text: #f4f4f5;
  --muted: #8b8d93;
  --faint: #3a3c41;
  --green: #0e8a4a;
  --red: #c8102e;
  --orange: #d9822b;
  --blue: #5b7fb8;
  --gold: #e8b931;
  /* Dark liquid glass: smoked panel, thick glossy edge, deep soft shadow */
  --glass: linear-gradient(165deg, #ffffff1c, #ffffff06 50%, #ffffff0d), #131418b8;
  --glass-blur: blur(24px) saturate(150%);
  --glass-line: #ffffff2b;
  --glass-hi: inset 0 1.5px 0 #ffffff3d, inset 0 0 0 1px #ffffff14, inset 0 -2px 10px #00000040;
  --glass-shadow: 0 2px 6px #0000004d, 0 30px 60px -30px #000000d9;
  --tile: #ffffff0d;
  --tile-line: #ffffff1c;
  --tile-hi: inset 0 1px 0 #ffffff1f, 0 1px 3px #0000004d;
  /* Buttons: blue glass (main) and smoked glass (secondary) */
  --btn-blue: linear-gradient(180deg, #86a5ea, #5274c9);
  --btn-blue-hi: inset 0 1.5px 0 #ffffff80, inset 0 0 0 1px #ffffff2e, inset 0 -3px 8px #1a2f6659, 0 8px 20px -8px #5274c9b3;
  --btn-dark: linear-gradient(180deg, #ffffff1c, #ffffff08);
  --btn-dark-hi: inset 0 1.5px 0 #ffffff33, inset 0 0 0 1px #ffffff17, inset 0 -3px 8px #0000004d, 0 6px 16px -8px #000000cc;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }

/* Stage: board centered in the viewport */
.stage {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 80px 16px 40px; /* top: room for the logo and the corner buttons; bottom: the credit */
}
/* Credit at the bottom of the screen, very small */
.credit { position: fixed; left: 0; right: 0; bottom: 14px; z-index: 4; text-align: center; font-size: 12px; text-shadow: 0 1px 4px #000a; pointer-events: none; }
.credit a { pointer-events: auto; }
.credit a { color: #ffffff99; text-decoration: none; transition: color .15s; }
.credit a:hover { color: #fff; text-decoration: underline; }
/* Background photo, fixed behind everything, lightly darkened so panels stay readable.
   It follows where you work (scene.js): two layers cross-fade when it changes. */
.scene { position: fixed; inset: -40px; z-index: -1; filter: blur(4px); background: var(--bg); }
.scene > div {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease;
  background: linear-gradient(#0b0b0c33, #0b0b0c33), var(--img) center / cover no-repeat;
}
.scene > div.on { opacity: 1; }

/* ---------- Game screen ---------- */
.game { width: 100%; max-width: 1120px; display: flex; flex-direction: column; gap: 16px; }
/* Animate each panel, not .game: an animating ancestor delays the panels' backdrop blur */
.game > .panel { animation: boardIn .6s cubic-bezier(.2,.8,.2,1); }
.panel {
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); border-radius: 28px; box-shadow: var(--glass-hi), var(--glass-shadow);
}
.panel-label { margin: 0; font-size: 18px; font-weight: 800; }
.panel-sub { margin: 4px 0 16px; color: var(--muted); font-size: 16px; }

/* Top bar */
.hud { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; padding: 18px 24px; }
.tag { font-size: 14px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: #ffffff1a; }
.tag.role { background: var(--red); }
.trophy { font-size: 20px; position: relative; white-space: nowrap; }
.trophy.legendary { filter: drop-shadow(0 0 6px #e8b931cc); }
.trophy[data-n]::after { content: '×' attr(data-n); font-size: 14px; font-weight: 800; color: var(--muted); margin-left: 1px; }
.hud-meters { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 10px; }
.meter { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 12px; border-radius: 18px; background: var(--tile); border: 1px solid var(--tile-line); box-shadow: var(--tile-hi); }
.meter small { font-size: 14px; color: var(--muted); font-weight: 600; }
.meter b { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; white-space: nowrap; }
.meter.bump b { display: inline-block; animation: bump .5s .3s cubic-bezier(.3,1.6,.5,1); transform-origin: left center; }
.meter-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.meter .delta { top: -10px; right: -8px; }
.meter.danger { border-color: #fb718599; animation: danger 1.4s ease-in-out infinite; }
@keyframes danger { 50% { box-shadow: 0 0 0 3px #fb718533, 0 0 22px -6px #fb7185; } }
.bar { display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: #ffffff12; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; animation: barFill .9s .25s cubic-bezier(.2,.8,.2,1) both; }
@keyframes barFill { from { width: var(--w0); } to { width: var(--w); } }

.career { padding: 22px 24px; min-width: 0; }

/* "Tu carrera" timeline */
.timeline-wrap {
  position: relative; height: 460px; overflow-y: auto; overscroll-behavior: contain;
  /* left padding (offset by the negative margin) leaves room for the dots' pulse ring, which overflow would clip */
  margin-left: -14px; padding: 6px 6px 24px 14px; scrollbar-width: thin; scrollbar-color: #3a3c41 transparent;
  /* soft fade at the edges so it reads as scrollable */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent);
}
.timeline { list-style: none; margin: 0; padding: 0; }
.step { position: relative; padding: 0 0 14px 34px; }
.step::before { /* connector */
  content: ''; position: absolute; left: 9px; top: 22px; bottom: -2px; border-left: 2px solid #2a2c31;
}
.step:last-child::before { display: none; }
.step.future::before { border-left-style: dashed; }
.dot { position: absolute; left: 0; top: 13px; width: 20px; height: 20px; border-radius: 50%; background: var(--c, #555); }
.step.future .dot { top: 2px; background: transparent; border: 2px dashed #5d6066; }
.step.current .dot { background: #3b82f6; animation: ring 1.6s ease-out infinite; }
.step.current.sim .dot { background: var(--c); }
.step.retire .dot { background: var(--gold); }
@keyframes ring { 0% { box-shadow: 0 0 0 0 #3b82f699; } 100% { box-shadow: 0 0 0 10px #3b82f600; } }

.step-body { border-radius: 18px; min-width: 0; }
.step-body.has-logo { display: flex; align-items: flex-start; gap: 12px; }
.step-body.has-logo > .logo { flex: none; width: 44px; height: 44px; border-radius: 12px; font-size: 15px; }
.step-main { flex: 1; min-width: 0; }
.step.done .step-body {
  padding: 10px 14px; border: 1px solid var(--tile-line); box-shadow: var(--tile-hi);
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 20%, transparent), var(--tile) 75%);
}
.step.current .step-body { padding: 16px 18px; border: 1px solid #86a5ea59; background: linear-gradient(180deg, #5274c933, #5274c90d); box-shadow: var(--tile-hi); }
.step.current.sim .step-body { position: relative; overflow: hidden; border-color: var(--c); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 18%, transparent), var(--tile) 80%); }
.step.current.sim .step-body::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, transparent, var(--c));
  transform-origin: left; animation: progress var(--simt, 1.1s) linear both;
}
.step.future .step-body { color: #6b6e75; font-size: 16px; font-weight: 600; }
.step.current.retire .step-body { background: linear-gradient(180deg, #e8b9311f, var(--tile) 60%); border-color: #e8b93166; }

.step-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; }
.step-row + .step-row { margin-top: 3px; }
.step-top { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; min-width: 0; }
.step-ovr { font-size: 15px; color: var(--muted); white-space: nowrap; }
.step-ovr b { font-weight: 800; }
.step-sub { color: #b8bac0; font-size: 14px; }
.step-head { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.15; }
.step-head.anim { animation: pulse 1.4s ease-in-out infinite; }
.step-desc { color: var(--muted); font-size: 16px; margin: 4px 0 14px; }
.step-top .age { font-weight: 800; white-space: nowrap; }
.flag { flex: none; width: 20px; height: 14px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px #ffffff1f; vertical-align: -2px; }
.step-top .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.step-top .ev { font-size: 15px; flex: none; }
.step-top .pill { margin-left: auto; flex: none; border-radius: 7px; padding: 2px 8px; font-size: 15px; font-weight: 800; }
.step-stats { color: var(--muted); font-size: 14px; white-space: nowrap; }
.step-stats b { color: #d6d7da; font-weight: 700; }
.step-log { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }


/* Market */
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.offer {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  padding: 14px 16px; border-radius: 20px; color: var(--text); min-width: 0;
  border: 1px solid var(--tile-line); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 20%, #ffffff14), #ffffff08 60%); box-shadow: var(--btn-dark-hi);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), border-color .18s, box-shadow .18s, opacity .3s;
}
.offer:hover { transform: translateY(-2px); border-color: #ffffff40; box-shadow: var(--btn-dark-hi), 0 14px 30px -14px #000; }
.offer:hover .logo { transform: scale(1.08) rotate(-4deg); }
.offer:active { transform: scale(.98); }
.offer-head { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 8px; }
.offer-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.offer-title .meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.intensity { margin-top: 4px; font-size: 14px; font-weight: 700; }
.intensity.hot { color: #fb7185; }
.intensity.warm { color: #f5a524; }
.intensity.ok { color: #c9cbd0; }
.intensity.chill { color: #4ade80; }
.intensity.relax { color: #4ade80; }
.offer .co { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* always one line */
.offer .pay { font-size: 16px; font-weight: 700; color: #4ade80; }
.offer .meta { font-size: 14px; color: var(--muted); }
.offer .meta .nw { white-space: nowrap; }
.offer .badge { margin-top: 8px; }
.offer .logo { flex: none; width: 52px; height: 52px; border-radius: 14px; font-size: 17px; transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.badge { font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #ffffff14; color: #d6d7da; }
.badge.gold { color: var(--gold); background: #e8b93118; }
.hire { margin-top: 4px; font-size: 14px; font-weight: 700; color: #93c5fd; }
.hire.no { color: #fb7185; }
.offer .hire-odds { margin-top: 10px; width: 100%; gap: 6px; }
.offer .hire-odds .oc { padding: 6px 10px; }
.offer.rejected { opacity: .45; cursor: default; filter: grayscale(.6); }
.boost { margin-left: 8px; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #60a5fa; background: #3b82f61f; vertical-align: 1px; white-space: nowrap; }

.logo {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 800; font-size: 18px; letter-spacing: -0.5px; color: #fff;
  box-shadow: inset 0 0 0 2px #ffffff22;
}
.logo.sm { flex: none; width: 24px; height: 24px; border-radius: 6px; font-size: 10px; box-shadow: none; }
.logo { position: relative; overflow: hidden; }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }

.btn {
  border: 0; border-radius: 999px; padding: 13px 24px; font-weight: 700; font-size: 16px;
  background: var(--btn-blue); color: #fff; box-shadow: var(--btn-blue-hi); text-shadow: 0 1px 1px #1a2f6640;
  transition: transform .15s, filter .15s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--btn-dark); color: var(--text); box-shadow: var(--btn-dark-hi); text-shadow: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.event {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; background: #00000038; border-radius: 12px; padding: 8px 12px 8px 8px; line-height: 1.35; color: #d6d7da;
}
.event strong, .result-d strong, .result-row span strong { font-weight: 800; color: inherit; }
.event i { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-style: normal; background: #ffffff12; color: #a1a3a9; }
.event.good i { background: #12b76a40; color: #4ade80; }
.event.bad i { background: #e5484d40; color: #fb7185; }
.event.bad { background: #e5484d2e; color: #fecdd3; }
.event.good { background: #12b76a2e; color: #bbf7d0; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary div { background: var(--tile); box-shadow: var(--tile-hi); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.summary small { display: block; color: var(--muted); font-size: 14px; font-weight: 600; }
.summary b { font-size: 19px; }
.verdict { font-size: 16px; font-weight: 700; margin: 14px 0 0; line-height: 1.4; }


/* Page title */
/* Brand (logo + name): top-left corner, level with the buttons on the right; goes back home */
.brand {
  position: absolute; top: 16px; left: 16px; z-index: 5; display: flex; align-items: center; gap: 8px;
  height: 54px; padding: 0 20px 0 10px; border-radius: 999px; color: #fff; cursor: pointer;
  font: 800 22px/1 Inter, sans-serif; letter-spacing: -0.5px;
  /* same glass pill as the sound buttons on the right */
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-hi), 0 8px 20px -10px #000;
  animation: riseIn .6s cubic-bezier(.2,.8,.2,1) both; transition: transform .15s, background .15s;
}
.brand img { width: 34px; height: 34px; }
.brand:hover { transform: translateY(-1px); background: linear-gradient(160deg, #ffffff24, #ffffff0a 45%), #111214b3; }
.brand:active { transform: scale(.96); }
/* Once the game starts the big title goes away and the board sits centered */
body.playing .game-title { display: none; }
/* Page title, big and centered above the cards */
.game-title {
  margin: 0 0 40px; text-align: center; font-size: clamp(28px, 6vw, 52px); font-weight: 800;
  letter-spacing: -1.5px; line-height: 1.05;
  color: #fff;
  text-shadow: 0 2px 4px #0006, 0 8px 28px #000a;
  animation: riseIn .6s cubic-bezier(.2,.8,.2,1) both;
}

/* Result pop-up after each choice: a post-it note (yellow; green if good, pink if bad),
   made of tinted liquid glass like the rest of the UI */
.modal-card.result-card {
  --paper: #fff07a; --ink: #2b2610;
  max-width: 440px; padding: 40px 30px 26px; text-align: center; overflow-x: hidden;
  border: 1px solid #ffffffa6; border-radius: 6px; color: var(--ink);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  background:
    linear-gradient(180deg, #00000014, transparent 22px),               /* adhesive strip */
    linear-gradient(165deg, #ffffff73, #ffffff00 45%, #0000000d),        /* glossy sheen */
    color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow:
    inset 0 2px 1px #ffffffd9, inset 0 0 0 1.5px #ffffff59, inset 0 -3px 10px #0000001a,  /* glass edge */
    0 2px 4px #0003, 0 26px 40px -18px #000c;
  transform: translateY(40px) rotate(-6deg) scale(.9);
}
.modal.open .modal-card.result-card { transform: rotate(-1.5deg); }
.result-card.good { --paper: #b9f5c4; --ink: #10301a; }
.result-card.bad { --paper: #ffbccb; --ink: #3a1019; }
.result-i { display: inline-block; font-size: 60px; line-height: 1; filter: drop-shadow(0 6px 8px #0003); }
.modal.open .result-i { animation: popIn .6s .05s cubic-bezier(.3,1.6,.5,1) both; }
.result-h { margin: 12px 0 0; font: 700 42px/1.05 Caveat, cursive; }
.result-d { margin: 8px auto 0; max-width: 360px; font-size: 18px; line-height: 1.4; color: color-mix(in srgb, var(--ink) 80%, transparent); }
.result-rest { display: grid; gap: 8px; margin-top: 20px; text-align: left; }
.result-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px;
  background: #ffffff4d; border: 1px solid #ffffff8c; box-shadow: inset 0 1px 0 #ffffffb3, 0 1px 3px #0000001a;
}
.result-row.good { background: linear-gradient(#16a34a1f, #16a34a1f), #ffffff40; }
.result-row.bad { background: linear-gradient(#e11d481c, #e11d481c), #ffffff40; }
.result-ri { flex: none; font-size: 26px; }
.result-row b { display: block; font-size: 16px; }
.result-row span { display: block; font-size: 15px; color: color-mix(in srgb, var(--ink) 75%, transparent); line-height: 1.35; }
.result-ok {
  display: block; width: 100%; margin-top: 22px; font-size: 17px; padding: 15px 24px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 80%, #fff), var(--ink)); color: var(--paper); text-shadow: none;
  box-shadow: inset 0 1.5px 0 #ffffff40, inset 0 0 0 1px #ffffff1a, inset 0 -3px 8px #00000059, 0 8px 18px -8px color-mix(in srgb, var(--ink) 70%, transparent);
}

/* Poster modal */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: #00000073; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card {
  position: relative; width: 100%; max-width: 640px; max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-hi), var(--glass-shadow); border-radius: 32px; padding: 22px 24px 24px;
  transform: translateY(24px) scale(.96); transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.modal.open .modal-card { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--btn-dark); color: #ccc; box-shadow: var(--btn-dark-hi); transition: color .15s;
}
.icon-btn:hover { color: #fff; }
/* Career card: the card on the left, name + share options on the right */
.modal-card.poster-card { width: auto; max-width: calc(100vw - 32px); }
.poster-layout { display: grid; grid-template-columns: auto 280px; gap: 24px; align-items: start; }
.poster-frame {
  background: var(--tile); border: 1px solid var(--tile-line); box-shadow: var(--tile-hi); border-radius: 22px; padding: 18px;
  display: grid; place-items: center;
}
/* As big as the window allows (4:5 card); the hotspots and tooltip sit on top of the image */
.poster-wrap {
  position: relative; aspect-ratio: 4 / 5;
  width: min(544px, calc((100dvh - 176px) * .8), calc(100vw - 420px));
}
.poster-wrap img { display: block; width: 100%; height: 100%; border-radius: 6px; box-shadow: 0 20px 50px -20px #000; }
.modal.open .poster-wrap img { animation: riseIn .5s .15s cubic-bezier(.2,.8,.2,1) both; }
.poster-spots { position: absolute; inset: 0; }
.poster-spot {
  position: absolute; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  transition: box-shadow .15s, background .15s;
}
.poster-spot:hover, .poster-spot.on, .poster-spot:focus-visible { outline: none; background: #86a5ea1f; box-shadow: 0 0 0 2px #86a5ea; }
.poster-tip {
  position: absolute; z-index: 2; width: 250px; padding: 12px 14px; border-radius: 16px; pointer-events: none;
  display: flex; flex-direction: column; gap: 3px; font-size: 14px; line-height: 1.35; color: #c9cbd0;
  background: linear-gradient(165deg, #ffffff17, #ffffff05 50%), #17181cf2; backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-hi), 0 14px 30px -10px #000;
  animation: riseIn .18s ease-out;
}
.poster-tip b { color: var(--text); font-size: 15px; margin-bottom: 2px; }
/* Laptop editor over the career card */
.lap-editor {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px; border-radius: inherit;
  background: #0d0e10d9; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: riseIn .2s ease-out;
}
.lap-editor[hidden] { display: none; }
.lap-editor-box { width: min(100%, 520px); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lap-editor-box h3 { margin: 0; font-size: 24px; font-weight: 800; }
.lap-editor-box p { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.lap-editor .laptop { width: 100%; min-height: 0; }
.lap-editor .btn { margin-top: 70px; padding: 12px 40px; }
.poster-side { display: flex; flex-direction: column; gap: 10px; }
.poster-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.poster-field input {
  height: 46px; padding: 0 16px; border-radius: 14px; outline: none; font: 700 17px Inter, sans-serif; color: var(--text);
  background: #00000040; border: 1px solid var(--tile-line); box-shadow: inset 0 2px 6px #0000004d;
  transition: border-color .15s, box-shadow .15s;
}
.poster-field input:focus { border-color: #86a5ea; box-shadow: inset 0 2px 6px #0000004d, 0 0 0 3px #5274c94d; }
.style-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.style-swatch {
  width: 40px; height: 40px; padding: 0; border-radius: 12px; border: 1px solid #ffffff26; cursor: pointer;
  box-shadow: inset 0 1px 0 #ffffff1f; transition: transform .15s, box-shadow .15s;
}
.style-swatch:hover { transform: translateY(-1px); }
.style-swatch[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 0 3px #86a5ea80; }
.share-main { display: grid; grid-template-columns: 1fr; gap: 10px; }
.share-sub { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (max-width: 900px) {
  .modal-card.poster-card { width: 100%; }
  .poster-layout { grid-template-columns: 1fr; gap: 16px; }
  .poster-frame { padding: 12px; }
  /* the name goes above the card: the side column dissolves into the grid so it can be reordered */
  .poster-side { display: contents; }
  .poster-side > label.poster-field { order: -1; }
  .poster-wrap { width: min(100%, calc((100dvh - 330px) * .8)); min-width: 220px; }
  .poster-tip { width: 210px; font-size: 13px; }
  .share-main, .share-sub { grid-template-columns: 1fr 1fr; }
}
.sbtn {
  display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  font-weight: 600; font-size: 16px; height: 50px; transition: transform .12s, filter .15s, background .15s;
}
.sbtn:active { transform: scale(.97); }
.sbtn.primary { background: var(--btn-blue); color: #fff; box-shadow: var(--btn-blue-hi); }
.sbtn.primary:hover { filter: brightness(1.05); }
.sbtn.outline { background: var(--btn-dark); color: #f4f4f5; box-shadow: var(--btn-dark-hi); }
.sbtn.outline:hover { filter: brightness(1.2); }
.sbtn.dark { background: var(--btn-dark); color: #e6e6e8; box-shadow: var(--btn-dark-hi); font-size: 16px; height: 46px; }
.sbtn.dark:hover { filter: brightness(1.2); }
.toast {
  position: absolute; left: 50%; bottom: 16px; transform: translate(-50%, 10px); opacity: 0;
  background: #fff; color: #000; font-size: 14px; font-weight: 700; padding: 8px 14px; border-radius: 999px;
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }

/* Identity card */
.setup {
  width: 100%; max-width: 1120px; border-radius: 32px;
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-hi), var(--glass-shadow); animation: boardIn .6s cubic-bezier(.2,.8,.2,1);
}
.setup-head { padding: 22px 28px; border-bottom: 1px solid #ffffff14; }
.setup-head h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 24px 32px; }
.setup-col { min-width: 0; display: flex; flex-direction: column; }
.setup-avatar { justify-content: center; }

.laptop { display: grid; place-items: center; min-height: 300px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.laptop-svg { width: 100%; max-width: 440px; filter: drop-shadow(0 18px 24px #0008); }
.laptop .stk { transform-box: fill-box; transform-origin: center; transform: rotate(var(--r)); }
.laptop.pop .stk { animation: stickerPop .45s cubic-bezier(.3,1.6,.5,1); }
.btn.sm { padding: 9px 16px; font-size: 14px; }

/* Laptop with 4 sticker slots laid over the SVG (sizes in cqw so they scale with the laptop) */
.laptop-stage { position: relative; width: 100%; max-width: 440px; container-type: inline-size; }
.laptop-stage .laptop-svg { max-width: none; display: block; }
.slots { position: absolute; inset: 0; }
.slot {
  position: absolute; transform: translate(-50%, -50%) rotate(var(--r)); height: 9.5cqw; border-radius: 2.2cqw;
  display: grid; place-items: center; padding: 0 3.2cqw; border: 0; white-space: nowrap;
  font: 800 4.2cqw/1 ui-monospace, SFMono-Regular, Menlo, monospace; transition: transform .2s cubic-bezier(.3,1.6,.5,1), box-shadow .2s, border-color .2s;
}
.slot.empty {
  width: 24cqw; padding: 0; background: #ffffff08; color: #8b8d93; font: 600 6cqw/1 Inter, sans-serif;
  border: 1.5px dashed #ffffff3a; cursor: pointer;
}
.slot.empty:hover { border-color: #ffffff80; color: #e4e4e7; background: #ffffff10; }
.slot.filled { cursor: pointer; box-shadow: 0 1.2cqw 2.4cqw -1cqw #000a; max-width: 38cqw; }
.slot.filled.icon { min-width: 12cqw; height: 12cqw; padding: 0 2cqw; border-radius: 3cqw; font: 7.4cqw/1 system-ui, sans-serif; }
.slot.filled.icon .slot-input { min-width: 4ch; font-size: 6cqw; }
.slot.filled:hover { transform: translate(-50%, -50%) rotate(var(--r)) scale(1.05); }
.slot.editing { outline: 2px dashed #fff; outline-offset: 3px; z-index: 2; }
.slot:not(.editing) { touch-action: none; }
.slot.dragging { z-index: 3; cursor: grabbing; transform: translate(-50%, -50%) rotate(var(--r)) scale(1.08); box-shadow: 0 3cqw 5cqw -1cqw #000c; transition: none; }
.slot-input {
  width: 100%; min-width: 10ch; max-width: 32cqw; field-sizing: content; padding: 0; border: 0; outline: none;
  background: transparent; color: inherit; font: inherit; text-align: center;
}
.slot-input::placeholder { color: inherit; opacity: .55; }
.slot-del {
  position: absolute; top: -3cqw; right: -3cqw; width: 6cqw; height: 6cqw; border-radius: 50%; border: 0; padding: 0;
  background: #18181b; color: #fff; font: 700 4.6cqw/1 Inter, sans-serif; display: grid; place-items: center; box-shadow: 0 0 0 1px #ffffff40;
}
/* Sticker editor pop-up: colors on top, ready-made stickers below */
.slot-pop {
  position: absolute; left: 50%; top: calc(100% + 2.4cqw); z-index: 4; transform: translateX(-50%) rotate(calc(var(--r) * -1));
  display: flex; flex-direction: column; align-items: center; gap: 2cqw; width: 78cqw; padding: 2cqw; border-radius: 4cqw;
  background: #0d0e10f2; box-shadow: 0 0 0 1px #ffffff1f, 0 2cqw 4cqw -1cqw #000;
  animation: riseIn .2s ease-out; white-space: normal;
}
.slot.up .slot-pop { top: auto; bottom: calc(100% + 2.4cqw); }
.slot-colors { display: flex; gap: 1.4cqw; }
.slot-presets .preset { padding: .6cqw 1cqw; font: 5cqw/1 system-ui, sans-serif; border-color: transparent; background: transparent; }
.slot-presets .preset:hover { background: #ffffff1a; }
.slot-presets .preset.on { background: #5274c94d; border-color: #86a5ea; }
.slot-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: .8cqw; }
.preset {
  padding: 1cqw 2.2cqw; border: 1px solid #ffffff1f; border-radius: 999px; background: #ffffff0d; color: #e4e4e7; cursor: pointer;
  font: 700 3.4cqw/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; transition: background .15s, border-color .15s;
}
.preset:hover { background: #ffffff1f; }
.preset.on { border-color: #86a5ea; background: #5274c94d; color: #fff; }
.cdot { flex: none; width: 5cqw; height: 5cqw; border-radius: 50%; border: 1.5px solid #ffffff30; padding: 0; cursor: pointer; transition: transform .15s; }
.cdot:hover { transform: scale(1.15); }
.cdot.on { outline: 2px solid #fff; outline-offset: 1.5px; }
@keyframes stickerPop { 0% { transform: rotate(var(--r)) scale(.6); } 100% { transform: rotate(var(--r)) scale(1); } }


.prof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.setup-profs { justify-content: center; }
.prof {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  height: 130px; border-radius: 24px; border: 1px solid var(--tile-line); color: var(--text);
  background: var(--btn-dark); box-shadow: var(--btn-dark-hi);
  transition: transform .2s cubic-bezier(.3,1.6,.5,1), background .2s, color .2s, box-shadow .2s, border-color .2s;
}
.prof:hover { transform: translateY(-1px); border-color: #ffffff33; filter: brightness(1.15); }
.prof-icon { font-size: 30px; line-height: 1; transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.prof:hover .prof-icon { transform: scale(1.05); }
.prof-label { font-weight: 800; font-size: 17px; }
.prof.sel { background: var(--btn-blue); color: #fff; border-color: #ffffff40; box-shadow: var(--btn-blue-hi); filter: none; }
.prof.sel .prof-icon { transform: scale(1.08); }

.setup-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid #ffffff14; }
.setup-foot .btn { padding: 12px 24px; }

@media (max-width: 900px) {
  .setup-grid { grid-template-columns: 1fr; padding: 18px 16px; gap: 26px; }
  .setup-head { display: none; } /* the page title already says what to do */
  .setup-foot { padding: 14px 16px; }
  .setup-foot .btn { flex: 1; padding: 15px 18px; white-space: nowrap; } /* full width */
  /* roles in a single column: icon and name side by side so the four fit */
  .prof-grid { grid-template-columns: 1fr; gap: 8px; }
  .setup .prof { flex-direction: row; justify-content: flex-start; gap: 12px; height: 60px; padding: 0 18px; }
  .setup .prof .prof-icon { font-size: 24px; }
  .setup-avatar { display: none; } /* the laptop takes too much height; stickers can still be edited on the career card */
  .laptop { min-height: 0; }
  .laptop-stage { max-width: 340px; }
}

@media (max-width: 900px) {
  .brand { top: 10px; left: 10px; height: 44px; padding: 0 16px 0 8px; font-size: 18px; gap: 6px; }
  .brand img { width: 28px; height: 28px; }
  .game-title { margin: 4px 0 22px; letter-spacing: -1px; }
  .modal-card { padding: 18px; border-radius: 22px; }
  .sbtn { font-size: 15px; }
  .share-sub .sbtn { font-size: 14px; gap: 5px; white-space: nowrap; }
  .share-sub .sbtn svg { width: 15px; height: 15px; }
  .hide-sm { display: none; }
  .stage { justify-content: center; padding: 76px 12px 72px; }
  .hud { flex-wrap: wrap; padding: 8px; gap: 12px; }
  .hud-meters { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .modal-card.result-card { padding: 28px 20px 20px; }
  .result-i { font-size: 54px; }
  .result-h { font-size: 36px; }
  .result-d { font-size: 17px; }
  /* compact meters: name and value on one line, thin bar below, no footnote */
  /* when a big amount doesn't fit next to the name, it drops to a second line instead of cutting it */
  .meter { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 6px; padding: 8px 10px; border-radius: 14px; }
  .meter small { font-size: 13px; white-space: nowrap; }
  .meter b { margin-left: auto; font-size: 16px; letter-spacing: -0.3px; }
  .meter .bar { flex-basis: 100%; height: 4px; margin-top: 5px; }
  .meter-sub { display: none; }
  .summary { grid-template-columns: 1fr 1fr; }
  .career { padding: 18px 14px; }
  .timeline-wrap { height: 55vh; height: 55dvh; overscroll-behavior: auto; } /* at its edge, the swipe scrolls the page */
  /* no timeline dots / line on mobile: more room for the cards */
  .step { padding-left: 0; }
  .step:last-child { padding-bottom: 0; }
  .step::before, .step .dot { display: none; }
  .timeline-wrap { margin-left: 0; padding-left: 0; padding-bottom: 2px; }
  /* the card hugs its content: fade only at the top, where the previous stints hide */
  .timeline-wrap { -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px); mask-image: linear-gradient(180deg, transparent 0, #000 14px); }
  .step.current .step-body { padding: 14px; }
  .step-head { font-size: 22px; }
  .step-body.has-logo > .logo { width: 38px; height: 38px; }
  .step-stats { white-space: normal; }
}

/* ---------- Animations ---------- */
@keyframes boardIn { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Identity screen: small touches of motion ---------- */
/* Title words rise one after another */
.game-title .w { display: inline-block; animation: wordIn .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.15s + var(--w) * 90ms); }
@keyframes wordIn { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
/* Role buttons come in one by one; the header text slides in */
.setup .prof { animation: riseIn .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.25s + var(--i) * 70ms); }
.setup-head h2 { animation: slideIn .5s .15s cubic-bezier(.2,.8,.2,1) both; }
.setup-foot .btn { animation: riseIn .5s .6s cubic-bezier(.2,.8,.2,1) both; }
/* The laptop floats gently and the selected role's icon bobs */
.setup .laptop-stage { animation: lapFloat 5s ease-in-out infinite; }
@keyframes lapFloat { 50% { transform: translateY(-5px); } }
.prof.sel .prof-icon { animation: iconBob 2.4s ease-in-out infinite; }
@keyframes iconBob { 0%, 100% { transform: scale(1.08) rotate(0deg); } 50% { transform: scale(1.12) rotate(-6deg); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-14px); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.3); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes wipeIn { from { clip-path: inset(0 100% 0 0 round 10px); } to { clip-path: inset(0 0 0 0 round 10px); } }
@keyframes glow { 0% { box-shadow: 0 0 0 0 var(--agec, #fff); } 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; transform: translateY(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pulse { 50% { opacity: .45; } }

.rise { animation: riseIn .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms); }
.event { animation: slideIn .4s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 120ms + 150ms); }

/* OVR change */
.delta {
  position: absolute; top: -12px; right: -12px; font-size: 14px; font-weight: 800;
  padding: 2px 6px; border-radius: 999px; animation: floatUp 2.2s .3s both;
}
.delta.up { background: #12b76a; color: #031; }
.delta.down { background: var(--red); color: #fff; }

.trophy.pop { animation: popIn .6s cubic-bezier(.3,1.6,.5,1) both; animation-delay: .5s; }

/* Trophy celebration popup */
.celebrate {
  --cc: var(--gold);
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px;
  background: #000b; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s; cursor: pointer;
}
.celebrate.legendary { --cc: #c084fc; }
.celebrate.in { opacity: 1; }
.celebrate.out { opacity: 0; }
.celeb-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 24px 32px; transform: scale(.6); transition: transform .5s cubic-bezier(.3,1.6,.5,1);
}
.celebrate.in .celeb-card { transform: none; }
.celebrate.out .celeb-card { transform: scale(.9); transition-duration: .3s; }
.celeb-rays {
  position: absolute; left: 50%; top: 84px; width: 520px; height: 520px; margin: -260px 0 0 -260px;
  max-width: 140vw; max-height: 140vw;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--cc) 55%, transparent) 0deg 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 12%, transparent 68%); mask: radial-gradient(circle, #000 12%, transparent 68%);
  animation: spin 14s linear infinite; pointer-events: none;
}
.celeb-glow {
  position: absolute; left: 50%; top: 84px; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--cc) 70%, transparent), transparent 70%);
  animation: pulse 1.6s ease-in-out infinite; pointer-events: none;
}
.celeb-icon {
  position: relative; font-size: 104px; line-height: 120px; height: 120px;
  filter: drop-shadow(0 8px 24px #000a);
  animation: popIn .7s .1s cubic-bezier(.3,1.6,.5,1) both, float 2.4s .8s ease-in-out infinite;
}
.celeb-kicker {
  position: relative; margin-top: 22px; font-size: 14px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  color: var(--cc); animation: riseIn .45s .25s cubic-bezier(.2,.8,.2,1) both;
}
.celeb-title {
  position: relative; margin-top: 8px; max-width: 520px; font-size: 26px; line-height: 1.25; font-weight: 800; letter-spacing: -0.4px; text-wrap: balance;
  text-shadow: 0 2px 16px #000; animation: riseIn .45s .35s cubic-bezier(.2,.8,.2,1) both;
}
.celeb-subs { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.celeb-sub {
  position: relative; padding: 5px 12px; border-radius: 999px; font-size: 15px; font-weight: 700;
  background: #12b76a; color: #031; animation: riseIn .45s .45s cubic-bezier(.2,.8,.2,1) both;
}
.celeb-sub.perk { background: #86a5ea; color: #0b1733; animation-delay: .55s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .celeb-rays, .celeb-glow, .celeb-icon { animation: none; }
}

/* Picking an offer */
.offers.locked { pointer-events: none; }
.offer.picked { transform: scale(1.03); border-color: #86a5ea; box-shadow: var(--btn-dark-hi), 0 0 0 4px #5274c966, 0 18px 40px -14px #000; }
.offer.dismissed { opacity: .18; transform: scale(.94); }

/* Timeline steps */
.step.enter { animation: riseIn .5s cubic-bezier(.2,.8,.2,1) both; }
.step.enter .dot { animation: popIn .5s .2s cubic-bezier(.3,1.6,.5,1) both; }
.step.enter .pill, .step.enter .ev { animation: popIn .5s .45s cubic-bezier(.3,1.6,.5,1) both; }
.step.current { animation: riseIn .35s ease-out both; }

/* ---------- Decisions ---------- */
.decision { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.decision.locked { pointer-events: none; }
.dcard {
  display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 12px; min-width: 0;
  border-radius: 24px; border: 1px solid var(--tile-line); background: var(--btn-dark); box-shadow: var(--btn-dark-hi); color: var(--text); text-align: left;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s, box-shadow .2s, opacity .35s;
}
.dcard:hover { transform: translateY(-3px); border-color: #ffffff40; box-shadow: var(--btn-dark-hi), 0 14px 30px -14px #000; }
.dcard:hover .dart-main { transform: scale(1.1) rotate(-5deg); }
.dcard-title { text-align: center; font-size: 17px; font-weight: 800; }
.dart {
  position: relative; display: grid; place-items: center; height: 170px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--bg) 70%, #fff 12%), var(--bg) 60%, #0d0e10);
}
.dart-main { font-size: 64px; line-height: 1; filter: drop-shadow(0 10px 14px #0008); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.dart-sub { position: absolute; right: calc(50% - 64px); bottom: 18%; font-size: 32px; transform: rotate(12deg); filter: drop-shadow(0 6px 8px #0008); }
.outcomes { display: flex; flex-direction: column; gap: 8px; }
.oc {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; font-size: 14px; font-weight: 600;
  transition: opacity .3s, transform .3s, box-shadow .3s;
}
.oc i { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-style: normal; }
.oc-t { flex: 1; min-width: 0; line-height: 1.25; }
.oc b { flex: none; font-size: 14px; padding: 2px 8px; border-radius: 999px; }
.oc.good { background: #0f2a1d; color: #4ade80; }
.oc.good i, .oc.good b { background: #14402a; }
.oc.bad { background: #2e1218; color: #fb7185; }
.oc.bad i, .oc.bad b { background: #4a1823; }
.oc.neutral { background: #202125; color: #a1a3a9; }
.oc.neutral i { background: #2c2d32; }

.dcard.picked { border-color: #86a5ea; box-shadow: var(--btn-dark-hi), 0 0 0 4px #5274c966, 0 18px 40px -14px #000; transform: scale(1.02); }
.dcard.dismissed { opacity: .25; transform: scale(.96); }
.oc { transition: opacity .3s, box-shadow .08s, transform .08s, filter .08s; }
.oc.spin { transform: scale(1.04); filter: brightness(1.45); }
.oc.faded { opacity: .3; }
.oc.rolled { animation: rolled .7s cubic-bezier(.3,1.6,.5,1) both; }
.oc.rolled.good { box-shadow: 0 0 0 2px #4ade80, 0 0 24px -4px #4ade80aa; }
.oc.rolled.bad { box-shadow: 0 0 0 2px #fb7185, 0 0 24px -4px #fb7185aa; }
.oc.rolled.neutral { box-shadow: 0 0 0 2px #a1a3a9; }
@keyframes rolled { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1.03); } }
@media (max-width: 900px) {
  .decision { grid-template-columns: 1fr; gap: 10px; }
  .dcard { padding: 12px; gap: 10px; }
  .dart { height: 120px; }
  .dart-main { font-size: 52px; }
  .dart-sub { font-size: 26px; right: calc(50% - 52px); bottom: 12%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Music / sound switches (top-right) ---------- */
.sound-toggles { position: fixed; top: 16px; right: 16px; z-index: 60; display: flex; gap: 10px; }
.sound-btn svg { width: 24px; height: 24px; }
.sound-btn {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; padding: 0; color: var(--text);
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-hi), 0 8px 20px -10px #000;
  transition: transform .15s, color .15s, background .15s;
}
.sound-btn:hover { transform: translateY(-1px); background: linear-gradient(160deg, #ffffff24, #ffffff0a 45%), #111214b3; }
.sound-btn:active { transform: scale(.94); }
.sound-btn .mute-mark { display: none; }
.sound-btn.off { color: var(--muted); }
.sound-btn.off .mute-mark { display: inline; }
.sound-btn.off .on-mark { display: none; }
@media (max-width: 900px) {
  .sound-toggles { top: 10px; right: 10px; gap: 6px; }
  .sound-btn { width: 44px; height: 44px; }
  .sound-btn svg { width: 20px; height: 20px; }
}

/* ---------- Radio (opens from the music button) ---------- */
.sound-btn.active { box-shadow: var(--glass-hi), 0 0 0 2px #ff7a1a99; }
.radio {
  --orange: #ff7a1a;
  position: fixed; top: 82px; right: 16px; z-index: 61; width: min(380px, calc(100vw - 20px));
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 24px;
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-hi), 0 24px 50px -20px #000;
  animation: riseIn .2s ease-out;
}
.radio[hidden] { display: none; }
.radio button { border: 0; padding: 0; background: none; color: inherit; cursor: pointer; }
.radio-top { display: flex; align-items: center; gap: 6px; }
.radio-stations { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.radio-stations::-webkit-scrollbar { display: none; }
.radio .radio-chip {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: #00000059; color: #c9cbd0; font: 600 14px Inter, sans-serif; box-shadow: inset 0 0 0 1px #ffffff12;
  transition: background .15s, color .15s;
}
.radio .radio-chip:hover { color: #fff; background: #0000007a; }
.radio .radio-chip.on { color: #fff; box-shadow: inset 0 0 0 1px var(--orange); }
.radio .radio-chip.on svg { color: var(--orange); }
.radio .radio-arrow { flex: none; width: 22px; height: 28px; display: grid; place-items: center; color: var(--muted); }
.radio .radio-arrow:hover { color: #fff; }
.radio-knob {
  flex: none; position: relative; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a4c52, #1b1c20 70%); box-shadow: 0 2px 4px #0008, inset 0 1px 0 #ffffff26;
  transform: rotate(var(--a, 0deg)); transition: transform .4s cubic-bezier(.3,1.4,.5,1);
}
.radio-knob::after { content: ""; position: absolute; left: 50%; top: 4px; width: 2px; height: 8px; margin-left: -1px; border-radius: 2px; background: #e6e7ea; }
.radio-dial {
  display: flex; align-items: stretch; gap: 12px; height: 76px; padding: 10px 14px; border-radius: 16px;
  background: #0b0c0ee0; box-shadow: inset 0 2px 8px #000a, inset 0 0 0 1px #ffffff0d;
}
.radio-bands { display: flex; flex-direction: column; justify-content: space-between; font: 700 13px Inter, sans-serif; color: #c9cbd0; }
.radio-tuner { flex: 1; position: relative; cursor: ew-resize; touch-action: none; outline: none; }
.radio-tuner:focus-visible { box-shadow: 0 0 0 2px #ff7a1a66; border-radius: 6px; }
.radio-tuner .radio-bars { position: absolute; inset: 0 0 14px; }
.radio-marks { position: absolute; left: 0; right: 0; bottom: -2px; height: 12px; pointer-events: none; }
.radio-marks span { position: absolute; transform: translateX(-50%); font: 600 10px Inter, sans-serif; color: #8b8d93; font-variant-numeric: tabular-nums; }
.radio-needle {
  position: absolute; top: -4px; bottom: 10px; width: 2px; margin-left: -1px; border-radius: 2px; pointer-events: none;
  background: #fff; box-shadow: 0 0 8px #ffffffaa; transition: left .35s cubic-bezier(.3,1.3,.5,1);
}
.radio-tuner:active .radio-needle { transition: none; }
.radio-bars { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 2px; position: relative; }
.radio-bars::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #ffffff1f; }
.radio-bars i { flex: 1; max-width: 3px; height: 100%; border-radius: 1px; background: #ffffff2e; transform: scaleY(.2); transition: background .3s; }
.radio.playing .radio-bars i { background: var(--orange); box-shadow: 0 0 6px #ff7a1a66; }
.radio-info { display: flex; gap: 8px; }
.radio-info > * { display: flex; align-items: center; height: 46px; border-radius: 14px; background: #0b0c0ee0; box-shadow: inset 0 2px 6px #0008, inset 0 0 0 1px #ffffff0d; }
.radio-freq { flex: none; width: 92px; justify-content: center; font: 800 21px Inter, sans-serif; font-variant-numeric: tabular-nums; }
.radio-name { flex: 1; min-width: 0; padding: 0 14px; font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-fans { flex: none; gap: 6px; padding: 0 12px; color: #c9cbd0; font-size: 17px; }
.radio-fans b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.radio-foot { display: flex; align-items: center; gap: 12px; padding: 2px 2px 0; }
.radio .radio-power { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); }
.radio.playing .radio-power { color: var(--orange); }
.radio-vol { display: flex; align-items: center; gap: 8px; color: #c9cbd0; }
.radio-vol input { width: 110px; accent-color: #e6e7ea; cursor: pointer; }
.radio .radio-shuffle {
  margin-left: auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: #00000059; color: #c9cbd0; box-shadow: inset 0 0 0 1px #ffffff12;
}
.radio .radio-shuffle:hover { color: #fff; }
@media (max-width: 900px) {
  .radio { top: 62px; right: 10px; }
  .radio-freq { width: 76px; font-size: 18px; }
  .radio-name, .radio-fans { font-size: 15px; }
}

/* ---------- Inbox (bottom-right) ---------- */
.mail { position: fixed; right: 16px; bottom: 16px; z-index: 45; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.mail button { font: inherit; color: inherit; border: 0; cursor: pointer; }
.mail-btn {
  position: relative; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; padding: 0; color: var(--text) !important;
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line) !important; box-shadow: var(--glass-hi), 0 10px 24px -10px #000;
  transition: transform .15s;
}
.mail-btn:hover { transform: translateY(-2px); }
.mail-btn.ring svg { animation: ring .7s ease-in-out; }
@keyframes ring { 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }
.mail-badge {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: #e5484d; box-shadow: 0 0 0 2px #131418;
}
.mail-badge[hidden] { display: none; }
.mail-toast, .mail-panel {
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-hi), 0 20px 40px -18px #000;
}
.mail-toast {
  display: flex; align-items: center; gap: 10px; max-width: 280px; padding: 10px 14px 10px 10px; border-radius: 18px; cursor: pointer;
  font-size: 14px; line-height: 1.3;
}
.mail-toast.in { animation: riseIn .35s cubic-bezier(.2,.8,.2,1); }
.mail-toast b { display: block; }
.mail-toast span span { color: var(--muted); }
.mail-toast[hidden], .mail-panel[hidden] { display: none; }
.mail-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: #ffffff14; }
.mail-panel { width: min(340px, calc(100vw - 32px)); max-height: min(440px, calc(100dvh - 120px)); display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; animation: riseIn .2s ease-out; }
.mail-head { padding: 14px 16px 10px; font-size: 17px; border-bottom: 1px solid #ffffff12; }
.mail-list { overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.mail .mail-item {
  width: 100%; display: flex; gap: 10px; padding: 10px; border-radius: 14px; background: none; text-align: left; transition: background .15s;
}
.mail .mail-item:hover { background: #ffffff0d; }
.mail-txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14px; }
.mail-from { color: var(--muted); font-size: 13px; }
.mail-from i { font-style: normal; opacity: .8; }
.mail-item.new .mail-from { color: #86a5ea; }
.mail-item.new b::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: #86a5ea; vertical-align: 2px; }
.mail-body { color: #c9cbd0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-item.open .mail-body { white-space: normal; margin-top: 4px; line-height: 1.4; }
.mail-empty { margin: 0; padding: 18px; color: var(--muted); font-size: 14px; text-align: center; }
@media (max-width: 900px) {
  .mail { display: none; } /* no inbox on mobile: it covers the cards */
}

/* ---------- Side layout (desktop): stats in a column on the left that stretches to the full
   height of the career card, career path on the right ---------- */
@media (min-width: 901px) {
  .game { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: stretch; }
  .game > .hud { flex-direction: column; align-items: stretch; padding: 14px; }
  .hud-meters { flex: 1; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
  .meter { justify-content: center; padding: 14px 16px 16px; }
  .meter b { font-size: 28px; }
  .timeline-wrap { height: 520px; }
}
