/* ==========================================================================
   Rumbo a la Grand Line — art direction: manga panels + nautical chart.
   Palette: straw-hat yellow, Luffy red, ocean blue, ink & paper.
   ========================================================================== */
:root {
  --ink: #141414;
  --paper: #fbf5e6;
  --paper-2: #f1e6cc;
  --parch: #ead6a6;
  --parch-2: #d9bc82;
  --parch-ink: #4a2f17;
  --straw: #f6c42c;
  --straw-2: #d99a12;
  --red: #d7262e;
  --red-2: #a3161c;
  --sea: #1f6fb2;
  --sea-2: #0f477c;
  --sea-3: #082a4c;
  --green: #3fbf5f;
  --text: #141414;
  --muted: #6b5a45;
  --line: #141414;
  --radius: 4px;
  --shadow: 5px 5px 0 var(--ink);
  --halftone: radial-gradient(circle, rgba(20, 20, 20, .16) 1.1px, transparent 1.6px) 0 0 / 7px 7px;
  --display: 'Lilita One', 'Arial Black', sans-serif;
  --jp: 'Dela Gothic One', 'Lilita One', sans-serif;
  --body: 'Zen Maru Gothic', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle, rgba(255, 255, 255, .07) 1.2px, transparent 1.8px) 0 0 / 9px 9px,
    radial-gradient(ellipse at 50% -20%, #2f86c9 0%, var(--sea-2) 45%, var(--sea-3) 100%) fixed;
}
button { font-family: inherit; }
#app { max-width: 1020px; margin: 0 auto; padding: 16px; min-height: 100vh; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 1px; margin: .2em 0 .35em; }
h2 { font-size: 2.3rem; color: var(--straw); line-height: 1;
  -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--ink); }
h3 { font-size: 1.45rem; color: var(--ink); }
.card h2, .modal h2, .panel h2 { color: var(--red); text-shadow: 2px 2px 0 var(--ink); }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
p { line-height: 1.45; }
#app > p, .screen > p, .screen > .center > p.muted, .screen > .center > p.end-stats { color: #e8f1f9; }
#app > p.muted, .screen > p.muted, .screen > .center > p.muted { color: #b9cde0; }

/* ---------- Manga panel ---------- */
.panel, .card, .modal, .topbar {
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card { padding: 14px; position: relative; }
.card.pick { cursor: pointer; transition: transform .1s, box-shadow .1s; }
.card.pick:hover { transform: translate(-3px, -3px) rotate(-.4deg); box-shadow: 9px 9px 0 var(--ink); }
.card.pick:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.card h3 { margin: 6px 0 4px; font-size: 1.7rem; }
.card.center .sprite, .card .sprite.lg { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  background: var(--straw); color: var(--ink); border: 3px solid var(--ink); border-radius: 6px;
  padding: 8px 18px 6px; font-family: var(--display); font-size: 1.25rem; letter-spacing: 1px; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink); transition: transform .06s, box-shadow .06s, filter .12s;
}
.btn:hover { filter: brightness(1.06); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { filter: grayscale(1) opacity(.55); cursor: not-allowed; transform: none; box-shadow: 4px 4px 0 var(--ink); }
.btn.ghost { background: var(--paper); }
.btn.red { background: var(--red); color: #fff; }
.btn.small { padding: 4px 10px 3px; font-size: 1rem; box-shadow: 3px 3px 0 var(--ink); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 3px; font-family: var(--display); font-size: .9rem;
  letter-spacing: .5px; color: #fff; border: 2px solid var(--ink); margin-right: 4px; text-shadow: 1px 1px 0 var(--ink); }
.badge.haki { background: #1b1b1b; color: #ff5050; }
.rarity { font-family: var(--display); font-size: .95rem; letter-spacing: 1px; -webkit-text-stroke: .4px var(--ink); }

/* ---------- Title ---------- */
.title-screen { text-align: center; padding-top: 2vh; position: relative; }
.title-hero { position: relative; height: 290px; display: flex; align-items: center; justify-content: center; }
.focus-burst { position: absolute; left: 50%; top: 50%; width: 1200px; height: 1200px; pointer-events: none;
  transform: translate(-50%, -50%); animation: spin 90s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 62%); mask: radial-gradient(circle, #000 30%, transparent 62%); }
.focus-burst .focus { width: 100%; height: 100%; }
.title-hero .focus-burst { opacity: .22; }
@keyframes spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
.title-hero .jolly { position: relative; filter: drop-shadow(6px 6px 0 var(--ink)); animation: bob 3.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }
.logo { font-family: var(--display); line-height: .9; margin: 4px 0 0; font-weight: 400; }
.logo .l1 { display: block; font-size: clamp(1.6rem, 4.5vw, 2.6rem); color: #fff; -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 var(--ink); letter-spacing: 4px; }
.logo .l2 { display: block; font-size: clamp(3.4rem, 11vw, 6.8rem); color: var(--straw); letter-spacing: 2px;
  -webkit-text-stroke: 3px var(--ink); text-shadow: 6px 6px 0 var(--red), 9px 9px 0 var(--ink); transform: rotate(-2deg); }
.bubble { position: relative; display: inline-block; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 50% / 45%;
  padding: 12px 30px; font-family: var(--display); font-size: 1.35rem; letter-spacing: 1px; margin: 24px 0 26px;
  box-shadow: 4px 4px 0 var(--ink); }
.bubble::after { content: ''; position: absolute; left: 24%; bottom: -15px; width: 0; height: 0;
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 15px solid var(--ink); }
.title-screen .menu { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.title-screen .menu .btn { min-width: 280px; font-size: 1.55rem; }
.disclaimer { margin-top: 40px; font-size: .78rem; color: #b9cde0; }

/* ---------- Sprites / placeholders ---------- */
.sprite { width: 96px; height: 96px; position: relative; display: flex; align-items: flex-end; justify-content: center; }
.sprite img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(3px 3px 0 rgba(20, 20, 20, .45)); }
.sprite.lg { width: 150px; height: 150px; }
.sprite.sm { width: 54px; height: 54px; }
.sprite.xs { width: 38px; height: 38px; }
.ph { width: 86%; height: 86%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 2.4em; color: #fff; letter-spacing: 1px; -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 2px 2px 0 var(--ink); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  position: relative; overflow: hidden; }
.ph::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(0, 0, 0, .25) 1px, transparent 1.6px) 0 0 / 5px 5px;
  -webkit-mask: linear-gradient(135deg, transparent 45%, #000 85%); mask: linear-gradient(135deg, transparent 45%, #000 85%); }
.sprite.sm .ph { font-size: 1.3em; border-width: 2px; -webkit-text-stroke: 1px var(--ink); }
.sprite.xs .ph { font-size: .95em; border-width: 2px; -webkit-text-stroke: .6px var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.sprite.lg .ph { font-size: 3.6em; }
.stars { position: absolute; top: -4px; right: 0; color: var(--straw); font-size: .9rem; -webkit-text-stroke: .6px var(--ink); }
.sprite.unknown img, .sprite.unknown .ph { filter: brightness(0) opacity(.35); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 10px; border: 2px solid var(--ink); text-align: center; background: var(--paper-2); }
.stats > div { font-size: .72rem; font-weight: 900; padding: 3px 0; border-right: 2px solid var(--ink); }
.stats > div:last-child { border-right: 0; }
.stats b { display: block; font-family: var(--display); font-size: 1.35rem; font-weight: 400; letter-spacing: 1px; }
.skill { font-size: .86rem; margin-top: 8px; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 14px; }
.topbar .arc { font-family: var(--display); font-size: 1.9rem; color: var(--red); letter-spacing: 1px; text-shadow: 2px 2px 0 var(--ink);
  -webkit-text-stroke: 1px var(--ink); }
.pill { border: 2px solid var(--ink); background: #fff; padding: 2px 10px; border-radius: 999px; font-weight: 900; font-size: .9rem; }
.keyhint { font-size: .8rem; font-weight: 900; color: var(--muted); }
.keyhint kbd { border: 2px solid var(--ink); border-bottom-width: 3px; border-radius: 4px; padding: 0 5px; background: #fff; color: var(--ink); font-family: inherit; }

/* ---------- Nautical chart (map) ---------- */
.map-wrap { position: relative; border: 3px solid var(--ink); box-shadow: var(--shadow); overflow: auto; border-radius: 3px;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(90, 55, 20, .38) 100%),
    repeating-linear-gradient(0deg, transparent 0 59px, rgba(74, 47, 23, .13) 59px 60px),
    repeating-linear-gradient(90deg, transparent 0 59px, rgba(74, 47, 23, .13) 59px 60px),
    radial-gradient(ellipse at 30% 20%, #f3e3bb, var(--parch) 60%, var(--parch-2));
}
.map-wrap svg.chart { display: block; width: 100%; max-width: 620px; margin: 0 auto; height: auto; }
.chart .route { stroke: var(--parch-ink); stroke-width: 2.4; stroke-dasharray: 2 7; stroke-linecap: round; fill: none; opacity: .7; }
.chart .route.on { stroke: var(--red); opacity: 1; stroke-width: 3.4; stroke-dasharray: 3 7; }
.chart .isle { fill: #d4b77c; stroke: var(--parch-ink); stroke-width: 1.6; opacity: .75; }
.chart .label { font-family: var(--display); fill: var(--parch-ink); letter-spacing: 3px; }
.map-node .disc { fill: #fbf1d6; stroke: var(--ink); stroke-width: 3; }
.map-node .ring { fill: none; stroke: var(--red); stroke-width: 3; stroke-dasharray: 6 5; opacity: 0; }
.map-node.avail { cursor: pointer; }
.map-node.avail .ring { opacity: 1; animation: ringspin 6s linear infinite; transform-box: fill-box; transform-origin: center; }
.map-node.avail:hover .disc { fill: #fff; }
@keyframes ringspin { to { transform: rotate(360deg); } }
.map-node.visited .ico-g { opacity: .4; }
.map-node .xmark { stroke: var(--red); stroke-width: 5; stroke-linecap: round; opacity: .9; }
.map-node.boss .disc { fill: #f6d9c9; }
.ship-marker { animation: sway 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes sway { 50% { transform: rotate(-6deg); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; font-weight: 900; margin-top: 12px; color: #e6f0f8; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend .ico { width: 22px; height: 22px; }

/* ---------- Vertical chart with sprite nodes (fits the screen) ---------- */
.map-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; }
.chart-wrap { position: relative; aspect-ratio: 600 / 1000; container-type: inline-size;
  height: min(calc(100dvh - 120px), calc((100vw - 32px) * 1.6667)); max-width: 100%;
  border: 3px solid var(--ink); box-shadow: var(--shadow); border-radius: 3px;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(90, 55, 20, .38) 100%),
    repeating-linear-gradient(0deg, transparent 0 46px, rgba(74, 47, 23, .12) 46px 47px),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(74, 47, 23, .12) 46px 47px),
    radial-gradient(ellipse at 30% 20%, #f3e3bb, var(--parch) 60%, var(--parch-2)); }
.chart-wrap svg.chart { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.map-side .crewbar { margin-top: 0; flex-direction: column; flex-wrap: nowrap; }
.map-side .crew-chip { width: 100%; max-width: 330px; }
.map-side .legend { flex-direction: column; gap: 4px; margin-top: 0; }
.node { position: absolute; width: 11.5%; aspect-ratio: 1; transform: translate(-50%, -58%); z-index: 2; }
.node.k-elite { width: 14%; } .node.k-boss { width: 19%; }
.node-art { position: relative; width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; transition: transform .12s; }
.node-art > img, .node-art > svg, .node-art .sprite { width: 100%; height: 100%; }
.node-art .sprite img { filter: drop-shadow(2px 2px 0 rgba(20, 20, 20, .5)); }
.node-art .sprite .ph { width: 80%; height: 80%; font-size: 4cqw; }
.node-art img { object-fit: contain; }
.node-shadow { position: absolute; left: 16%; right: 16%; bottom: -5%; height: 15%; border-radius: 50%; background: rgba(74, 47, 23, .35); }
.node.avail { cursor: pointer; z-index: 3; }
.node.avail .node-art { animation: nodebob 1.1s ease-in-out infinite; filter: drop-shadow(0 0 5px #fff) drop-shadow(0 0 3px var(--straw)); }
.node.avail:hover .node-art { transform: scale(1.15); }
.node.avail .node-shadow { background: rgba(215, 38, 46, .45); box-shadow: 0 0 0 2px var(--red); }
@keyframes nodebob { 50% { transform: translateY(-12%); } }
.node.visited .node-art { filter: grayscale(.9) opacity(.5); }
.node-x { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display);
  font-size: 9cqw; color: var(--red); -webkit-text-stroke: 1.5px var(--ink); pointer-events: none; }
.node-ship { position: absolute; width: 70%; right: -60%; top: 5%; overflow: visible; }
.node.start { width: 9%; } .node.start .node-ship { right: auto; left: 0; top: 0; width: 100%; }
.node .sprite.iconified svg { width: 100%; height: 100%; }

@media (max-width: 760px) {
  #app { padding: 8px; }
  .topbar { gap: 6px; padding: 6px 8px; margin-bottom: 8px; }
  .topbar .arc { font-size: 1.4rem; }
  .topbar .keyhint { display: none; }
  .topbar .pill { font-size: .78rem; padding: 1px 7px; }
  .topbar .btn.small { font-size: .9rem; padding: 3px 8px 2px; }
  .map-layout { grid-template-columns: 1fr; gap: 10px; justify-items: center; }
  .chart-wrap { height: min(calc(100dvh - 210px), calc((100vw - 22px) * 1.6667)); }
  .map-side { width: 100%; }
  .map-side .crewbar { flex-direction: row; overflow-x: auto; padding-bottom: 6px; }
  .map-side .crew-chip { min-width: 150px; width: auto; flex: none; }
  .map-side .legend { flex-direction: row; font-size: .72rem; }
}

/* ---------- Ship, synergies, captains, achievements ---------- */
.ship-panel, .syn-panel { padding: 8px 10px; font-size: .85rem; }
.ship-panel .btn { margin-top: 6px; }
.ship-ico { width: 34px; height: 34px; overflow: visible; }
.syn { font-size: .8rem; padding: 2px 0; border-top: 1px dashed #14141433; }
.syn.on b { color: var(--red); }
.skill.passive { background: #fff3c4; border: 2px solid var(--ink); border-radius: 4px; padding: 3px 6px; }
.badge.haki.obs { color: #7fd0ff; } .badge.haki.rey { color: var(--straw); background: #3a0a0a; }
.diffbar { padding: 8px 12px; margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.diffbar .skill { width: 100%; margin-top: 4px; }
.cards.caps { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.cap h3 { font-size: 1.3rem; }
.cap .sprite { margin: 0 auto; }
.card.locked { opacity: .75; background: var(--paper-2); }
.cards.ach { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

/* ---------- Crew chips ---------- */
.crewbar { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.crew-chip { background: var(--paper); border: 3px solid var(--ink); border-radius: 4px; padding: 5px 8px; display: flex; gap: 8px;
  align-items: center; cursor: pointer; min-width: 160px; box-shadow: 3px 3px 0 var(--ink); color: var(--ink); }
.crew-chip:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.crew-chip.ko { filter: grayscale(1); opacity: .7; }
.crew-chip.sel { background: #fff3c4; }
.crew-chip .info { font-size: .8rem; flex: 1; line-height: 1.25; }
.crew-chip .info b { font-size: .9rem; }
.front-tag, .back-tag { font-family: var(--body); font-weight: 900; font-size: .68rem; padding: 0 6px; border: 2px solid var(--ink); border-radius: 3px; }
.front-tag { background: var(--red); color: #fff; } .back-tag { background: #fff; }

.bar { height: 10px; background: #3b3b3b; border: 2px solid var(--ink); border-radius: 2px; overflow: hidden; margin-top: 3px; }
.bar > i { display: block; height: 100%; background: var(--green); transition: width .25s; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); }
.bar.hp.low > i { background: #f0a21b; } .bar.hp.crit > i { background: var(--red); }
.bar.en { height: 8px; } .bar.en > i { background: var(--straw); }

/* ---------- Overlay / crew modal ---------- */
#overlay { position: fixed; inset: 0; display: none; background: rgba(8, 20, 36, .82); z-index: 50; overflow: auto; padding: 16px; }
#overlay.on { display: block; }
.modal { max-width: 960px; margin: 2vh auto; padding: 18px; background: var(--halftone), var(--paper); }
.modal p.muted { color: var(--muted); }
.crew-layout { display: grid; grid-template-columns: 310px 1fr; gap: 18px; }
@media (max-width: 760px) { .crew-layout { grid-template-columns: 1fr; } }
.crew-list .crew-chip { width: 100%; margin-bottom: 8px; }
.slot { border: 2px dashed var(--ink); border-radius: 4px; padding: 7px 10px; margin: 8px 0; background: #fff; font-size: .9rem; }
.inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.item { background: #fff; border: 2px solid var(--ink); border-radius: 4px; padding: 8px 10px; font-size: .84rem; box-shadow: 3px 3px 0 var(--ink); }
.item .ic { font-size: 1.4rem; margin-right: 6px; }
.item .nm { font-weight: 900; }
.item-big { font-size: 3rem; line-height: 1.1; filter: drop-shadow(3px 3px 0 rgba(20, 20, 20, .5)); }

/* ---------- Toast (speech bubble) ---------- */
#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; pointer-events: none; text-align: center; }
#toast .t { display: block; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 22px; padding: 8px 20px;
  margin-top: 8px; font-weight: 900; box-shadow: 4px 4px 0 var(--ink); animation: toast 2.6s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(12px) scale(.9); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- Battle (manga panel) ---------- */
.battle { position: relative; }
.battle h2 .ico, h2 .ico { width: 1.05em; height: 1.05em; vertical-align: -0.12em; margin-right: 6px; filter: drop-shadow(2px 2px 0 var(--ink)); }
.arena { position: relative; height: 440px; overflow: hidden; border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); background: #5fb8f2; }
.arena .scene, .arena .bgimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.arena::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(circle, rgba(20, 20, 20, .12) 1px, transparent 1.6px) 0 0 / 6px 6px;
  -webkit-mask: linear-gradient(180deg, #000, transparent 30%, transparent 75%, #000); mask: linear-gradient(180deg, #000, transparent 30%, transparent 75%, #000); }
.scene .cloud { animation: drift 40s linear infinite alternate; }
.scene .cloud.c2 { animation-duration: 55s; } .scene .cloud.c3 { animation-duration: 70s; }
@keyframes drift { to { transform: translateX(80px); } }
.scene .wave { animation: wave 6s ease-in-out infinite alternate; }
.scene .wave.w2 { animation-duration: 8s; animation-direction: alternate-reverse; }
@keyframes wave { to { transform: translateX(-50px); } }
.stage-slot { position: absolute; width: 260px; height: 310px; z-index: 4; }
.stage-slot.p { left: 13%; bottom: 7%; }
.stage-slot.e { right: 13%; bottom: 20%; }
.fighter { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  transition: transform .16s, opacity .4s, filter .4s; }
.fighter.off { display: none; }
.fighter .sprite.lg { width: 175px; height: 175px; animation: breathe 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes breathe { 50% { transform: scale(1.035, .965); } }
.stage-slot.e .sprite img { transform: scaleX(-1); }
.fighter .hud { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  padding: 4px 8px 5px; width: 220px; margin-top: 6px; font-size: .78rem; }
.stage-slot.e .fighter { flex-direction: column-reverse; justify-content: flex-start; }
.stage-slot.e .fighter .hud { margin: 0 0 6px; }
.hud-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.hud-top b { font-family: var(--display); font-size: 1.15rem; font-weight: 400; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-top span { font-family: var(--display); font-size: 1rem; }
.hud .badge { font-size: .72rem; padding: 0 5px; }
.hpnum { font-size: .7rem; font-weight: 900; text-align: right; }
.fighter .sts { position: absolute; top: 0; left: 8px; font-size: 1.2rem; z-index: 2; }
.fighter.lunge-r { transform: translateX(95px) scale(1.08); }
.fighter.lunge-l { transform: translateX(-95px) scale(1.08); }
.fighter.hit .sprite { animation: shake .3s; }
.fighter.hit .sprite img, .fighter.hit .sprite .ph { filter: brightness(0) invert(1); }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.fighter.ko .sprite { opacity: .25; filter: grayscale(1); transform: translateY(20px) rotate(-10deg); transition: all .4s; animation: none; }
.fighter.revive .sprite { animation: none; filter: drop-shadow(0 0 16px var(--straw)); }
.fighter.special .sprite { filter: drop-shadow(0 0 14px var(--straw)); }
.fighter.enter-l { animation: enterL .45s cubic-bezier(.2, 1.4, .4, 1); } .fighter.enter-r { animation: enterR .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes enterL { from { transform: translateX(-180px); opacity: 0; } }
@keyframes enterR { from { transform: translateX(180px); opacity: 0; } }
.benches { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.bench { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.bench.e { justify-content: flex-end; }
.vs { font-family: var(--display); color: var(--straw); font-size: 2rem; -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--red); }
.mini { background: var(--paper); border: 2px solid var(--ink); border-radius: 3px; padding: 3px 5px; width: 58px; text-align: center; box-shadow: 2px 2px 0 var(--ink); }
.mini .sprite { margin: 0 auto; }
.mini.active { background: var(--straw); transform: translateY(-3px); }
.mini.ko { opacity: .45; filter: grayscale(1); }
.mini.hit { background: var(--red); }
.bench.e .mini .sprite img { transform: scaleX(-1); }

/* manga FX layer */
.float { position: absolute; font-family: var(--display); font-size: 2rem; letter-spacing: 1px; pointer-events: none; z-index: 20; color: #fff;
  -webkit-text-stroke: 2px var(--ink); text-shadow: 3px 3px 0 var(--ink); animation: floatUp 1s ease-out forwards; white-space: nowrap; }
.float.crit { font-size: 2.6rem; color: var(--straw); }
.float.heal { color: #7dff9a; } .float.info { font-size: 1.15rem; color: #ffe27a; -webkit-text-stroke: 1px var(--ink); }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -12px) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -64px) scale(1); } }
.skill-banner { position: absolute; top: 16px; left: 50%; z-index: 25; transform: translateX(-50%) rotate(-3deg); animation: banner 1.05s forwards;
  background: #fff; border: 4px solid var(--ink); padding: 12px 34px 8px; font-family: var(--display); font-size: 2.1rem; letter-spacing: 1px;
  color: var(--ink); white-space: nowrap;
  clip-path: polygon(0% 18%, 6% 0%, 14% 14%, 24% 2%, 34% 15%, 46% 0%, 56% 14%, 68% 1%, 78% 15%, 90% 2%, 96% 18%, 100% 40%, 96% 60%, 100% 84%, 92% 100%, 82% 86%, 70% 100%, 58% 86%, 46% 100%, 34% 86%, 22% 100%, 10% 86%, 3% 100%, 0% 78%, 4% 58%, 0% 40%); }
.skill-banner.enemy { background: var(--red); color: #fff; }
@keyframes banner { 0% { opacity: 0; transform: translateX(-50%) rotate(-3deg) scale(1.7); } 14% { opacity: 1; transform: translateX(-50%) rotate(-3deg) scale(1); }
  82% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) rotate(-3deg) scale(.95); } }
.sfx { position: absolute; z-index: 22; font-family: var(--display); pointer-events: none; color: #fff; letter-spacing: 2px;
  -webkit-text-stroke: 3px var(--ink); text-shadow: 5px 5px 0 var(--ink); animation: sfx .8s ease-out forwards; white-space: nowrap; }
.sfx.don { font-size: 5rem; color: var(--straw); }
.sfx.gogo { font-size: 3rem; color: #b98cff; -webkit-text-stroke: 2px var(--ink); animation: gogo 1.8s ease-out forwards; }
.sfx.ko { font-size: 3.4rem; color: var(--red); }
@keyframes sfx { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2) rotate(-8deg); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-8deg); }
  75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.06) rotate(-8deg); } }
@keyframes gogo { 0% { opacity: 0; transform: translate(-50%, 10px); } 25% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -30px); } }
.speedlines { position: absolute; inset: 0; z-index: 14; pointer-events: none; animation: flashlines .5s ease-out forwards; }
.speedlines .focus { width: 100%; height: 100%; }
@keyframes flashlines { 0% { opacity: .9; } 100% { opacity: 0; } }
.fxcanvas { position: absolute; inset: 0; pointer-events: none; z-index: 15; }
.arena.shake { animation: shake .25s; }
.battle-controls { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.battle-controls .muted { color: #cfe0ee; font-weight: 900; }
.battle-log { height: 96px; overflow: auto; font-size: .82rem; background: var(--paper); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  padding: 6px 10px; margin-top: 10px; color: #4b4136; }
.battle-log b { color: var(--ink); }
.round { position: absolute; top: 10px; left: 12px; z-index: 5; font-family: var(--display); font-size: 1.15rem; letter-spacing: 1px; background: var(--paper);
  border: 3px solid var(--ink); padding: 1px 10px 0; box-shadow: 3px 3px 0 var(--ink); }
.result-panel { margin-top: 14px; }
.result-panel .lvl { color: var(--red); font-weight: 900; }

/* ---------- Zone themes (page) ---------- */
body.theme-eastblue {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cpath d='M0 20 q15 -10 30 0 t30 0 t30 0 t30 0' fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='3'/%3E%3C/svg%3E"),
    radial-gradient(circle, rgba(255, 255, 255, .06) 1.2px, transparent 1.8px) 0 0 / 9px 9px,
    linear-gradient(180deg, #2f8fd0 0%, #135a93 40%, #0a3560 100%) fixed;
}

body.theme-arabasta {
  background: radial-gradient(circle, rgba(255, 255, 255, .07) 1.2px, transparent 1.8px) 0 0 / 9px 9px,
    linear-gradient(180deg, #e09a3e 0%, #a8602a 45%, #5a2f16 100%) fixed;
}
body.theme-enieslobby {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cpath d='M0 20 q15 -10 30 0 t30 0 t30 0 t30 0' fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='3'/%3E%3C/svg%3E"),
    radial-gradient(circle, rgba(255, 255, 255, .06) 1.2px, transparent 1.8px) 0 0 / 9px 9px,
    linear-gradient(180deg, #4a3f7a 0%, #2a3f73 45%, #121a33 100%) fixed;
}
body.theme-marineford {
  background: radial-gradient(circle, rgba(255, 255, 255, .06) 1.2px, transparent 1.8px) 0 0 / 9px 9px,
    linear-gradient(180deg, #8a2a1c 0%, #3c2a3a 45%, #101828 100%) fixed;
}

/* ---------- Evolution ---------- */
.evo { text-align: center; padding-top: 6vh; position: relative; }
.evo .stage { height: 280px; display: flex; align-items: center; justify-content: center; position: relative; }
.evo .stage .focus-burst { width: 1000px; height: 1000px; opacity: .5; animation-duration: 30s; }
.evo .stage .sprite { position: absolute; transform: scale(1.5); }
.evo .stage .sprite.silh img, .evo .stage .sprite.silh .ph { filter: brightness(0) invert(1) drop-shadow(0 0 14px #fff); }
.evo .stage .sprite.hidden { opacity: 0; }
.evo .flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .5s; z-index: 60; }
.evo .flash.on { opacity: 1; transition: opacity .08s; }
.evo h2 { min-height: 1.2em; font-size: 2.6rem; }
.evo p { color: #e8f1f9; }

/* ---------- Poster (classic wanted layout) ---------- */
.poster { width: min(380px, 100%); margin: 0 auto; padding: 14px; color: #3a2716; transform: rotate(-1.2deg);
  background:
    radial-gradient(ellipse at 15% 20%, #00000014 0 6%, transparent 14%),
    radial-gradient(ellipse at 80% 75%, #5a3a1a22 0 8%, transparent 18%),
    radial-gradient(ellipse at 60% 10%, #ffffff55 0 10%, transparent 30%),
    linear-gradient(180deg, #efdcb1, #e2c892);
  box-shadow: 0 22px 50px #000c, inset 0 0 40px #7a5a2a88, inset 0 0 6px #4a3016; border-radius: 2px; }
.p-inner { border: 2px solid #3a271688; padding: 10px 14px 12px; text-align: center; }
.p-wanted { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 4.3rem; line-height: .95; letter-spacing: 2px;
  transform: scaleX(1.12); color: #2e1e10; }
.p-photo { border: 3px solid #2e1e10; margin: 8px 4px 6px; height: 230px; display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(180deg, #a9c4c7, #d4c9a3 70%, #bba77a); overflow: hidden; box-shadow: inset 0 0 20px #0005; }
.p-photo .sprite.lg { width: 220px; height: 220px; }
.p-photo .sprite img { filter: sepia(.25) contrast(1.05) drop-shadow(0 3px 2px #0005); }
.p-doa { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 1.9rem; letter-spacing: 1px; line-height: 1.1; }
.p-doa span { font-size: 1.2rem; vertical-align: middle; margin: 0 4px; }
.p-name { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 2rem; line-height: 1.05; margin: 2px 0; transform: scaleX(1.05); }
.p-bounty, .pc-text { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; }
.p-bounty { font-size: 2.2rem; letter-spacing: 1px; }
.berry { position: relative; display: inline-block; margin-right: 6px; }
.berry::before, .berry::after { content: ''; position: absolute; top: 12%; bottom: 14%; width: .07em; background: currentColor; }
.berry::before { left: 34%; } .berry::after { left: 54%; }
.p-foot { display: flex; align-items: flex-end; gap: 10px; margin-top: 6px; }
.p-fine { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.p-fine i { display: block; height: 3px; background: #3a271655; border-radius: 2px; }
.p-fine i:nth-child(2) { width: 92%; } .p-fine i:nth-child(4) { width: 70%; }
.p-marine { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 1.1rem; letter-spacing: 3px; }
.poster-custom { position: relative; width: min(380px, 100%); margin: 0 auto; container-type: inline-size; transform: rotate(-1.2deg); box-shadow: 0 22px 50px #000c; }
.pc-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pc-photo { position: absolute; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.pc-photo .sprite.lg { width: 100%; height: 100%; }
.pc-text { position: absolute; left: 0; right: 0; transform: translateY(-50%); text-align: center; line-height: 1; }
.end-stats { color: #e8f1f9; }

/* ---------- Collection ---------- */
.coll { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.coll .card { padding: 8px; text-align: center; font-size: .78rem; font-weight: 900; }
.section-title { color: #fff; -webkit-text-stroke: 1px var(--ink); text-shadow: 2px 2px 0 var(--ink); font-size: 1.6rem; }

@media (max-width: 640px) {
  .arena { height: 390px; }
  .stage-slot { width: 170px; height: 255px; }
  .stage-slot.p { left: 2%; } .stage-slot.e { right: 2%; }
  .fighter .sprite.lg { width: 112px; height: 112px; }
  .fighter .hud { width: 162px; }
  .p-wanted { font-size: 3.2rem; }
  .title-hero { height: 230px; }
}

/* =====================================================================
   Polish pass (style-guide.md): icons, rarity frames, tooltips, reveal,
   pre-battle, boss intro, stamps, title sea, settings, reduce motion.
   ===================================================================== */

/* Screen transition */
.screen-in { animation: screenIn .22s ease-out backwards; } /* backwards: no lingering transform (keeps position:fixed children on the viewport) */
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } }

/* Icons inside text */
.ico { display: inline-block; vertical-align: middle; }
.pill .ico { width: 18px; height: 18px; margin-right: 2px; vertical-align: -4px; }
h2 .ico { width: 1.05em; height: 1.05em; }

/* Stats with icons */
.stats > div { display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: help; }
.stats > div .ico { width: 20px; height: 20px; }

/* Item cards with rarity frames */
.item-card { padding-top: 26px; overflow: hidden; }
.item-art { width: 84px; height: 84px; margin: 4px auto 2px; filter: drop-shadow(3px 3px 0 rgba(20, 20, 20, .35)); }
.item-art .ico { width: 100%; height: 100%; }
.rar-ribbon { position: absolute; top: 0; left: 0; right: 0; padding: 3px 0 2px; font-family: var(--display); letter-spacing: 1.5px;
  color: #fff; -webkit-text-stroke: .6px var(--ink); border-bottom: 3px solid var(--ink); font-size: .95rem; }
.rar-comun .rar-ribbon { background: #9aa4ad; } .rar-raro .rar-ribbon { background: #3d8ee0; }
.rar-epico .rar-ribbon { background: #a64fe0; } .rar-legendario .rar-ribbon { background: #e0a12f; }
.item-card.rar-epico { box-shadow: 5px 5px 0 var(--ink), 0 0 0 3px #a64fe055 inset; }
.item-card.rar-legendario { box-shadow: 5px 5px 0 var(--ink), 0 0 18px #e0a12f; animation: legendGlow 2.4s ease-in-out infinite; }
@keyframes legendGlow { 50% { box-shadow: 5px 5px 0 var(--ink), 0 0 30px #f6c42c; } }

/* Reveal (flip) for rewards */
.reveal { animation: flipIn .45s cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: calc(var(--i, 0) * 120ms); transform-origin: 50% 50%; }
@keyframes flipIn { 0% { transform: perspective(700px) rotateY(90deg) scale(.9); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* Tooltip */
#tip { position: fixed; z-index: 120; max-width: 280px; pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity .12s, transform .12s; background: var(--paper); color: var(--ink); border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink); padding: 8px 10px; font-size: .82rem; line-height: 1.35; }
#tip.on { opacity: 1; transform: none; }
.ni-head { display: flex; gap: 6px; align-items: center; font-family: var(--display); font-size: 1.1rem; margin-bottom: 4px; }
.ni-head .ico { width: 26px; height: 26px; }
.ni-row { display: flex; gap: 8px; align-items: center; padding: 3px 0; border-top: 1px dashed #14141433; }
.ni-row span { flex: 1; } .ni-row i { color: var(--muted); font-size: .75rem; }
.ni-foot { color: var(--muted); margin-top: 4px; }

/* Mobile node sheet */
.node-sheet { display: none; }
.node-sheet.on { display: block; background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--shadow); padding: 10px; color: var(--ink); }
.node-sheet .btn { width: 100%; margin-top: 8px; font-size: 1.4rem; }
.node.picked .node-art { transform: scale(1.18); filter: drop-shadow(0 0 6px var(--red)); }

/* Top bar extras */
.pill.zone { background: #1f6fb2; color: #fff; }
.relic-strip { padding: 6px 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .85rem; }
.relic-ico .ico { width: 30px; height: 30px; }
.pip { display: inline-flex; align-items: center; gap: 2px; font-size: .8rem; }
.pip .ico { width: 20px; height: 20px; }

/* Inventory tiles */
.inv { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.item.tile { display: flex; gap: 8px; align-items: center; padding: 6px; border-left-width: 6px; }
.item.tile.rar-comun { border-left-color: #9aa4ad; } .item.tile.rar-raro { border-left-color: #3d8ee0; }
.item.tile.rar-epico { border-left-color: #a64fe0; } .item.tile.rar-legendario { border-left-color: #e0a12f; }
.tile-ico { position: relative; width: 44px; height: 44px; flex: none; }
.tile-ico .ico { width: 100%; height: 100%; }
.tile-n { position: absolute; right: -4px; bottom: -4px; background: var(--ink); color: #fff; font-size: .7rem; font-weight: 900; padding: 0 4px; border-radius: 3px; }
.tile-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-body .nm { font-size: .8rem; line-height: 1.15; }
.tile-body .btn { align-self: flex-start; }
.slot { display: flex; gap: 8px; align-items: center; }
.slot-ico { width: 30px; height: 30px; flex: none; } .slot-ico .ico { width: 100%; height: 100%; }
.evo-hint { color: var(--red); }
.lock-hint { margin-top: -4px; }

/* Result stamps */
.result { position: relative; padding-top: 18px; }
.stamp { display: inline-block; font-family: var(--display); font-size: 3rem; letter-spacing: 3px; color: var(--straw);
  -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 var(--ink); transform: rotate(-4deg); animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.stamp.red { color: var(--red); }
@keyframes stamp { from { transform: rotate(-4deg) scale(2.4); opacity: 0; } }
.loot { display: inline-flex; gap: 8px; align-items: center; border: 3px solid var(--ink); padding: 4px 10px 4px 4px; background: #fff; box-shadow: 3px 3px 0 var(--ink); margin: 4px 0 8px; }
.loot .ico { width: 40px; height: 40px; }
.loot.rar-legendario { background: #fff3c4; } .loot.rar-epico { background: #f3e6ff; }
.lvls > div { padding: 2px 0; animation: screenIn .3s both; }
.lvls > div:nth-child(2) { animation-delay: .06s; } .lvls > div:nth-child(3) { animation-delay: .12s; }
.lvls > div:nth-child(4) { animation-delay: .18s; } .lvls > div:nth-child(5) { animation-delay: .24s; } .lvls > div:nth-child(6) { animation-delay: .3s; }

/* Pre-battle */
.prebattle > p { color: #e8f1f9; }
.pb-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
.pb-col { padding: 10px; }
.pb-col h3 { margin: 0 0 6px; }
.pb-vs { font-family: var(--display); font-size: 2.6rem; color: var(--straw); -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 var(--red); align-self: center; }
.pb-unit { display: grid; grid-template-columns: 30px 54px 1fr auto; gap: 8px; align-items: center; padding: 6px; border-top: 2px dashed #14141422; }
.pb-unit.lead { background: #fff3c4; border: 2px solid var(--ink); }
.pb-col.foe .pb-unit.lead { background: #ffe0dc; }
.pb-col.foe .pb-unit { grid-template-columns: 30px 54px 1fr; }
.pb-col.foe .sprite img { transform: scaleX(-1); }
.pb-order { font-family: var(--display); font-size: 1.4rem; text-align: center; }
.pb-info { font-size: .85rem; min-width: 0; }
.pb-info .badge { font-size: .7rem; }
.epithet { font-size: .72rem; color: var(--red); font-weight: 900; }
.pb-mu { grid-column: 2 / 4; display: flex; gap: 6px; flex-wrap: wrap; }
.pb-move { grid-row: 1; grid-column: 4; display: flex; flex-direction: column; gap: 2px; }
.mu { font-size: .72rem; font-weight: 900; padding: 1px 6px; border: 2px solid var(--ink); border-radius: 3px; cursor: help; }
.mu.good { background: #3fbf5f; color: #fff; } .mu.bad { background: var(--red); color: #fff; } .mu.even { background: #fff; }
.pb-actions { margin-top: 14px; }
.btn.big { font-size: 1.9rem; padding: 10px 34px 8px; }
@media (max-width: 760px) {
  .pb-grid { grid-template-columns: 1fr; }
  .pb-vs { text-align: center; font-size: 2rem; }
}

/* Relic choice */
.cards.relics { max-width: 860px; margin: 0 auto; }
.relic-card { background: linear-gradient(180deg, #fff3c4, var(--paper)); }

/* Boss intro */
.boss-intro { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; gap: 4vw; overflow: hidden;
  background: radial-gradient(circle at 30% 50%, #a3161c, #2a0a0a 70%); animation: biIn .25s ease-out both; }
.boss-intro.elite { background: radial-gradient(circle at 30% 50%, #3a2a6a, #120a24 70%); }
.boss-intro.out { animation: biOut .28s ease-in both; }
@keyframes biIn { from { opacity: 0; } }
@keyframes biOut { to { opacity: 0; transform: scale(1.05); } }
.bi-lines { position: absolute; left: 50%; top: 50%; width: 160vmax; height: 160vmax; transform: translate(-50%, -50%); opacity: .55; animation: spin 20s linear infinite; }
.bi-lines .focus { width: 100%; height: 100%; }
.bi-sprite { position: relative; animation: biSprite .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.bi-sprite .sprite.lg { width: min(38vw, 300px); height: min(38vw, 300px); }
.bi-sprite .sprite img { filter: drop-shadow(8px 8px 0 #000); }
.bi-sprite .sprite.iconified svg { width: 100%; height: 100%; }
@keyframes biSprite { from { transform: translateX(-60vw) scale(.8); } }
.bi-text { position: relative; color: #fff; animation: biText .45s .15s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes biText { from { transform: translateX(60vw); } }
.bi-epi { font-family: var(--display); font-size: clamp(1rem, 3vw, 1.6rem); color: var(--straw); letter-spacing: 2px; -webkit-text-stroke: 1px #000; }
.bi-name { font-family: var(--display); font-size: clamp(2.4rem, 8vw, 5.4rem); line-height: .95; -webkit-text-stroke: 3px #000; text-shadow: 6px 6px 0 #000; }
.bi-lv { font-family: var(--display); font-size: 1.6rem; -webkit-text-stroke: 1px #000; }
.bi-gogo { position: absolute; right: 6vw; bottom: 8vh; font-family: var(--display); font-size: clamp(2rem, 7vw, 4.6rem); color: #b98cff;
  -webkit-text-stroke: 2px #000; animation: gogo 1.6s ease-out both; }

/* Battle hit-stop */
.arena.hitstop { transform: scale(1.025); transition: transform .05s; }
.arena.hitstop .fighter .sprite { animation-play-state: paused; }

/* Title sea + sailing ship */
.title-sea { position: fixed; left: 0; right: 0; bottom: 0; height: 12vh; pointer-events: none; z-index: 0; }
.title-screen { padding-bottom: 13vh; }
.title-sea > svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; }
.title-sea .tw1 { animation: wave 5s ease-in-out infinite alternate; }
.title-sea .tw2 { animation: wave 7s ease-in-out infinite alternate-reverse; }
.title-ship { position: absolute; bottom: 52%; width: 90px; height: 90px; overflow: visible; animation: sail 38s linear infinite; }
@keyframes sail { from { left: -10%; } to { left: 105%; } }
.title-screen > *:not(.title-sea) { position: relative; z-index: 1; }

/* Settings */
.modal.settings { max-width: 560px; }
.set-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 2px dashed #14141433; }
.set-row .btn { align-self: flex-start; }

/* Touch targets */
@media (hover: none) {
  .btn.small { min-height: 40px; }
  .crew-chip { min-height: 52px; }
}

/* Reduce motion */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

/* ---------- Battle presentation 2: cut-ins, HP trail, slow-mo, silhouettes ---------- */
.cutin { position: absolute; left: -5%; right: -5%; top: 34%; height: 30%; z-index: 26; display: flex; align-items: center; gap: 4%;
  padding: 0 10%; background: repeating-linear-gradient(100deg, #fff 0 22px, #f6c42c 22px 26px); border-top: 5px solid var(--ink); border-bottom: 5px solid var(--ink);
  transform: skewY(-4deg); animation: cutIn .9s cubic-bezier(.2, 1.2, .4, 1) forwards; overflow: hidden; }
.cutin.enemy { flex-direction: row-reverse; background: repeating-linear-gradient(80deg, #2a0a0a 0 22px, #d7262e 22px 26px); }
@keyframes cutIn { 0% { transform: skewY(-4deg) translateX(-110%); } 18% { transform: skewY(-4deg) translateX(0); } 78% { transform: skewY(-4deg) translateX(0); opacity: 1; }
  100% { transform: skewY(-4deg) translateX(110%); opacity: 0; } }
.cutin.enemy { animation-name: cutInR; }
@keyframes cutInR { 0% { transform: skewY(4deg) translateX(110%); } 18% { transform: skewY(4deg) translateX(0); } 78% { transform: skewY(4deg) translateX(0); opacity: 1; }
  100% { transform: skewY(4deg) translateX(-110%); opacity: 0; } }
.cutin-face { height: 150%; aspect-ratio: 1; overflow: hidden; flex: none; transform: skewY(4deg); }
.cutin-face .sprite.lg { width: 100%; height: 100%; transform: scale(1.7) translateY(18%); }
.cutin.enemy .cutin-face .sprite img { transform: scaleX(-1); }
.cutin-face .sprite.iconified svg { width: 70%; height: 70%; margin: 15%; }
.cutin-name { font-family: var(--display); font-size: clamp(1.4rem, 4.2vw, 2.8rem); color: var(--ink); letter-spacing: 1px; white-space: nowrap;
  -webkit-text-stroke: 0; text-shadow: 3px 3px 0 #fff; transform: skewY(4deg); }
.cutin.enemy .cutin-name { color: #fff; text-shadow: 3px 3px 0 #000; -webkit-text-stroke: 1px #000; }

/* HP bar with a red trail that catches up */
.bar.hp { position: relative; }
.bar.hp > s { position: absolute; left: 0; top: 0; bottom: 0; background: #ff8a6a; transition: width .5s ease-in .35s; text-decoration: none; }
.bar.hp > i { position: relative; }
.fighter .hud .bar.hp { height: 13px; }

/* Final boss KO in slow motion */
.arena.slowmo { filter: saturate(1.4) contrast(1.1); }
.arena.slowmo .fighter .sprite { animation-duration: 6s !important; }
.arena.slowmo::before { content: ''; position: absolute; inset: 0; z-index: 21; pointer-events: none;
  background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, .55)); animation: biIn .3s both; }
.sfx.ko.final { font-size: 6rem; color: var(--straw); animation-duration: 1.2s; }

/* Float colours for statuses */
.float.burn { color: #ff9a3a; } .float.poison { color: #b56cff; }

/* Ink silhouettes (no sprite yet) */
.ph.sil { background: none !important; border: 0; box-shadow: none; border-radius: 0; width: 100%; height: 100%; overflow: visible;
  display: flex; align-items: flex-end; justify-content: center; position: relative; }
.ph.sil::after { display: none; }
.ph.sil .sil-svg { width: 92%; height: 100%; }
.sil-tag { position: absolute; bottom: 8%; left: 50%; transform: translateX(-50%); font-family: var(--display); font-size: .32em; letter-spacing: 1px;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); padding: 0 .4em; -webkit-text-stroke: 0; text-shadow: none; white-space: nowrap; }
.sprite.sm .sil-tag, .sprite.xs .sil-tag { display: none; }
.sprite.lg .sil-tag { font-size: .28em; }
.set-row input[type=range] { width: 100%; max-width: 320px; accent-color: #d7262e; }

/* ---------- Living fighters ---------- */
.stage-slot .fighter .sprite.lg { width: calc(175px * var(--sc, 1)); height: calc(175px * var(--sc, 1)); }
.fighter.animated .sprite { animation: none; }
.fighter.animated .sprite img { transition: none; }
@media (max-width: 640px) { .stage-slot .fighter .sprite.lg { width: calc(112px * var(--sc, 1)); height: calc(112px * var(--sc, 1)); } }

/* ---------- UX pass: compare, drag, route preview, sailing, summary ---------- */
.cmp { font-size: .7rem; font-weight: 900; display: flex; gap: 4px; flex-wrap: wrap; }
.up { color: #1f8a3a; } .down { color: var(--red); }
#tip .up { color: #1f8a3a; } #tip .down { color: var(--red); }
.drag-row[draggable=true] { cursor: grab; }
.drag-row.dragging { opacity: .4; }
.drag-row.drop-target { outline: 3px dashed var(--red); outline-offset: 2px; }
.drag-hint { font-family: var(--body); font-size: .75rem; }
@media (hover: none) { .drag-hint { display: none; } }
.chart .route.ahead { stroke: #1f6fb2; opacity: .95; stroke-width: 3.2; }
.chart .route.sailing { stroke: var(--red); stroke-dasharray: none; stroke-width: 4; }
.node.ahead:not(.visited) .node-shadow { background: rgba(31, 111, 178, .35); }
.sailer { position: absolute; width: 7%; aspect-ratio: 1; transform: translate(-50%, -70%); z-index: 6; pointer-events: none; }
.sailer .node-ship { position: static; width: 100%; visibility: visible !important; }
.summary { max-width: 620px; margin: 16px auto; padding: 12px 14px; text-align: left; }
.mvp { display: flex; gap: 10px; align-items: center; background: #fff3c4; border: 2px solid var(--ink); padding: 6px 8px; margin-bottom: 8px; }
.mvp-tag { font-family: var(--display); color: var(--red); letter-spacing: 1px; font-size: 1.1rem; }
.sb { display: grid; grid-template-columns: 150px 1fr 70px; gap: 8px; align-items: center; font-size: .8rem; margin: 3px 0; }
.sb .bar { margin: 0; } .sb .bar > i { background: var(--red); } .sb b { text-align: right; }
.sum-row { font-size: .85rem; margin-top: 8px; }
.sum-bosses { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.sum-route { display: flex; gap: 1px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.sum-route .ico { width: 20px; height: 20px; } .rt-sep { color: var(--red); font-weight: 900; margin: 0 4px; }

/* =====================================================================
   Identity pass v0.7: Lilita One display / Zen Maru Gothic body / Dela Gothic One katakana,
   title scene, logo, harbour notice board, eyecatch, wanted wall, crew files.
   ===================================================================== */
h1, h2, h3, .btn, .badge, .rarity, .stats b, .topbar .arc, .hud-top b, .hud-top span, .vs, .float, .skill-banner, .round, .rar-ribbon, .ni-head,
.stamp, .cutin-name, .bi-name, .bi-epi, .bi-lv, .pb-order, .mvp-tag { font-family: var(--display); letter-spacing: .5px; }
h2 { font-size: 2.2rem; -webkit-text-stroke: 1.2px var(--ink); paint-order: stroke fill; }
.btn { font-size: 1.15rem; padding: 8px 18px 7px; letter-spacing: .5px; }
.btn.small { font-size: .95rem; }
.badge { font-size: .78rem; letter-spacing: .3px; }
.sfx, .bi-gogo, .sfx.gogo { font-family: var(--jp); letter-spacing: 0; }
.sfx.don { font-size: 4.6rem; }
.page-title { font-size: 2.6rem; color: var(--straw); text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 rgba(0, 0, 0, .25); }
.page-title::after { content: ''; display: block; width: 120px; height: 6px; margin-top: 6px; background: repeating-linear-gradient(90deg, var(--red) 0 18px, transparent 18px 26px); }
.center .page-title::after { margin-left: auto; margin-right: auto; }
body { letter-spacing: .1px; }

/* ---------- Title scene ---------- */
.title2 { position: relative; min-height: calc(100dvh - 32px); display: flex; align-items: flex-start; justify-content: center; }
.ts-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ts-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #2f86d6 0%, #74c0f0 46%, #ffe6a8 66%, #ffd08a 72%); }
.ts-sun { position: absolute; left: 50%; top: 52%; width: 34vmin; height: 34vmin; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, #fffbe6 0 36%, #ffe48a 37% 52%, rgba(255, 228, 138, 0) 70%); }
.ts-sun::after { content: ''; position: absolute; inset: -60%; background: repeating-conic-gradient(rgba(255, 245, 200, .35) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 62%); mask: radial-gradient(circle, #000 20%, transparent 62%); animation: spin 90s linear infinite; }
.ts-clouds { position: absolute; left: -10%; width: 120%; height: 20vh; opacity: .95;
  background: radial-gradient(ellipse 9% 40% at 12% 60%, #fff 98%, transparent), radial-gradient(ellipse 7% 34% at 20% 50%, #fff 98%, transparent),
    radial-gradient(ellipse 10% 42% at 62% 55%, #fff 98%, transparent), radial-gradient(ellipse 7% 30% at 70% 48%, #fff 98%, transparent),
    radial-gradient(ellipse 8% 34% at 90% 62%, #fff 98%, transparent); filter: drop-shadow(0 4px 0 rgba(20, 20, 20, .18)); animation: drift 60s linear infinite alternate; }
.ts-clouds.c1 { top: 6vh; } .ts-clouds.c2 { top: 24vh; transform: scale(.7); opacity: .7; animation-duration: 90s; }
.ts-isles { position: absolute; left: 0; right: 0; top: 60%; height: 10vh; width: 100%; }
.gulls { position: absolute; left: 8%; top: 14%; width: 28vw; max-width: 380px; }
.gull { animation: flap .6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.gull.g1 { animation-delay: .2s; } .gull.g2 { animation-delay: .35s; } .gull.g3 { animation-delay: .1s; }
@keyframes flap { to { transform: scaleY(.55); } }
.gulls { animation: glide 14s ease-in-out infinite alternate; }
@keyframes glide { to { transform: translate(18vw, 3vh); } }
.ts-sea { position: absolute; left: -5%; right: -5%; }
.ts-sea.back { top: 69%; bottom: 0; background:
  repeating-linear-gradient(0deg, transparent 0 22px, rgba(255, 255, 255, .14) 22px 25px), linear-gradient(180deg, #2a8fd4, #0f477c 70%, #082a4c); border-top: 4px solid var(--ink); }
.ts-sea.front { bottom: -2vh; height: 15vh; background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='40'%3E%3Cpath d='M0 22 q30 -18 60 0 t60 0 t60 0 t60 0' fill='none' stroke='%23ffffff' stroke-opacity='.75' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") 0 6px / 240px 40px repeat-x,
  linear-gradient(180deg, #1f6fb2, #0a3560); border-top: 4px solid var(--ink); animation: seaMove 6s linear infinite; }
@keyframes seaMove { to { background-position: 240px 6px, 0 0; } }
.ts-ship { position: absolute; right: 4vw; bottom: 9vh; width: min(46vw, 560px); aspect-ratio: 600 / 420; animation: bobShip 4s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes bobShip { 50% { transform: translateY(-1.4%) rotate(-1.6deg); } }
.ship-svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(6px 6px 0 rgba(20, 20, 20, .3)); }
.ts-ship .figure { position: absolute; width: 22%; left: 74%; top: 18%; filter: drop-shadow(3px 3px 0 rgba(20, 20, 20, .45)); }
.ts-deck { position: absolute; left: 8%; right: 24%; top: 25%; height: 36%; display: flex; justify-content: space-around; align-items: flex-end; }
.ts-deck .deck { height: 100%; max-width: 30%; object-fit: contain; filter: drop-shadow(2px 2px 0 rgba(20, 20, 20, .4)); }
.t2-front { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: flex-start; padding: 2vh 2vw 0; }
.t2-logo { width: min(640px, 92vw); margin: 0; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .25)); animation: logoIn .7s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes logoIn { from { transform: scale(.6) rotate(-6deg); opacity: 0; } }
.logo-svg { width: 100%; height: auto; display: block; overflow: visible; }
.t2-quote.bubble { font-size: 1.15rem; margin: -10px 0 22px 6%; transform: rotate(-2deg); padding: 8px 22px; }
.title2 .disclaimer { margin-top: 18px; color: #fff; text-shadow: 1px 1px 0 #000; font-size: .74rem; }
.title2 .disclaimer a { color: #ffe27a; }

/* Notice board menu */
.board { position: relative; width: min(420px, 92vw); padding: 44px 22px 22px; margin-left: 2%;
  background: repeating-linear-gradient(90deg, #9a5c2c 0 46px, #8a5126 46px 48px, #a7683a 48px 92px, #8a5126 92px 94px);
  border: 5px solid var(--ink); border-radius: 6px; box-shadow: 8px 8px 0 rgba(20, 20, 20, .55), inset 0 0 30px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; gap: 12px; animation: boardIn .6s .15s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes boardIn { from { transform: translateY(40px); opacity: 0; } }
.board::before, .board::after { content: ''; position: absolute; top: -28px; width: 10px; height: 34px; background: #5a3218; border: 3px solid var(--ink); }
.board::before { left: 22%; } .board::after { right: 22%; }
.board-head { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); font-family: var(--display); color: #fbe9c4; letter-spacing: 3px; font-size: 1rem;
  -webkit-text-stroke: .6px var(--ink); text-shadow: 2px 2px 0 rgba(0, 0, 0, .5); white-space: nowrap; }
.note { position: relative; text-align: left; border: 0; cursor: pointer; padding: 12px 16px 12px 22px; transform: rotate(var(--r));
  background: linear-gradient(180deg, #fbf3dc, #efdfb4); color: var(--ink); font-family: var(--body);
  box-shadow: 3px 4px 0 rgba(20, 20, 20, .5); clip-path: polygon(0 3%, 4% 0, 30% 2%, 60% 0, 96% 2%, 100% 6%, 99% 40%, 100% 94%, 96% 100%, 60% 98%, 30% 100%, 3% 98%, 0 92%, 1% 50%);
  transition: transform .12s, filter .12s; }
.note b { display: block; font-family: var(--display); font-size: 1.45rem; letter-spacing: .5px; color: var(--ink); line-height: 1.05; }
.note small { display: block; font-size: .8rem; color: #6b5a45; font-weight: 700; margin-top: 2px; }
.note.main { background: linear-gradient(180deg, #fff3b0, #f6c42c); }
.note.main b { font-size: 1.8rem; color: var(--red); -webkit-text-stroke: .6px var(--ink); }
.note:hover { transform: rotate(0deg) scale(1.03); filter: brightness(1.04); }
.note:active { transform: rotate(0deg) scale(.98); }
.pin { position: absolute; top: 8px; left: 8px; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a7a, var(--red) 60%, #6a0d0d); border: 2px solid var(--ink); }
@media (max-width: 760px) {
  .t2-front { align-items: center; padding-top: 1vh; }
  .board { margin-left: 0; }
  .ts-ship { right: -12vw; bottom: 3vh; width: 88vw; opacity: .9; }
  .ts-sun { top: 44%; }
  .t2-quote { margin-left: 0; }
}

/* ---------- Eyecatch ---------- */
.eyecatch { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ec-iris { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 0 #0b1d30; background: #f6c42c; animation: irisIn .5s cubic-bezier(.6, 0, .4, 1) forwards; }
@keyframes irisIn { to { width: 300vmax; height: 300vmax; } }
.eyecatch .ec-iris { background: radial-gradient(circle, #fff3b0 0 18%, #f6c42c 19% 40%, #d7262e 41% 42%, #f6c42c 43%); }
.ec-card { position: relative; text-align: center; opacity: 0; animation: ecCard .35s .35s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes ecCard { from { transform: scale(.5) rotate(-8deg); } to { opacity: 1; transform: none; } }
.ec-jolly { display: inline-block; animation: spinIn .6s .35s cubic-bezier(.2, 1.2, .4, 1) both; filter: drop-shadow(6px 6px 0 var(--ink)); }
@keyframes spinIn { from { transform: rotate(-200deg) scale(.4); } }
.ec-kicker { font-family: var(--display); font-size: 1.4rem; letter-spacing: 4px; color: var(--ink); margin-top: 4px; }
.ec-title { font-family: var(--display); font-size: clamp(3rem, 10vw, 6rem); line-height: .95; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 6px 6px 0 var(--red), 10px 10px 0 var(--ink); }
.ec-sub { display: inline-block; margin-top: 12px; background: var(--ink); color: #fff; font-family: var(--display); font-size: 1.3rem; padding: 4px 16px; transform: rotate(-2deg); }
.eyecatch.out { animation: ecOut .45s ease-in forwards; }
@keyframes ecOut { to { opacity: 0; transform: scale(1.08); } }

/* ---------- Toast via Den Den Mushi ---------- */
#toast .t { display: flex; align-items: center; gap: 8px; text-align: left; }
.t-snail { width: 34px; height: 34px; flex: none; animation: snailRing .25s ease-in-out 3; }
.t-snail .ico { width: 100%; height: 100%; }
@keyframes snailRing { 50% { transform: rotate(-12deg) scale(1.08); } }
.set-snail { width: 46px; height: 46px; } .set-snail .ico { width: 100%; height: 100%; }

/* ---------- Wanted wall ---------- */
.wall { background: repeating-linear-gradient(90deg, #6e4422 0 70px, #62391b 70px 72px); border: 5px solid var(--ink); padding: 16px; box-shadow: var(--shadow); }
.wall .end-stats { color: #fbe9c4; }
.wall-title { color: #fbe9c4; -webkit-text-stroke: .8px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--ink); font-size: 1.5rem; margin-top: 18px; }
.wall-title span { font-family: var(--body); font-size: .9rem; color: #f6c42c; }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; }
.wcard { background: linear-gradient(180deg, #efdcb1, #dfc28a); color: #3a2716; text-align: center; padding: 6px 6px 8px; box-shadow: 3px 4px 0 rgba(0, 0, 0, .5);
  border: 2px solid #3a271699; font-family: 'Playfair Display', Georgia, serif; font-weight: 900; }
.wcard:nth-child(3n) { transform: rotate(-1.5deg); } .wcard:nth-child(3n+1) { transform: rotate(1.2deg); }
.wc-head { font-size: 1.05rem; letter-spacing: 1px; line-height: 1; }
.wc-photo { margin: 4px auto; border: 2px solid #3a2716; background: linear-gradient(180deg, #a9c4c7, #d4c9a3); display: flex; justify-content: center; }
.wc-photo .sprite.sm { width: 74px; height: 74px; }
.wc-name { font-size: .72rem; line-height: 1.1; min-height: 1.6em; }
.wc-b { font-size: .78rem; }
.wcard.unseen { filter: sepia(.4) brightness(.7); }
.wcard.marine { background: linear-gradient(180deg, #e9eef2, #c9d3db); }
.ach-card { display: flex; gap: 10px; align-items: flex-start; }
.ach-seal { width: 40px; height: 40px; flex: none; } .ach-seal .ico { width: 100%; height: 100%; }
.ach-card.locked .ach-seal { filter: grayscale(1) opacity(.5); }

/* ---------- Crew files (captain select) ---------- */
.cap { background: linear-gradient(180deg, #fbf3dc, #efdfb4) !important; border-width: 3px; }
.cap::before { content: ''; position: absolute; top: -8px; left: 50%; width: 70px; height: 18px; transform: translateX(-50%) rotate(-3deg); background: rgba(246, 196, 44, .75);
  border: 1px solid rgba(20, 20, 20, .2); }
.cap.locked::before { background: rgba(160, 160, 160, .6); }
.cap h3 { font-size: 1.25rem; }
.wc-b { white-space: nowrap; font-size: .72rem; }
@media (max-width: 760px) { .ts-ship { bottom: 1vh; width: 74vw; } .title2 .disclaimer { background: rgba(8, 42, 76, .7); padding: 4px 8px; } }
.topbar { gap: 8px; }
.topbar .btn.small { font-size: .88rem; padding: 4px 9px 3px; }
.topbar .pill { font-size: .82rem; }
@media (max-width: 1120px) { .topbar .keyhint { display: none; } }
