* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #10202f; }
body {
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; font-weight: 700; color: #4a2e14;
  user-select: none; -webkit-user-select: none;
}
#stage { position: relative; box-shadow: 0 0 60px rgba(0, 0, 0, .6); }
#game { display: block; }
#ui { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; pointer-events: none; overflow: hidden; }
.screen { position: absolute; inset: 0; pointer-events: none; }
.screen > * { pointer-events: auto; }
.modal-back {
  position: absolute; inset: 0; pointer-events: auto; background: rgba(8, 18, 30, .55);
  display: flex; align-items: center; justify-content: center; animation: fadeIn .2s ease-out;
}
.modal-back > .panel { animation: popIn .35s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { transform: scale(.7); opacity: 0; } }

.title, h2, .ribbon, .btn, .chip, .slot-name, .logo, .tab, .dname, .c-name, .gs-title, .r-total, .lbl, .r-stars, .lp-stars {
  font-family: 'Lilita One', 'Arial Rounded MT Bold', 'ZCOOL KuaiLe', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; font-weight: 400;
}

/* ---------- buttons ---------- */
.btn {
  --sh: #2a6517; --a: #8be05f; --b: #4aa82c;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 22px; letter-spacing: .5px; color: #fff; cursor: pointer;
  border: 3px solid #2b1a0c; border-radius: 14px; padding: 7px 20px 9px;
  background: linear-gradient(var(--a), var(--b));
  box-shadow: 0 5px 0 var(--sh), inset 0 3px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .15);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  transition: transform .08s, filter .15s; position: relative; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sh), inset 0 3px 0 rgba(255, 255, 255, .45); }
.btn:disabled { filter: grayscale(.85) brightness(.9); cursor: not-allowed; transform: none; opacity: .8; }
.btn-orange { --a: #ffc350; --b: #f08a1c; --sh: #a3530b; }
.btn-blue { --a: #72c8ff; --b: #2f86d6; --sh: #1b5592; }
.btn-red { --a: #ff8070; --b: #d8402e; --sh: #8e2316; }
.btn-gray { --a: #d6cfbf; --b: #a1978a; --sh: #5e5648; }
.btn-big { font-size: 34px; padding: 10px 40px 14px; border-radius: 18px; }
.btn-sm { font-size: 17px; padding: 4px 12px 6px; border-radius: 11px; box-shadow: 0 4px 0 var(--sh), inset 0 2px 0 rgba(255, 255, 255, .45); }

.icon-btn {
  width: 50px; height: 50px; border-radius: 50%; border: 3px solid #2b1a0c; cursor: pointer;
  background: linear-gradient(#fff6dc, #e9cf91); font-size: 22px; color: #4a2e14;
  box-shadow: 0 4px 0 #6b4423, inset 0 2px 0 #fff; transition: transform .08s;
}
.icon-btn:hover { transform: translateY(-2px); }
.icon-btn.off { filter: grayscale(1) brightness(.75); position: relative; }
.icon-btn.off::after { content: ''; position: absolute; left: 8px; right: 8px; top: 21px; height: 4px; background: #c33; transform: rotate(-45deg); border-radius: 2px; }

.coin-i {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%; vertical-align: -4px; margin-right: 4px; flex: none;
  background: radial-gradient(circle at 35% 32%, #fff6b0, #ffcc33 45%, #e0950f); border: 2px solid #8a5a07;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15);
}
.coin-i.sm { width: 16px; height: 16px; vertical-align: -2px; border-width: 1.5px; }
.star-i { color: #ffd23f; -webkit-text-stroke: 1.5px #5a3a0a; }

/* ---------- panels ---------- */
.panel {
  position: relative; background: linear-gradient(#fff7df, #f5e0ad);
  border: 5px solid #5a3818; border-radius: 26px; padding: 44px 34px 28px;
  box-shadow: inset 0 0 0 4px #ffeeb8, inset 0 -10px 0 rgba(160, 110, 40, .15), 0 14px 0 rgba(0, 0, 0, .25), 0 24px 50px rgba(0, 0, 0, .45);
}
.ribbon {
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(#ff7262, #d63c2e); border: 4px solid #5a1a10; border-radius: 14px;
  padding: 6px 40px 8px; font-size: 30px; color: #fff; white-space: nowrap;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .3); box-shadow: 0 6px 0 #7a2218, inset 0 3px 0 rgba(255, 255, 255, .35);
}
.ribbon.red { background: linear-gradient(#9a9a9a, #5f5f5f); border-color: #2a2a2a; box-shadow: 0 6px 0 #2a2a2a; }
.close-x {
  position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 3px solid #5a1a10; background: linear-gradient(#ff8070, #d8402e); color: #fff; font-size: 20px; font-weight: 900;
  box-shadow: 0 3px 0 #7a2218;
}
.close-x:hover { filter: brightness(1.1); }
.actions { display: flex; gap: 14px; justify-content: center; margin-top: 18px; }
.lbl { font-size: 18px; color: #7a4a22; margin: 12px 0 6px; display: block; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 22px;
  background: rgba(30, 18, 8, .78); border: 3px solid #2b1a0c; border-radius: 30px; padding: 4px 18px 5px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .3);
}

/* ---------- title ---------- */
.title-screen { display: flex; flex-direction: column; align-items: center; pointer-events: auto; background: radial-gradient(ellipse at center, rgba(0, 20, 40, .15), rgba(0, 15, 30, .65)); }
.logo { margin-top: 34px; text-align: center; line-height: .9; animation: logoIn .8s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes logoIn { from { transform: scale(.4) rotate(-6deg); opacity: 0; } }
.logo-top, .logo-main {
  color: #ffd23f;
  text-shadow: -5px -5px 0 #3a1a08, 5px -5px 0 #3a1a08, -5px 5px 0 #3a1a08, 5px 5px 0 #3a1a08, 0 -6px 0 #3a1a08, 0 6px 0 #3a1a08, -6px 0 0 #3a1a08, 6px 0 0 #3a1a08, 0 14px 0 #3a1a08, 0 18px 24px rgba(0, 0, 0, .5);
}
.logo-top { font-size: 64px; color: #8be05f; letter-spacing: 12px; }
.logo-main { font-size: 132px; letter-spacing: 4px; }
.logo-sub {
  display: inline-block; margin-top: 18px; font-size: 26px; color: #fff; background: #d63c2e; border: 4px solid #5a1a10;
  border-radius: 12px; padding: 4px 24px; box-shadow: 0 5px 0 #7a2218; transform: rotate(-2deg);
}
.slots { display: flex; gap: 26px; margin-top: 34px; }
.slot {
  position: relative; width: 250px; height: 270px; cursor: pointer; border-radius: 24px; padding: 14px;
  background: linear-gradient(#fff7df, #f0d9a2); border: 5px solid #5a3818; display: flex; flex-direction: column; align-items: center;
  box-shadow: inset 0 0 0 4px #ffeeb8, 0 10px 0 rgba(0, 0, 0, .3); transition: transform .15s;
}
.slot:hover { transform: translateY(-6px) rotate(-1deg); }
.slot-tank { width: 120px; height: 120px; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .25)); }
.slot-name { font-size: 28px; color: #4a2e14; margin-top: 2px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-stats { font-size: 18px; margin: 4px 0 10px; display: flex; align-items: center; gap: 2px; }
.slot.empty { justify-content: center; background: rgba(255, 247, 223, .55); border-style: dashed; color: #5a3818; }
.slot.empty .plus { font-family: 'Lilita One', sans-serif; font-size: 90px; line-height: 1; color: #6b4423; }
.slot-del {
  position: absolute; top: -12px; right: -12px; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 3px solid #5a1a10; background: #e5533d; color: #fff; font-weight: 900; opacity: .0; transition: opacity .15s;
}
.slot:hover .slot-del { opacity: 1; }
.title-foot { margin-top: 26px; color: #fff; font-size: 18px; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); }

.small-panel { width: 460px; text-align: center; }
.np-tank { width: 130px; height: 130px; display: block; margin: -6px auto 0; }
.name-in {
  width: 100%; font: 900 24px 'Nunito', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; color: #4a2e14; text-align: center;
  border: 4px solid #8a6136; border-radius: 14px; padding: 8px; background: #fffdf4; outline: none;
}
.name-in:focus { border-color: #f08a1c; }
.swatches { display: flex; gap: 10px; justify-content: center; }
.sw { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #3a2410; background: var(--c); cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); transition: transform .1s; }
.sw.on { transform: scale(1.2); box-shadow: 0 0 0 4px #fff, 0 0 0 7px #3a2410; }
.confirm-text { font-size: 20px; margin: 6px 0; }

/* ---------- map ---------- */
.topbar { position: absolute; left: 16px; right: 16px; top: 14px; display: flex; align-items: center; gap: 12px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar .spacer { flex: 1; pointer-events: none; }
.profile-chip img { width: 40px; height: 40px; margin: -6px 0 -6px -10px; }
.map-hint {
  position: absolute; top: 82px; left: 50%; transform: translateX(-50%); pointer-events: none !important;
  color: #fff; font-size: 17px; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); opacity: .9;
}

.level-panel { width: 840px; text-align: center; }
.level-panel h2 { font-size: 42px; color: #4a2e14; line-height: 1; }
.lp-stars { font-size: 30px; color: rgba(90, 58, 26, .35); letter-spacing: 4px; }
.lp-stars .on, .r-stars .on { color: #ffd23f; -webkit-text-stroke: 2px #5a3a0a; }
.desc { font-size: 18px; margin: 6px 20px 2px; color: #6b4423; }
.enemy-row { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.enemy-ic { width: 64px; background: rgba(90, 56, 24, .1); border-radius: 12px; padding: 4px 2px; font-size: 12px; line-height: 1.15; }
.enemy-ic img { width: 46px; height: 46px; display: block; margin: 0 auto; }
.diffs { display: flex; gap: 12px; justify-content: center; }
.diff {
  position: relative; width: 170px; padding: 10px 8px; border-radius: 16px; cursor: pointer; text-align: center;
  background: #fffaf0; border: 4px solid #c9a46a; color: #4a2e14; font-family: 'Nunito', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; transition: transform .1s;
}
.diff:hover { transform: translateY(-3px); }
.diff.on { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 35%, transparent), 0 6px 0 rgba(0, 0, 0, .15); background: color-mix(in srgb, var(--c) 12%, #fffaf0); }
.dname { font-size: 26px; color: var(--c); -webkit-text-stroke: 1px rgba(0, 0, 0, .35); }
.ddesc { font-size: 14px; color: #7a4a22; }
.dmult { font-size: 17px; margin-top: 4px; font-weight: 900; }
.dcheck { position: absolute; top: -10px; right: -8px; background: #4caf50; color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 2px solid #1e5c2a; }
.loadout { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 8px 14px; background: rgba(90, 56, 24, .1); border-radius: 16px; text-align: left; }
.loadout img { width: 56px; height: 56px; }
.lo-text { flex: 1; font-size: 16px; }
.mini-skill { display: inline-block; background: #fff; border: 2px solid #c9a46a; border-radius: 8px; padding: 0 6px; font-size: 14px; }

/* ---------- garage ---------- */
.garage { width: 1220px; height: 650px; display: flex; gap: 22px; padding: 46px 24px 22px; margin-top: 26px; }
.g-left { width: 390px; display: flex; flex-direction: column; gap: 12px; }
.preview-wrap { border: 4px solid #3a2410; border-radius: 18px; overflow: hidden; box-shadow: 0 5px 0 rgba(0, 0, 0, .2); }
.g-preview { width: 380px; height: 260px; display: block; }
.g-stats { background: rgba(90, 56, 24, .1); border-radius: 16px; padding: 12px 16px; flex: 1; }
.gs-title { font-size: 20px; margin-bottom: 8px; }
.gs-title small { font-size: 14px; color: #a06a2a; }
.gs-skills { display: flex; gap: 8px; margin-top: 10px; }
.gs-skill { flex: 1; background: #fff; border: 2px solid #c9a46a; border-radius: 10px; padding: 4px 8px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.gs-skill .key { display: inline-block; background: #4a2e14; color: #fff; border-radius: 6px; padding: 0 6px; margin-right: 6px; font-size: 12px; }
.stat { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 0; }
.st-l { width: 70px; color: #7a4a22; }
.st-bar { flex: 1; height: 12px; background: rgba(60, 35, 10, .18); border-radius: 6px; overflow: hidden; border: 2px solid rgba(60, 35, 10, .35); }
.st-bar i { display: block; height: 100%; background: linear-gradient(#9be86a, #4aa82c); border-radius: 4px; }
.st-v { min-width: 60px; text-align: right; font-weight: 900; white-space: nowrap; }
.st-v em, .stat-line em { color: #2f9a2a; font-style: normal; }
.g-right { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.g-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-right: 46px; }
.tabs { display: flex; gap: 8px; }
.tab {
  font-size: 22px; padding: 6px 22px; border-radius: 14px 14px 6px 6px; cursor: pointer; color: #6b4423;
  background: #ead29a; border: 3px solid #8a6136; transition: transform .1s;
}
.tab.on { background: #fff7df; color: #d63c2e; border-color: #5a3818; transform: translateY(-3px); box-shadow: 0 4px 0 #5a3818; }
.cards { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; overflow-y: auto; align-content: start; padding: 4px; }
.card {
  display: flex; gap: 12px; padding: 12px; border-radius: 18px; background: #fffaf0; border: 4px solid #d8b97f; min-height: 200px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .12); transition: transform .12s;
}
.card:hover { transform: translateY(-2px); }
.card.equipped { border-color: #4caf50; background: linear-gradient(#f3ffe8, #fffaf0); }
.card.locked .c-icon { filter: grayscale(.6) brightness(.95); }
.c-icon { width: 100px; flex: none; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, #f6e6bd, #e8cf95); border-radius: 14px; }
.c-icon img { width: 100px; height: 100px; }
.skill-ic { font-size: 58px; filter: drop-shadow(0 4px 2px rgba(0, 0, 0, .25)); }
.c-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.c-name { font-size: 22px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.c-desc { font-size: 14px; color: #7a4a22; margin-bottom: 4px; }
.stat-line { font-size: 14px; margin: 3px 0; }
.tag { display: inline-block; font-size: 13px; background: #ffe9a8; border: 2px solid #d8a83a; border-radius: 8px; padding: 0 8px; margin-top: 4px; align-self: flex-start; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 12px; height: 12px; border-radius: 50%; background: rgba(60, 35, 10, .2); border: 2px solid rgba(60, 35, 10, .4); }
.pips i.on { background: #ffd23f; border-color: #8a5a07; }
.c-btns { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; align-items: center; flex-wrap: wrap; }
.badge-eq, .badge-max { font-family: 'Lilita One', 'ZCOOL KuaiLe', 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 16px; padding: 3px 10px; border-radius: 10px; color: #fff; background: #4caf50; border: 2px solid #1e5c2a; }
.badge-max { background: #b08a2a; border-color: #5a3a0a; }

/* ---------- pause & results ---------- */
.pause-btns { display: flex; flex-direction: column; gap: 16px; align-items: center; margin: 6px 0 14px; }
.pause-toggles { display: flex; gap: 14px; justify-content: center; }
.results { width: 520px; text-align: center; }
.r-stars { font-size: 76px; line-height: 1; color: rgba(90, 58, 26, .3); letter-spacing: 6px; margin-top: -4px; }
.r-stars span { display: inline-block; }
.r-stars .on { animation: starPop .45s cubic-bezier(.2, 1.8, .4, 1) both; }
.r-stars span:nth-child(2) { transform: translateY(-14px); font-size: 92px; }
.r-stars span.on:nth-child(2) { animation-name: starPop2; }
@keyframes starPop { from { transform: scale(0) rotate(-90deg); color: rgba(90, 58, 26, .3); } }
@keyframes starPop2 { from { transform: translateY(-14px) scale(0) rotate(-90deg); } to { transform: translateY(-14px); } }
.r-level { font-size: 16px; color: #7a4a22; margin-bottom: 10px; }
.r-rows { background: rgba(90, 56, 24, .1); border-radius: 16px; padding: 8px 18px; }
.r-row { display: flex; justify-content: space-between; align-items: center; font-size: 19px; padding: 4px 0; border-bottom: 2px dashed rgba(90, 56, 24, .2); }
.r-row:last-child { border-bottom: 0; }
.r-row em { font-style: normal; font-size: 13px; background: #ffd23f; border-radius: 8px; padding: 1px 7px; margin-left: 6px; }
.r-tip { font-size: 16px; margin: 6px 0; color: #7a4a22; }
.r-total { display: flex; justify-content: space-between; align-items: center; font-size: 34px; margin: 12px 6px 0; }
.r-total b { font-weight: 400; color: #d97a00; }
.r-total .coin-i { width: 30px; height: 30px; }

/* ---------- icons ---------- */
.ico { display: inline-block; vertical-align: middle; flex: none; overflow: visible; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; }
.btn .ico { margin: -4px 0; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
.chip .ico { margin: -2px 0; }
.skill-ic .ico { filter: drop-shadow(0 4px 2px rgba(0, 0, 0, .25)); }
.dcheck .ico, .badge-eq .ico { vertical-align: -3px; }
.mini-skill .ico, .gs-skill .ico { vertical-align: -4px; }
#iris { position: absolute; inset: 0; pointer-events: none; z-index: 50; }
#iris.on { pointer-events: auto; }

/* ---------- language ---------- */
.lang-btn { width: auto !important; min-width: 52px; padding: 0 12px; border-radius: 25px !important; font-family: 'ZCOOL KuaiLe', 'PingFang SC', 'Microsoft YaHei', 'Lilita One', sans-serif; font-size: 20px; }
.title-corner { position: absolute; top: 18px; right: 18px; display: flex; gap: 10px; align-items: center; }
.cloud-cta + .title-foot { margin-top: 10px; }
.cloud-cta { margin-top: 16px; font-size: 24px; display: inline-flex; align-items: center; gap: 10px; animation: ctaPulse 1.6s ease-in-out infinite; }
@keyframes ctaPulse { 50% { transform: scale(1.05); } }
.sync-badge { cursor: pointer; font-size: 18px; padding: 4px 14px 5px 10px; font-family: inherit; }
.sync-badge:hover { filter: brightness(1.15); }
.sync-badge.st-ok { border-color: #1f5a2a; background: rgba(30, 110, 50, .85); }
.sync-badge.st-syncing .ico { animation: pulse 1s ease-in-out infinite; }
.sync-badge.st-offline { background: rgba(120, 80, 20, .85); }
.sync-badge.st-badcode { background: rgba(150, 30, 30, .88); }
@keyframes pulse { 50% { opacity: .4; } }
.cloud-big .ico { filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .25)); }
.cloud-status { font-size: 17px; color: #6b4423; margin: 4px 10px; line-height: 1.4; }
.cloud-err { min-height: 22px; margin: 6px 0 0; color: #c0392b; font-size: 16px; }
.code-in { letter-spacing: 3px; }
.lang-zh .logo-top { font-size: 72px; letter-spacing: 18px; }
.lang-zh .logo-main { font-size: 128px; letter-spacing: 10px; }
.lang-zh .logo-sub { letter-spacing: 4px; }
.lang-zh .c-desc, .lang-zh .desc, .lang-zh .ddesc { line-height: 1.45; }
