/* 윈도우는 국기 이모지를 지원하지 않아 국기 전용 폰트를 사용 */
@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range:
    U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E,
    U+E0073-E0074, U+E0077, U+E007F;
  src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1.8/dist/TwemojiCountryFlags.woff2")
    format("woff2");
  font-display: swap;
}
:root {
  --bg: #0b0d12;
  --panel: #141821;
  --panel2: #1b2030;
  --line: #262c3d;
  --text: #e8ebf3;
  --muted: #8a93a8;
  --accent: #ff3b30;
  --accent2: #ff6a3d;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --gold: #fbbf24;
  --elite: #a78bfa;
  --r: 14px;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
body {
  font-family:
    "Twemoji Country Flags",
    "Pretendard",
    -apple-system,
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    system-ui,
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
#app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 84px;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
h1,
h2,
h3,
h4 {
  margin: 0 0 6px;
  line-height: 1.25;
}
h3 {
  font-size: 16px;
}
h4 {
  font-size: 14px;
}
p {
  margin: 6px 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.block {
  display: block;
}
.center {
  text-align: center;
}
.dim {
  opacity: 0.25;
}
.gold-t {
  color: var(--gold);
}
.good-t {
  color: var(--good);
}
.bad-t {
  color: var(--bad);
}
main {
  padding: 0 16px;
}

/* buttons */
.btn {
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  transition:
    transform 0.08s,
    background 0.15s;
}
.btn:active {
  transform: scale(0.98);
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #fff;
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
}
.btn.big {
  padding: 14px 20px;
  font-size: 16px;
}
.btn.wide {
  width: 100%;
  margin-top: 10px;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.link {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 0;
}

/* title */
.title-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
  background: radial-gradient(ellipse at top, #2a0d0d 0%, var(--bg) 60%);
}
.title-screen h1 {
  font-size: clamp(36px, 10vw, 60px);
  font-weight: 900;
  letter-spacing: -1px;
}
.title-screen h1 span {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title-screen .sub {
  color: var(--muted);
  margin: 14px 0 28px;
}
.title-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(320px, 100%);
}
.foot {
  color: var(--muted);
  font-size: 12px;
  margin-top: 40px;
}
.title-lights {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}
.title-lights i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
  animation: light 3s infinite;
}
.title-lights i:nth-child(2) {
  animation-delay: 0.25s;
}
.title-lights i:nth-child(3) {
  animation-delay: 0.5s;
}
.title-lights i:nth-child(4) {
  animation-delay: 0.75s;
}
.title-lights i:nth-child(5) {
  animation-delay: 1s;
}
@keyframes light {
  0%,
  10% {
    opacity: 0.15;
    box-shadow: none;
  }
  20%,
  70% {
    opacity: 1;
    box-shadow: 0 0 18px var(--accent);
  }
  80%,
  100% {
    opacity: 0.15;
    box-shadow: none;
  }
}

/* create */
.create {
  padding: 16px;
}
.create-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.create section {
  margin: 18px 0;
}
.create h3 {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.create input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.nat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}
.nat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 2px;
  font-size: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.nat small {
  font-size: 11px;
  color: var(--muted);
}
.nat.on,
.pick.on {
  border-color: var(--accent);
  background: #2a1416;
}
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.pick-grid.four {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.pick {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pick small {
  color: var(--muted);
  font-size: 12.5px;
}
.pick em {
  color: var(--gold);
  font-style: normal;
}
.pick .badge {
  align-self: flex-start;
}

/* header */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 13, 18, 0.92);
  backdrop-filter: blur(10px);
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.who b {
  font-size: 17px;
}
.year {
  color: var(--muted);
  font-weight: 700;
}
.team {
  margin: 4px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  min-width: 0;
}
.team span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip.neg {
  color: var(--bad);
}
.chip.cond .bar {
  width: 44px;
  height: 5px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  white-space: nowrap;
}
.badge.big {
  font-size: 14px;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  margin: 2px 0;
}
.tag.gold {
  color: var(--gold);
  border-color: #5c4710;
  background: #2a2210;
}

/* nav */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  background: rgba(15, 17, 24, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav button {
  flex: 1;
  max-width: 144px;
  background: none;
  border: 0;
  padding: 8px 0 10px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.nav button.on {
  color: var(--text);
  font-weight: 700;
  box-shadow: inset 0 2px var(--accent);
}

/* cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 12px;
}
.card.slim {
  padding: 10px 14px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.card.hero {
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--c, var(--accent)) 18%, var(--panel)) 0%,
    var(--panel) 60%
  );
  border-color: color-mix(in srgb, var(--c, var(--accent)) 35%, var(--line));
}
.card.hero h2 {
  font-size: 24px;
  font-weight: 800;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.hero-stats div {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
}
.hero-stats small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}
.hero-stats b {
  font-size: 14px;
}
.card.danger {
  background: transparent;
  border-style: dashed;
}
.hint {
  color: var(--muted);
  font-size: 12.5px;
}
.toast-inline {
  background: #1d2a1f;
  border: 1px solid #2c4a31;
  color: #bff3cc;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  animation: pop 0.25s;
}
@keyframes pop {
  from {
    transform: translateY(-4px);
    opacity: 0;
  }
}
.last-res {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.last-res b {
  font-size: 22px;
}

/* activities */
.ap {
  color: var(--gold);
  letter-spacing: 2px;
}
.acts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.act {
  text-align: left;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}
.act:not(:disabled):hover {
  border-color: #3a4260;
}
.act .ai {
  font-size: 20px;
}
.act b {
  font-size: 14px;
}
.act small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.act em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}
.act:disabled {
  opacity: 0.4;
}

/* news */
.news {
  list-style: none;
  padding: 0;
  margin: 0;
}
.news li {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.news li:last-child {
  border: 0;
}
.news li small {
  color: var(--muted);
  margin-right: 4px;
}
.news li.big {
  color: var(--gold);
}
.news li.win {
  color: #fde68a;
}
.news li.ach {
  color: var(--elite);
}

/* bars */
.bar {
  flex: 1;
  height: 8px;
  background: #0e1118;
  border-radius: 99px;
  overflow: hidden;
  min-width: 40px;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--muted);
  border-radius: 99px;
}
.bar.bad i {
  background: var(--bad);
}
.bar.c-elite i {
  background: linear-gradient(90deg, #8b5cf6, #c4b5fd);
}
.bar.c-good i {
  background: var(--good);
}
.bar.c-mid i {
  background: var(--warn);
}
.bar.c-low i {
  background: var(--bad);
}
.bar.adapt i {
  background: #38bdf8;
}
.stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 14px;
}
.stat span {
  width: 120px;
  flex-shrink: 0;
  color: var(--muted);
}
.stat b {
  width: 28px;
  text-align: right;
}

/* profile */
.profile {
  display: flex;
  gap: 14px;
  align-items: center;
}
.ovr {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--panel2);
  border: 2px solid var(--line);
  flex-shrink: 0;
}
.ovr b {
  font-size: 28px;
  line-height: 1;
}
.ovr small {
  font-size: 11px;
  color: var(--muted);
}
.ovr.c-elite {
  border-color: var(--elite);
}
.ovr.c-good {
  border-color: var(--good);
}
.ovr.c-mid {
  border-color: var(--warn);
}
.ovr.c-low {
  border-color: var(--bad);
}
.stars {
  color: var(--gold);
  letter-spacing: 1px;
}
.comp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.comp-row .badge {
  width: 120px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comp-row b {
  width: 48px;
  text-align: right;
  font-size: 13px;
}

/* tables */
.seg {
  display: flex;
  background: var(--panel2);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 10px;
}
.seg button {
  flex: 1;
  background: none;
  border: 0;
  padding: 7px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
}
.seg button.on {
  background: var(--line);
  color: var(--text);
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}
.tbl td {
  padding: 7px 4px;
  border-bottom: 1px solid rgba(38, 44, 61, 0.6);
  vertical-align: middle;
}
.tbl .r {
  text-align: right;
}
.tbl tr.me td {
  background: rgba(255, 59, 48, 0.12);
}
.tbl tr.me td:first-child {
  box-shadow: inset 3px 0 var(--accent);
}
.tbl tr.out td {
  opacity: 0.45;
}
.tbl tr.gap td {
  text-align: center;
  color: var(--muted);
  padding: 0;
  border: 0;
}
.tbl.compact td {
  padding: 5px 4px;
}
.tbl small.block {
  font-size: 11.5px;
}
.tc {
  display: inline-block;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -2px;
}

/* career */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0;
}
.kpis div {
  background: var(--panel2);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}
.kpis b {
  display: block;
  font-size: 22px;
}
.kpis small {
  color: var(--muted);
  font-size: 12px;
}
.titles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.specials {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.sp {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  opacity: 0.55;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sp.on {
  opacity: 1;
  border-color: #5c4710;
  background: #2a2210;
}
.sp span {
  font-size: 26px;
}
.sp small {
  font-size: 12px;
}
.sp em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--gold);
}
.achs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.ach {
  background: var(--panel2);
  border-radius: 12px;
  padding: 10px;
  opacity: 0.35;
  display: flex;
  flex-direction: column;
  filter: grayscale(1);
}
.ach.on {
  opacity: 1;
  filter: none;
  border: 1px solid #3b2f6b;
}
.ach span {
  font-size: 22px;
}
.ach b {
  font-size: 13.5px;
}
.ach small {
  font-size: 12px;
  color: var(--muted);
}

/* world */
.world-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.world-row:last-child {
  border: 0;
}
.wr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.champs {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  font-size: 13.5px;
}
.champs li {
  padding: 3px 0;
}
.champs li.me {
  color: var(--gold);
  font-weight: 700;
}
.champs li small {
  color: var(--muted);
  margin-right: 4px;
}
details summary {
  cursor: pointer;
  color: var(--muted);
  padding: 4px 0;
}

/* race */
.race {
  min-height: 100vh;
}
.race-head {
  padding: 16px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--c) 22%, var(--bg)),
    var(--bg)
  );
  margin-bottom: 8px;
}
.race-head h2 {
  font-size: 24px;
  font-weight: 800;
  margin-top: 6px;
}
.steps {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.steps span {
  flex: 1;
  text-align: center;
  padding: 5px 0;
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
}
.steps span.done {
  background: color-mix(in srgb, var(--c) 30%, var(--panel));
  color: var(--text);
}
.steps span.cur {
  border-color: var(--c);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--c) inset;
}
.log ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}
.log li {
  padding: 4px 0;
  font-size: 14.5px;
}
.log.fresh {
  animation: pop 0.3s;
  border-color: color-mix(in srgb, var(--c) 40%, var(--line));
}
details.card .log {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}
.decision {
  border-color: color-mix(in srgb, var(--c) 50%, var(--line));
}
.opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition:
    border-color 0.15s,
    transform 0.08s;
}
.opt:hover {
  border-color: #4a5375;
}
.opt:active {
  transform: scale(0.99);
}
.opt b {
  display: block;
  font-size: 15px;
}
.opt small {
  color: var(--muted);
  font-size: 12.5px;
}
.opt-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.gain {
  color: var(--good);
  font-size: 13px;
  letter-spacing: -1px;
  white-space: nowrap;
}
.gain small {
  color: var(--muted);
  letter-spacing: 0;
  font-size: 11px;
}
.risk {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
.risk.lo {
  background: #13301e;
  color: #86efac;
}
.risk.mid {
  background: #3a2c0c;
  color: #fcd34d;
}
.risk.hi {
  background: #3d1414;
  color: #fca5a5;
}

/* offers */
.offers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.offer {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.offer.locked {
  opacity: 0.55;
}
.of-top {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.of-team {
  font-size: 15.5px;
}
.of-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 13px;
}
.of-meta span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  flex-basis: 100%;
}

/* retired */
.retired .card {
  width: min(560px, 100%);
  text-align: left;
  margin-top: 16px;
}
.legacy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 10px 0;
}
.legacy small {
  color: var(--muted);
}
.legacy b {
  font-size: 40px;
  font-weight: 900;
  color: var(--gold);
}
.legacy em {
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
}

/* modal */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.2s;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  animation: up 0.25s ease-out;
}
@keyframes up {
  from {
    transform: translateY(40px);
  }
}
@media (min-width: 640px) {
  .modal-bg {
    align-items: center;
  }
  .modal {
    border-radius: 20px;
  }
}
.ev-text {
  font-size: 15.5px;
}
.ev-res {
  font-size: 16px;
  padding: 10px 0;
}
.big-pos {
  font-size: 64px;
  font-weight: 900;
  text-align: center;
  line-height: 1.1;
  margin: 8px 0;
}
.podium {
  padding-left: 22px;
  margin: 10px 0;
}
.podium li {
  padding: 3px 0;
}
.podium li.me {
  color: var(--gold);
  font-weight: 700;
}
.note {
  background: #2a2210;
  color: #fde68a;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
}

@media (max-width: 420px) {
  .stat span {
    width: 96px;
    font-size: 13px;
  }
  .comp-row .badge {
    width: 96px;
  }
  .acts {
    grid-template-columns: 1fr 1fr;
  }
  .kpis b {
    font-size: 18px;
  }
}

/* 대표 능력치 */
.core-wrap {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 12px;
  align-items: center;
}
.radar {
  width: 100%;
  height: auto;
  display: block;
}
.rd-ring {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}
.rd-axis {
  stroke: var(--line);
  stroke-width: 1;
}
.rd-data {
  fill: rgba(255, 59, 48, 0.28);
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
}
.rd-label {
  fill: var(--muted);
  font-size: 11px;
  text-anchor: middle;
  dominant-baseline: middle;
}
.rd-val {
  fill: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}
.core-desc {
  display: block;
  font-size: 11.5px;
  margin: -4px 0 4px 0;
}
.sub-group {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.sub-group:last-child {
  border: 0;
}
.stat.sub {
  padding: 3px 0 3px 10px;
  font-size: 13.5px;
}
.act .up {
  font-size: 11px;
  color: var(--good);
  font-weight: 700;
  margin-top: 2px;
}
.core-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--panel2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}
.check-line {
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.check-line b {
  color: var(--text);
}
.opt small.opt-core {
  display: block;
  color: #93c5fd;
  font-size: 11.5px;
  margin-top: 2px;
}

/* 병역 */
.mil-note {
  background: #1c2412;
  border: 1px solid #3f5a1a;
  color: #d9f99d;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin: 8px 0;
}
.card.mil-note {
  margin: 0 0 12px;
}
.offer.mil {
  border-color: #3f5a1a;
  background: #161d10;
}

/* 은퇴 */
.btn.retire {
  background: #2a1416;
  border-color: #5b1f22;
  color: #fca5a5;
}

@media (max-width: 560px) {
  .core-wrap {
    grid-template-columns: 1fr;
  }
  .radar {
    max-width: 280px;
    margin: 0 auto;
  }
}

/* 라이선스 */
.lic-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.lic-row span {
  color: var(--muted);
}
.checks {
  list-style: none;
  padding: 0;
  margin: 6px 0;
  font-size: 13.5px;
}
.checks li {
  padding: 2px 0;
  color: var(--muted);
}
.checks li.ok {
  color: var(--text);
}
.grade {
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 12.5px;
}
.grade.platinum {
  background: #2a2540;
  color: #c4b5fd;
}
.grade.gold {
  background: #2a2210;
  color: var(--gold);
}
.grade.silver {
  background: #22262f;
  color: #cbd5e1;
}
.grade.bronze {
  background: #2a1a10;
  color: #fdba74;
}
.mil-note.bad {
  background: #2a1416;
  border-color: #5b1f22;
  color: #fca5a5;
}

/* 테스트 주행 */
.verdict {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 6px;
}
.verdict.pass {
  background: #13301e;
  color: #86efac;
}
.verdict.hold {
  background: #3a2c0c;
  color: #fcd34d;
}
.verdict.fail {
  background: #3d1414;
  color: #fca5a5;
}
.offer.tested {
  opacity: 0.9;
}
.test-log {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  font-size: 13px;
}
.test-log li {
  padding: 2px 0;
}
.test-sum {
  list-style: none;
  padding: 0;
  margin: 6px 0;
  font-size: 13.5px;
}
.test-sum li {
  padding: 4px 0;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.offers + .card {
  margin-top: 12px;
}

/* 시트 유형 */
.tag.seat {
  font-weight: 700;
}
.tag.seat.s-race {
  color: #fca5a5;
  border-color: #5b1f22;
  background: #2a1416;
}
.tag.seat.s-part {
  color: #fcd34d;
  border-color: #5c4710;
  background: #2a2210;
}
.tag.seat.s-side {
  color: #93c5fd;
  border-color: #1e3a5f;
  background: #111c2e;
}
.tag.seat.s-stay {
  color: #86efac;
  border-color: #1f4a2c;
  background: #13301e;
}
.perk {
  color: #93c5fd;
  font-size: 12.5px;
}

/* 생성 마법사 */
.create {
  padding-bottom: 96px;
}
.create-head {
  justify-content: space-between;
}
.wiz-steps {
  display: flex;
  gap: 4px;
  margin: 4px 0 8px;
}
.wiz-steps span {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 6px 2px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  line-height: 1.25;
}
.wiz-steps span b {
  display: block;
  font-size: 14px;
}
.wiz-steps span.done {
  color: var(--text);
  background: #2a1416;
  border-color: #5b1f22;
}
.wiz-steps span.cur {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.wiz-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11, 13, 18, 0.95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.wiz-nav .btn {
  flex: 1;
  max-width: 340px;
  padding: 13px;
}
.info-card {
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}
.big-flag {
  font-size: 18px;
}
.route-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pick-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.route-detail {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rd-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
}
.rd-row span {
  color: var(--muted);
  flex-shrink: 0;
}
.rd-row b {
  text-align: right;
  font-weight: 600;
}
.notes {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: #cbd2e1;
}
.notes li {
  padding: 2px 0;
}
.story {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.65;
  color: #d6dbe7;
}
.chipline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
}
.chipline span {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}
.pick.rec {
  border-color: #5c4710;
}
.pick.rec.on {
  border-color: var(--accent);
}
.roll-panel {
  margin-top: 4px;
}
.ovr-mini {
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--panel2);
}
.ovr-mini.c-elite {
  color: var(--elite);
}
.ovr-mini.c-good {
  color: var(--good);
}
.ovr-mini.c-mid {
  color: var(--warn);
}
.ovr-mini.c-low {
  color: var(--bad);
}
.stat.core-line span {
  color: var(--text);
  font-weight: 700;
}
.stat.sub {
  flex-wrap: wrap;
}
.src {
  font-style: normal;
  display: flex;
  gap: 4px;
  flex-basis: 100%;
  padding-left: 0;
}
.src:empty {
  display: none;
}
.src i {
  font-style: normal;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 5px;
}
.src i.st {
  background: #2a1416;
  color: #fca5a5;
}
.src i.bg {
  background: #111c2e;
  color: #93c5fd;
}
.src i.tr {
  background: #13301e;
  color: #86efac;
}
@media (max-width: 420px) {
  .wiz-steps span {
    font-size: 10px;
  }
}

/* 상단 메인·은퇴 버튼 */
.top-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.icon-btn {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
}
.icon-btn.danger {
  color: #fca5a5;
  border-color: #5b1f22;
}
.race-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* 능력치 보정 표시 */
.mods {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 6px;
}
.mods-label {
  font-size: 11px;
  color: var(--muted);
  min-width: 34px;
}
.mchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
}
.mchip b {
  font-weight: 800;
}
.mchip.up {
  background: #13301e;
  color: #86efac;
  border-color: #1f4a2c;
}
.mchip.down {
  background: #3d1414;
  color: #fca5a5;
  border-color: #5b1f22;
}
.mchip.info {
  background: var(--panel2);
  color: #cbd2e1;
  border-color: var(--line);
}
.mchip.core.up {
  background: #0f2a2a;
  color: #5eead4;
  border-color: #134e4a;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.lg::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: -1px;
}
.lg.b0::before {
  background: #64748b;
}
.lg.st::before {
  background: #f87171;
}
.lg.bg::before {
  background: #60a5fa;
}
.lg.tr::before {
  background: #4ade80;
}
.lg.neg::before {
  background: repeating-linear-gradient(
    45deg,
    #ef4444 0 2px,
    transparent 2px 4px
  );
  border: 1px solid #ef4444;
}

.srow {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas: "nm pl val" "bar bar bar";
  align-items: center;
  column-gap: 8px;
  row-gap: 3px;
  padding: 5px 0;
  font-size: 13.5px;
}
.srow .nm {
  grid-area: nm;
  color: var(--muted);
}
.srow .bar2 {
  grid-area: bar;
}
.srow .pills {
  grid-area: pl;
  justify-content: flex-end;
}
.srow.core .nm {
  color: var(--text);
  font-weight: 700;
}
.srow > b {
  grid-area: val;
  text-align: right;
  min-width: 26px;
}
.srow.core > b {
  font-size: 15px;
}
.bar2 {
  display: flex;
  height: 9px;
  background: #0e1118;
  border-radius: 99px;
  overflow: hidden;
}
.srow.core .bar2 {
  height: 11px;
}
.bar2 i {
  display: block;
  height: 100%;
  flex-shrink: 0;
}
.bar2 .b0 {
  background: #64748b;
}
.bar2 .st {
  background: #f87171;
}
.bar2 .bg {
  background: #60a5fa;
}
.bar2 .tr {
  background: #4ade80;
}
.bar2 .neg {
  background: repeating-linear-gradient(
    45deg,
    rgba(239, 68, 68, 0.75) 0 2px,
    transparent 2px 5px
  );
}
.pills {
  display: flex;
  gap: 3px;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.pill {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  padding: 0 5px;
  border-radius: 5px;
  line-height: 17px;
}
.pill.st {
  background: #3b1517;
  color: #fca5a5;
}
.pill.bg {
  background: #13233d;
  color: #93c5fd;
}
.pill.tr {
  background: #123321;
  color: #86efac;
}

/* 이모지 제거 후 빈 아이콘 자리 정리 */
.sp > span:empty,
.ach > span:empty {
  display: none;
}
.nav button {
  font-size: 13.5px;
  padding: 14px 0 16px;
}
.stars {
  color: var(--gold);
}
.chip small {
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
}

/* =====================================================================
   테마: 다크(기본) / 라이트
   ===================================================================== */
:root {
  --map-bg: #10141d; --map-edge: #2b3346; --map-asphalt: #3a4256;
  --c-money: #fbbf24; --c-fame: #f472b6; --c-rel: #4ade80; --c-cond: #f87171;
  --up: #86efac; --up-bg: #13301e; --up-bd: #1f4a2c;
  --dn: #fca5a5; --dn-bg: #3d1414; --dn-bd: #5b1f22;
  --gd: #fde68a; --gd-bg: #2a2210; --gd-bd: #5c4710;
  --bl: #93c5fd; --bl-bg: #111c2e; --bl-bd: #1e3a5f;
  --glass: rgba(11, 13, 18, .92);
}
:root[data-theme="light"] {
  --bg: #f3f4f8; --panel: #ffffff; --panel2: #eef0f6; --line: #d9dde7;
  --text: #151a24; --muted: #5b6477;
  --gold: #b45309; --elite: #6d28d9; --good: #15803d; --bad: #dc2626; --warn: #b45309;
  --map-bg: #e9edf4; --map-edge: #c3cad8; --map-asphalt: #4b5468;
  --c-money: #b45309; --c-fame: #db2777; --c-rel: #15803d; --c-cond: #dc2626;
  --up: #166534; --up-bg: #dcfce7; --up-bd: #bbf7d0;
  --dn: #991b1b; --dn-bg: #fee2e2; --dn-bd: #fecaca;
  --gd: #92400e; --gd-bg: #fef3c7; --gd-bd: #fde68a;
  --bl: #1e40af; --bl-bg: #dbeafe; --bl-bd: #bfdbfe;
  --glass: rgba(255, 255, 255, .92);
}
body { transition: background .25s, color .25s; }
.top, .nav, .wiz-nav { background: var(--glass); }
[data-theme="light"] .title-screen { background: radial-gradient(ellipse at top, #ffe4e1 0%, var(--bg) 60%); }
[data-theme="light"] .bar, [data-theme="light"] .bar2 { background: #e2e6ee; }
[data-theme="light"] .pick.on, [data-theme="light"] .nat.on { background: #fff1f0; }
[data-theme="light"] .tbl tr.me td { background: rgba(255, 59, 48, .08); }
[data-theme="light"] .hero-stats div { background: rgba(0, 0, 0, .04); }
[data-theme="light"] .ach.on { border-color: #ddd6fe; }
[data-theme="light"] .news li.win { color: #a16207; }
[data-theme="light"] .rd-data { fill: rgba(255, 59, 48, .18); }
[data-theme="light"] .modal-bg { background: rgba(20, 24, 33, .45); }
.mchip.up, .pill.tr, .risk.lo, .verdict.pass, .tag.seat.s-stay { background: var(--up-bg); color: var(--up); border-color: var(--up-bd); }
.mchip.down, .risk.hi, .verdict.fail, .tag.seat.s-race, .pill.st, .btn.retire, .mil-note.bad, .icon-btn.danger { background: var(--dn-bg); color: var(--dn); border-color: var(--dn-bd); }
.tag.gold, .note, .risk.mid, .verdict.hold, .tag.seat.s-part, .sp.on { background: var(--gd-bg); color: var(--gd); border-color: var(--gd-bd); }
.pill.bg, .tag.seat.s-side { background: var(--bl-bg); color: var(--bl); border-color: var(--bl-bd); }
.perk, .opt small.opt-core { color: var(--bl); }
[data-theme="light"] .mchip.core.up { background: #ccfbf1; color: #115e59; border-color: #99f6e4; }
[data-theme="light"] .mil-note, [data-theme="light"] .offer.mil { background: #ecfccb; color: #3f6212; border-color: #d9f99d; }
[data-theme="light"] .toast-inline { background: var(--up-bg); color: var(--up); border-color: var(--up-bd); }
[data-theme="light"] .grade.platinum { background: #ede9fe; color: #5b21b6; }
[data-theme="light"] .grade.gold { background: #fef3c7; color: #92400e; }
[data-theme="light"] .grade.silver { background: #e5e7eb; color: #374151; }
[data-theme="light"] .grade.bronze { background: #ffedd5; color: #9a3412; }
[data-theme="light"] .src i.st { background: #fee2e2; color: #991b1b; }
[data-theme="light"] .src i.bg { background: #dbeafe; color: #1e40af; }
[data-theme="light"] .src i.tr { background: #dcfce7; color: #166534; }
[data-theme="light"] .start-lights i { background: #e5d4d4; }
.theme-fab { position: absolute; top: 16px; right: 16px; z-index: 2; }

/* =====================================================================
   헤더 칩: 자금 금색 · 인기 분홍 · 신뢰 초록 · 컨디션 빨강
   ===================================================================== */
.chips { gap: 8px; }
.chip { font-size: 14.5px; padding: 5px 12px; gap: 7px; border-width: 1.5px; }
.chip small { font-size: 12px; font-weight: 600; color: inherit; opacity: .8; }
.chip b { font-weight: 800; }
.chip.money { color: var(--c-money); border-color: color-mix(in srgb, var(--c-money) 45%, transparent); background: color-mix(in srgb, var(--c-money) 12%, var(--panel)); }
.chip.fame { color: var(--c-fame); border-color: color-mix(in srgb, var(--c-fame) 45%, transparent); background: color-mix(in srgb, var(--c-fame) 12%, var(--panel)); }
.chip.rel { color: var(--c-rel); border-color: color-mix(in srgb, var(--c-rel) 45%, transparent); background: color-mix(in srgb, var(--c-rel) 12%, var(--panel)); }
.chip.cond { color: var(--c-cond); border-color: color-mix(in srgb, var(--c-cond) 45%, transparent); background: color-mix(in srgb, var(--c-cond) 12%, var(--panel)); }
.chip.cond .bar { width: 52px; height: 6px; }
.bar.cond i { background: var(--c-cond); }
.chip.money.neg { color: var(--bad); }

/* =====================================================================
   훈련 카드 3열 · 글자 크게 / 뉴스·팬 반응 글자 크게
   ===================================================================== */
.acts { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.act { padding: 14px 12px; min-height: 128px; gap: 4px; }
.act b { font-size: 16px; }
.act small { font-size: 13.5px; }
.act .up { font-size: 13px; }
.act em { font-size: 13px; }
@media (max-width: 520px) { .acts { grid-template-columns: repeat(2, 1fr); } }
.news li { font-size: 15px; padding: 9px 0; }

/* 홈 능력치 카드 */
.hs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.hs { background: var(--panel2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.hs-top { display: flex; justify-content: space-between; align-items: baseline; }
.hs-top b { font-size: 15px; }
.hs-top span { font-size: 20px; font-weight: 800; }
.hs small { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.hs .up-t { color: var(--good); font-weight: 700; }
.hs.flash { animation: statFlash 1.6s ease-out; }
@keyframes statFlash { 0% { box-shadow: 0 0 0 2px var(--good); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* 팬 반응 */
.fans ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.fan { background: var(--panel2); border-radius: 12px; padding: 10px 12px; border-left: 3px solid var(--line); animation: rise .4s both; }
.fan.pos { border-left-color: var(--good); }
.fan.neg { border-left-color: var(--bad); }
.fan.neu { border-left-color: var(--muted); }
.fan-top { display: flex; justify-content: space-between; align-items: center; }
.fan-top b { font-size: 14px; }
.fan p { margin: 4px 0; font-size: 15px; }
.fan small { color: var(--muted); font-size: 12.5px; }
.lang { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 5px; background: var(--line); color: var(--muted); }

/* 은퇴 버튼 (홈 하단 긴 바) */
.retire-bar { width: 100%; margin: 4px 0 16px; padding: 15px; border-radius: 12px; font-size: 15.5px; font-weight: 700; background: var(--dn-bg); color: var(--dn); border: 1.5px solid var(--dn-bd); }
.retire-bar:hover { filter: brightness(1.1); }

/* 화면 안 확인창 */
.confirm h3 { font-size: 18px; }
.confirm p { font-size: 15px; color: var(--muted); }
.confirm-btns { display: flex; gap: 8px; margin-top: 14px; }
.confirm-btns .btn { flex: 1; padding: 13px; }
.danger-btn { background: var(--bad); border-color: transparent; color: #fff; }

/* 포인트 순위표 */
.modal.wide { max-width: 860px; }
.board-wrap { overflow-x: auto; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; }
.tbl.board { font-size: 13px; white-space: nowrap; }
.tbl.board th, .tbl.board td { padding: 6px; }
.tbl.board .nm { position: sticky; left: 0; background: var(--panel); min-width: 130px; }
.tbl.board tr.me .nm { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.rc { text-align: center; min-width: 28px; }
td.rc { font-weight: 700; }
td.rc.p1 { background: color-mix(in srgb, #fbbf24 30%, transparent); }
td.rc.p2 { background: color-mix(in srgb, #94a3b8 30%, transparent); }
td.rc.p3 { background: color-mix(in srgb, #d97706 25%, transparent); }
td.rc.dnf { color: var(--bad); }

/* 훈련 결과 알림 */
#toast { position: fixed; top: 12px; left: 0; right: 0; z-index: 60; display: flex; justify-content: center; pointer-events: none; padding: 0 12px; }
.toast-float { pointer-events: auto; cursor: pointer; max-width: 560px; width: 100%; background: var(--panel); border: 1.5px solid var(--good); border-radius: 14px; padding: 12px 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); animation: toastIn .35s cubic-bezier(.2, .9, .3, 1.2) both, toastOut .3s ease-in 1.2s forwards; }
.toast-float.err { border-color: var(--bad); }
.toast-float b { font-size: 15px; }
.toast-float p { margin: 3px 0; font-size: 15px; }
@keyframes toastIn { from { transform: translateY(-30px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-20px); opacity: 0; } }

/* =====================================================================
   서킷 지도
   ===================================================================== */
.trackmap { width: 100%; height: auto; display: block; }
.map-bg { fill: var(--map-bg); }
.trk-edge { fill: none; stroke: var(--map-edge); stroke-width: 9; stroke-linejoin: round; stroke-linecap: round; }
.trk-asphalt { fill: none; stroke: var(--map-asphalt); stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; }
.trk-line { fill: none; stroke: var(--c, var(--accent)); stroke-width: 1.1; stroke-dasharray: 100; stroke-dashoffset: 100; animation: drawTrack 1.6s ease-out forwards; opacity: .9; }
@keyframes drawTrack { to { stroke-dashoffset: 0; } }
.sf-line { fill: #fff; stroke: #111; stroke-width: .5; }
.flag-lbl { font-size: 4px; font-weight: 800; fill: var(--muted); text-anchor: middle; }
.ss-mark circle { fill: var(--panel); stroke: var(--c, var(--accent)); stroke-width: .8; }
.ss-mark text { font-size: 3px; font-weight: 800; fill: var(--text); text-anchor: middle; }
.wp { fill: var(--panel); stroke: #d97706; stroke-width: .8; }
.trackmap.raid .trk-asphalt { stroke: #c2410c; stroke-dasharray: 3 2; stroke-width: 2; }
.trackmap.raid .trk-edge { stroke: rgba(217, 119, 6, .25); stroke-width: 6; }
.trackmap.raid .map-bg { fill: color-mix(in srgb, #d97706 14%, var(--map-bg)); }
.dunes { fill: none; stroke: rgba(217, 119, 6, .35); stroke-width: 1; }
.car-lbl { font-size: 3.6px; font-weight: 800; fill: var(--text); text-anchor: middle; paint-order: stroke; stroke: var(--map-bg); stroke-width: 1px; }
.rain line { stroke: rgba(147, 197, 253, .55); stroke-width: .6; animation: rainFall .7s linear infinite; }
@keyframes rainFall { from { transform: translate(0, 0); } to { transform: translate(-8px, 110px); } }
.map-card { padding: 10px; }
.map-card .trackmap { max-height: 300px; }
.map-cap { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--muted); }
.wet-tag { color: var(--bl); font-weight: 800; }
.hero-body { display: grid; grid-template-columns: 1fr 200px; gap: 12px; align-items: center; }
.hero-map { border-radius: 12px; overflow: hidden; }
@media (max-width: 560px) { .hero-body { grid-template-columns: 1fr; } .hero-map { max-width: 260px; margin: 0 auto; width: 100%; } }
.title-screen { position: relative; overflow: hidden; }
.title-map { position: absolute; inset: 0; opacity: .16; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.title-map .trackmap { width: min(720px, 120vw); }
.title-map .map-bg { fill: transparent; }
.title-screen > *:not(.title-map):not(.theme-fab) { position: relative; z-index: 1; }

/* =====================================================================
   애니메이션
   ===================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
main > .card, main > .offers, main > .retire-bar { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
main > :nth-child(2) { animation-delay: .04s; }
main > :nth-child(3) { animation-delay: .08s; }
main > :nth-child(4) { animation-delay: .12s; }
main > :nth-child(5) { animation-delay: .16s; }
main > :nth-child(6) { animation-delay: .2s; }
main > :nth-child(7) { animation-delay: .24s; }
.bar i, .bar2 i { transform-origin: left; animation: barGrow .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes barGrow { from { transform: scaleX(0); } }
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent); transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.btn, .opt, .act, .pick { transition: transform .12s, border-color .15s, box-shadow .15s; }
.opt:hover, .act:not(:disabled):hover, .pick:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.race-head { position: relative; overflow: hidden; }
.race-head::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(100deg, transparent 0 38px, color-mix(in srgb, var(--c) 10%, transparent) 38px 40px); background-size: 240px 100%; animation: speed 1.4s linear infinite; pointer-events: none; }
.race-head > * { position: relative; }
@keyframes speed { to { background-position: -240px 0; } }
.start-lights { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; }
.start-lights i { width: 18px; height: 18px; border-radius: 50%; background: #3a1414; animation: startLight 3s both; }
.start-lights i:nth-child(1) { animation-delay: .2s; }
.start-lights i:nth-child(2) { animation-delay: .6s; }
.start-lights i:nth-child(3) { animation-delay: 1s; }
.start-lights i:nth-child(4) { animation-delay: 1.4s; }
.start-lights i:nth-child(5) { animation-delay: 1.8s; }
@keyframes startLight { 0% { background: #3a1414; } 1%, 70% { background: var(--accent); box-shadow: 0 0 12px var(--accent); } 100% { background: #3a1414; box-shadow: none; } }
.tbl tr.gain td { animation: gainFlash 1.4s ease-out; }
.tbl tr.drop td { animation: dropFlash 1.4s ease-out; }
@keyframes gainFlash { 0% { background: color-mix(in srgb, var(--good) 35%, transparent); } }
@keyframes dropFlash { 0% { background: color-mix(in srgb, var(--bad) 30%, transparent); } }
.dl { font-size: 10.5px; font-weight: 800; margin-left: 4px; }
.dl.up { color: var(--good); }
.dl.dn { color: var(--bad); }
.finish-card { overflow: hidden; }
.checker { height: 22px; margin: -14px -14px 12px; background: repeating-conic-gradient(#111 0 25%, #fff 0 50%) 0 0 / 22px 22px; animation: checker 1s linear infinite; }
@keyframes checker { to { background-position: 44px 0; } }
.modal { position: relative; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.confetti i { position: absolute; top: -12px; width: 7px; height: 12px; border-radius: 2px; animation: confetti 2.4s ease-in infinite; }
@keyframes confetti { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(420px) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* =====================================================================
   성장 배경 칩 색상: 자금 금색 · 인기 분홍 · 성장 잠재력 청록
   ===================================================================== */
:root { --c-pot: #22d3ee; }
:root[data-theme="light"] { --c-pot: #0e7490; }
.chipline span { font-weight: 600; border-width: 1.5px; }
.chipline span b { font-weight: 800; }
.chipline .cl-money { color: var(--c-money); border-color: color-mix(in srgb, var(--c-money) 45%, transparent); background: color-mix(in srgb, var(--c-money) 12%, var(--panel)); }
.chipline .cl-fame { color: var(--c-fame); border-color: color-mix(in srgb, var(--c-fame) 45%, transparent); background: color-mix(in srgb, var(--c-fame) 12%, var(--panel)); }
.chipline .cl-pot { color: var(--c-pot); border-color: color-mix(in srgb, var(--c-pot) 45%, transparent); background: color-mix(in srgb, var(--c-pot) 12%, var(--panel)); }

/* =====================================================================
   업적: 흐리게 처리하던 방식 대신 상태 표시로 구분 (두 테마 모두 잘 보이게)
   ===================================================================== */
.ach { opacity: 1; filter: none; border: 1.5px dashed var(--line); gap: 3px; }
.ach b { color: var(--muted); font-size: 14px; }
.ach small { color: var(--muted); font-size: 12.5px; }
.ach.on { border: 1.5px solid color-mix(in srgb, var(--elite) 55%, transparent); background: color-mix(in srgb, var(--elite) 12%, var(--panel)); }
.ach.on b { color: var(--text); }
.ach.on small { color: var(--text); opacity: .8; }
.ach-st { font-style: normal; align-self: flex-start; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 5px; background: var(--line); color: var(--muted); }
.ach.on .ach-st { background: var(--elite); color: #fff; }
.sp { opacity: 1; }
.sp:not(.on) small, .sp:not(.on) b { color: var(--muted); }

/* =====================================================================
   라이트 모드 가독성 보정
   ===================================================================== */
.story { color: var(--text); }
.notes { color: var(--text); opacity: .85; }
.mchip.info { color: var(--text); }
[data-theme="light"] .wiz-steps span.done { background: #fff1f0; border-color: #fecaca; color: var(--text); }
[data-theme="light"] .pick.rec { border-color: #fcd34d; }
[data-theme="light"] .badge { color: color-mix(in srgb, var(--c) 55%, #000); background: color-mix(in srgb, var(--c) 16%, #fff); border-color: color-mix(in srgb, var(--c) 50%, #fff); }
[data-theme="light"] .news li { color: var(--text); }
[data-theme="light"] .news li.ach { color: #5b21b6; font-weight: 600; }
[data-theme="light"] .news li.big { color: #92400e; font-weight: 600; }
[data-theme="light"] .news li small { color: var(--muted); }
[data-theme="light"] .icon-btn { color: var(--text); }
[data-theme="light"] .tbl th { color: #4b5563; }
[data-theme="light"] .tbl tr.out td { opacity: .6; }
[data-theme="light"] .act:disabled { opacity: .55; }
[data-theme="light"] .act small, [data-theme="light"] .act em { color: #4b5563; }
[data-theme="light"] .pick small { color: #4b5563; }
[data-theme="light"] .hint { color: #4b5563; }
[data-theme="light"] .muted { color: #4b5563; }
[data-theme="light"] .dim { opacity: .35; }
[data-theme="light"] .ap { color: #b45309; }
[data-theme="light"] .tag { color: var(--text); }
[data-theme="light"] .steps span { color: #4b5563; }
[data-theme="light"] .steps span.done { color: var(--text); }
[data-theme="light"] .lang { background: #e5e7eb; color: #374151; }
[data-theme="light"] .fan small, [data-theme="light"] .hs small { color: #4b5563; }
[data-theme="light"] .kpis small, [data-theme="light"] .hero-stats small { color: #4b5563; }
[data-theme="light"] .legacy b { color: #b45309; }

/* 레이스 그리드 접이식 메뉴 */
.grid-drop summary { list-style: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 2px 0; font-size: 15px; }
.grid-drop summary::-webkit-details-marker { display: none; }
.gd-meta { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.gd-arrow { font-style: normal; font-size: 11px; transition: transform .2s; }
.grid-drop[open] .gd-arrow { transform: rotate(180deg); }
.grid-drop[open] summary { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.grid-drop[open] .tbl { animation: rise .3s both; }

/* =====================================================================
   라이트 모드: 글자 굵게 + 보조 글자색 진하게
   ===================================================================== */
:root[data-theme="light"] { --text: #0b0f17; --muted: #374151; }
[data-theme="light"] body { font-weight: 600; -webkit-font-smoothing: antialiased; }
[data-theme="light"] b, [data-theme="light"] strong, [data-theme="light"] h1, [data-theme="light"] h2,
[data-theme="light"] h3, [data-theme="light"] h4, [data-theme="light"] th, [data-theme="light"] summary,
[data-theme="light"] .btn, [data-theme="light"] .nav button { font-weight: 800; }
[data-theme="light"] small, [data-theme="light"] .muted, [data-theme="light"] .hint, [data-theme="light"] p,
[data-theme="light"] li, [data-theme="light"] td, [data-theme="light"] em, [data-theme="light"] span,
[data-theme="light"] input, [data-theme="light"] .tag, [data-theme="light"] .badge { font-weight: 700; }
[data-theme="light"] .muted, [data-theme="light"] .hint, [data-theme="light"] small,
[data-theme="light"] .act small, [data-theme="light"] .act em, [data-theme="light"] .pick small,
[data-theme="light"] .steps span, [data-theme="light"] .tbl th, [data-theme="light"] .fan small,
[data-theme="light"] .hs small, [data-theme="light"] .kpis small, [data-theme="light"] .hero-stats small,
[data-theme="light"] .news li small, [data-theme="light"] .gd-meta, [data-theme="light"] .map-cap,
[data-theme="light"] .lg, [data-theme="light"] .mods-label, [data-theme="light"] .flag-lbl { color: #374151; }
[data-theme="light"] .nav button { color: #4b5563; }
[data-theme="light"] .nav button.on { color: var(--text); }
[data-theme="light"] .rd-label { fill: #374151; font-weight: 700; }
[data-theme="light"] .rd-val, [data-theme="light"] .car-lbl, [data-theme="light"] .ss-mark text { font-weight: 800; }
[data-theme="light"] .ach b { color: #374151; }
[data-theme="light"] .ach.on b, [data-theme="light"] .ach.on small { color: var(--text); opacity: 1; }

/* 뉴스의 '업적 달성' 항목이 업적 카드 스타일을 물려받지 않도록 */
.news li.ach { display: list-item; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 9px 0; opacity: 1; filter: none; color: var(--elite); font-weight: 600; }
.news li.ach:last-child { border-bottom: 0; }

/* 보정·성향 라벨은 한 줄 전체를 차지하고, 칩은 다음 줄 왼쪽부터 정렬 */
.mods { align-items: flex-start; row-gap: 6px; }
.mods-label { flex-basis: 100%; min-width: 0; margin: 2px 0 0; font-size: 12px; font-weight: 700; }

/* 레이스 상황 판단 카드 */
.situation { border-color: var(--warn); box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 40%, transparent) inset; animation: sitPulse 1.2s ease-out 1, rise .35s both; }
@keyframes sitPulse { 0% { box-shadow: 0 0 0 3px var(--warn); } 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 40%, transparent) inset; } }
.sit-tag { background: var(--gd-bg); color: var(--gd); border-color: var(--gd-bd); font-weight: 800; }
.gain.neg { color: var(--bad); }

/* 훈련 결과 알림을 눌러 닫을 때 */
.toast-float.closing { animation: toastClose .25s ease-in forwards; pointer-events: none; }
@keyframes toastClose { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-18px) scale(.94); } }

/* 상단 업적 버튼 + 연도별 업적 창 */
.ach-btn { margin-left: auto; cursor: pointer; color: var(--elite); border-color: color-mix(in srgb, var(--elite) 45%, transparent); background: color-mix(in srgb, var(--elite) 12%, var(--panel)); font: inherit; font-size: 14.5px; }
.ach-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.ay-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; max-height: 58vh; overflow-y: auto; padding-right: 2px; }
.ay { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel2); animation: rise .35s both; }
.ay-head { display: flex; align-items: baseline; gap: 8px; }
.ay-head b { font-size: 18px; }
.ay-season { margin: 4px 0 6px; font-size: 13px; color: var(--muted); }
.ay-item { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px dashed var(--line); }
.ay-item b { display: block; font-size: 14.5px; }
.ay-item small { color: var(--muted); font-size: 12.5px; }
.ay-tag { flex-shrink: 0; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 5px; background: var(--elite); color: #fff; margin-top: 2px; }
.ay-item.title .ay-tag { background: #d97706; }
.ay-item.title b { color: var(--gold); }
.ay-item.locked { opacity: .75; }
.ay-left { margin-top: 4px; }
.ay-left summary { cursor: pointer; color: var(--muted); font-weight: 700; padding: 4px 0; }

/* 실제 서킷 형태는 코너가 촘촘해서 트랙 선을 조금 가늘게 */
.trk-edge { stroke-width: 7; }
.trk-asphalt { stroke-width: 4.6; }
.trk-line { stroke-width: .9; }
.map-credit { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* =====================================================================
   첫 화면 하단 정보 · 안내 페이지
   ===================================================================== */
.title-screen { justify-content: flex-start; padding: 0; }
.title-hero { position: relative; flex: 1; width: 100%; min-height: 92vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.title-hero > *:not(.title-map) { position: relative; z-index: 1; }

.site-foot { width: 100%; max-width: 720px; margin: 0 auto; padding: 28px 16px 36px; border-top: 1px solid var(--line); text-align: left; font-size: 13px; color: var(--muted); }
.sf-brand { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.sf-brand b { color: var(--text); font-size: 15px; }
.sf-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 16px; }
.sf-links a { color: var(--muted); text-decoration: none; padding: 2px 0; }
.sf-links a:hover, .sf-links a[aria-current="page"] { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.sf-links a.strong { color: var(--text); font-weight: 700; }
.sf-mail { margin: 0 0 12px; }
.sf-legal { margin: 0; font-size: 12px; line-height: 1.7; }

.info-page { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.info-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.info-top a { color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -.3px; }
.info-top a.back { font-weight: 600; font-size: 14px; color: var(--muted); }
.info-top a.back:hover { color: var(--text); }
.info-body { padding: 28px 0 40px; line-height: 1.75; overflow-wrap: anywhere; }
.info-body h1 { font-size: 26px; margin: 0 0 6px; }
.info-body .lead { color: var(--muted); margin: 0 0 28px; }
.info-body h2 { font-size: 18px; margin: 34px 0 10px; padding-top: 4px; }
.info-body h3 { font-size: 15px; margin: 22px 0 6px; }
.info-body p, .info-body li { color: var(--text); }
.info-body ul, .info-body ol { padding-left: 20px; }
.info-body li { margin: 4px 0; }
.info-body a { color: var(--accent); }
.info-body .muted { color: var(--muted); }
.info-body table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.info-body th, .info-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.info-body th { background: var(--panel2); }
.info-body .note { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 14px 0; }
.info-body .toc { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; }
.patch { border-left: 3px solid var(--accent); padding-left: 14px; margin: 24px 0; }
.patch h2 { margin-top: 0; }
.patch time { color: var(--muted); font-size: 13px; }
/* 다크 모드: 안내 페이지·하단 글자를 흰색으로 (회색·빨강 글자가 어두운 배경에서 잘 안 보임) */
:root:not([data-theme="light"]) .site-foot,
:root:not([data-theme="light"]) .sf-links a,
:root:not([data-theme="light"]) .info-top a,
:root:not([data-theme="light"]) .info-body,
:root:not([data-theme="light"]) .info-body .lead,
:root:not([data-theme="light"]) .info-body .muted,
:root:not([data-theme="light"]) .info-body a,
:root:not([data-theme="light"]) .patch time,
:root:not([data-theme="light"]) .title-screen .foot { color: #fff; }
:root:not([data-theme="light"]) .info-body a { text-decoration-color: rgba(255, 255, 255, .5); }

/* 용어 사전 */
.gl-filters { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 12px 0; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.gl-filters input { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
.gl-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 0; scrollbar-width: none; }
.gl-chips button { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 13px; }
.gl-chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.gl-count { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.gl-sec h2 small { font-size: 13px; color: var(--muted); font-weight: 500; }
.gl-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 10px 0; }
.gl-item h3 { margin: 0 0 6px; font-size: 16px; }
.gl-item h3 small { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 4px; }
.gl-item p { margin: 6px 0 0; }
.gl-tags { display: flex; gap: 6px; }
.gl-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); }
.gl-tag.lv1 { background: var(--up-bg); color: var(--up); }
.gl-tag.lv2 { background: var(--bl-bg); color: var(--bl); }
.gl-tag.lv3 { background: var(--gd-bg); color: var(--gd); }
.gl-game { font-size: 14px; padding: 8px 10px; border-radius: 8px; background: var(--panel2); }
.gl-game b { color: var(--accent); margin-right: 4px; }
.gl-empty { text-align: center; color: var(--muted); padding: 30px 0; }
:root:not([data-theme="light"]) .gl-item h3 small,
:root:not([data-theme="light"]) .gl-sec h2 small,
:root:not([data-theme="light"]) .gl-count { color: #fff; }
