/* Ukiyo Harbor: bold woodblock-print look. Mobile first. Night-harbor indigo, vermilion seals, gold leaf, washi cards.
   Patterns are inline SVG (no images to load). Motion respects prefers-reduced-motion. */
:root {
  --night: #131d36;
  --indigo: #1f3159;
  --ai: #2f5d8a;
  --sky: #6fa6c9;
  --paper: #f6edda;
  --paper-2: #eadcbb;
  --paper-3: #dccb9f;
  --ink: #1a2238;
  --sumi: #0d111c;
  --red: #d9432b;
  --red-2: #b3301b;
  --gold: #e3ac3a;
  --gold-2: #f4cf6e;
  --sakura: #eba3b0;
  --matcha: #5f8f5a;
  --violet: #6b4a91;
  --muted: #7d6f55;
  --line: #bfae82;
  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", Georgia, serif;
  --sans: "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='28' viewBox='0 0 56 28'%3E%3Cg fill='none' stroke='%23f6edda' stroke-opacity='.13' stroke-width='1.6'%3E%3Ccircle cx='28' cy='28' r='26'/%3E%3Ccircle cx='28' cy='28' r='19'/%3E%3Ccircle cx='28' cy='28' r='12'/%3E%3Ccircle cx='0' cy='14' r='26'/%3E%3Ccircle cx='0' cy='14' r='19'/%3E%3Ccircle cx='0' cy='14' r='12'/%3E%3Ccircle cx='56' cy='14' r='26'/%3E%3Ccircle cx='56' cy='14' r='19'/%3E%3Ccircle cx='56' cy='14' r='12'/%3E%3C/g%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .2 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --hand: 9px 15px 10px 14px / 14px 9px 15px 10px;
  --bnav: 66px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--night);
  background-image: var(--wave), radial-gradient(120% 60% at 50% -10%, #34508a 0%, transparent 60%), linear-gradient(var(--night), #0e1527);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px; line-height: 1.45;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--ai); }
button { font: inherit; }
h1, h2, h3 { font-family: var(--serif); margin: 0 0 .45em; font-weight: 800; letter-spacing: .02em; line-height: 1.2; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: .8rem; }
.center { text-align: center; }

/* ---------- shell ---------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem;
  padding-top: max(.55rem, env(safe-area-inset-top));
  background: linear-gradient(#0f1830, #16244a);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 4px 0 var(--red), 0 8px 18px rgba(0,0,0,.35);
  color: var(--paper);
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--paper); text-decoration: none; font-family: var(--serif); font-weight: 800; font-size: 1.1rem; letter-spacing: .1em; }
.brand small { display: none; font-weight: 600; letter-spacing: .3em; color: var(--gold); font-size: .6rem; }
.brand .seal {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 35% 30%, #ff7a55, var(--red) 55%, var(--red-2));
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--sumi), 0 0 14px rgba(217,67,43,.7);
  animation: breathe 5s ease-in-out infinite;
}
.brand .name { display: none; }
.wallet { margin-left: auto; display: flex; gap: .35rem; font-size: .82rem; font-weight: 700; }
.wallet .w { display: flex; align-items: center; gap: .3rem; padding: .15rem .55rem .15rem .2rem; border-radius: 99px; background: rgba(246,237,218,.12); border: 1px solid rgba(246,237,218,.25); }
.wallet .w i { font-style: normal; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--sumi); font-family: var(--serif); font-weight: 800; font-size: .8rem; }
.userbtn { flex: 0 0 auto; border: 2px solid var(--paper); background: transparent; color: var(--paper); border-radius: 99px; width: 36px; height: 36px; font-weight: 800; cursor: pointer; font-family: var(--serif); }
.userbtn .full { display: none; }
.userbtn:hover { background: var(--red); border-color: var(--red); }

/* rank: shown on every screen, hanko-seal style */
.rankbar {
  display: flex; gap: .7rem; padding: .7rem .8rem .75rem; overflow-x: auto; scroll-snap-type: x proximity;
  background: linear-gradient(rgba(10,15,30,.55), rgba(10,15,30,.25));
  border-bottom: 1px solid rgba(246,237,218,.15);
  scrollbar-width: none;
}
.rankbar::-webkit-scrollbar { display: none; }
.rankchip {
  flex: 0 0 auto; scroll-snap-align: start; display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--paper);
  padding: .3rem .8rem .3rem .3rem; border-radius: 99px; background: rgba(246,237,218,.1); border: 1px solid rgba(246,237,218,.28);
  transition: transform .18s ease, background .18s ease;
}
.rankchip:hover { transform: translateY(-2px); background: rgba(246,237,218,.18); }
.rankchip .num {
  min-width: 3.4rem; text-align: center; padding: .3rem .45rem; border-radius: 7px; transform: rotate(-3deg);
  font-family: var(--serif); font-weight: 800; font-size: 1.45rem; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--red); color: var(--paper); box-shadow: inset 0 0 0 2px rgba(246,237,218,.5), 0 2px 0 var(--sumi);
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}
.rankchip .lbl { font-size: .78rem; line-height: 1.2; opacity: .95; }
.rankchip .lbl b { display: block; font-size: .88rem; color: var(--gold-2); }
.rankchip.first { border-color: var(--gold); background: linear-gradient(100deg, rgba(227,172,58,.28), rgba(246,237,218,.08)); }
.rankchip.first .num {
  color: var(--sumi); text-shadow: none;
  background: linear-gradient(105deg, #d8991f 0%, #fff0a8 40%, #d8991f 60%, #fff0a8 100%); background-size: 220% 100%;
  animation: shimmer 3.2s linear infinite;
}
.rankchip.first .num::before { content: "♛ "; font-size: .8em; }
.delta.up { color: #8be08a; } .delta.down { color: #ff8e76; } .delta { font-weight: 800; }
.rankbar .hint { align-self: center; font-size: .85rem; color: rgba(246,237,218,.8); }
.rankbar .hint a { color: var(--gold-2); }

/* layout: phone = bottom tab bar */
.layout { flex: 1; display: flex; flex-direction: column; min-width: 0; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 1rem .8rem calc(var(--bnav) + 28px + env(safe-area-inset-bottom)); min-width: 0; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; overflow-x: auto; scrollbar-width: none;
  background: linear-gradient(#16244a, #0d1530); border-top: 3px solid var(--gold);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 18px rgba(0,0,0,.4);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto; width: 68px; height: var(--bnav); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: rgba(246,237,218,.75); text-decoration: none; font-size: .66rem; font-weight: 700; position: relative; transition: color .15s, transform .15s;
}
.nav a .k { font-family: var(--serif); font-size: 1.45rem; line-height: 1; font-weight: 800; }
.nav a.on { color: var(--gold-2); }
.nav a.on::before { content: ""; position: absolute; top: 0; left: 18%; right: 18%; height: 4px; background: var(--red); border-radius: 0 0 4px 4px; }
.nav a:active { transform: scale(.92); }
.nav .badge { position: absolute; top: 6px; right: 14px; background: var(--red); color: var(--paper); border-radius: 9px; font-size: .62rem; padding: 0 .35rem; }

@media (min-width: 761px) and (min-height: 521px) {
  .brand .name { display: inline; } .brand small { display: block; }
  .userbtn { width: auto; padding: 0 .9rem; } .userbtn .short { display: none; } .userbtn .full { display: inline; }
  .wallet { font-size: .95rem; gap: .5rem; }
  .layout { flex-direction: row; }
  .nav {
    position: sticky; top: 76px; align-self: flex-start; flex-direction: column; width: 178px; flex: 0 0 178px; height: auto; margin: 1rem 0 0 1rem;
    border: 3px solid var(--sumi); border-radius: var(--hand); background: linear-gradient(#1b2b57, #101a38); box-shadow: 6px 6px 0 rgba(0,0,0,.45);
    padding: .4rem; overflow: hidden;
  }
  .nav a { width: auto; height: 46px; flex-direction: row; justify-content: flex-start; gap: .7rem; padding: 0 .8rem; font-size: .95rem; border-radius: 8px; }
  .nav a .k { width: 1.6rem; text-align: center; font-size: 1.3rem; }
  .nav a:hover { background: rgba(246,237,218,.1); color: var(--paper); }
  .nav a.on { background: rgba(217,67,43,.22); }
  .nav a.on::before { top: 20%; bottom: 20%; left: 0; right: auto; width: 4px; height: auto; border-radius: 0 4px 4px 0; }
  main { padding: 1.2rem 1.4rem 2rem; }
  h1 { font-size: 2.1rem; }
}

/* page title on the dark backdrop: brush stroke */
main > h1 {
  color: var(--paper); display: inline-block; position: relative; margin: .2rem 0 .9rem; padding: 0 .2rem; z-index: 0;
  text-shadow: 0 2px 0 rgba(0,0,0,.4);
}
main > h1::after { content: ""; position: absolute; left: -6px; right: -14px; bottom: 2px; height: .42em; z-index: -1; background: var(--red); border-radius: 3px 18px 4px 22px / 6px 12px 5px 14px; transform: rotate(-1deg); opacity: .9; }
main > p.muted, main > .muted { color: rgba(246,237,218,.7); }
main > h2 { color: var(--paper); }

/* ---------- cards ---------- */
.card {
  position: relative; background: var(--paper) var(--grain); border: 3px solid var(--sumi); border-radius: var(--hand);
  padding: 1rem 1.05rem; box-shadow: 5px 5px 0 rgba(0,0,0,.5); overflow-x: auto; overflow-y: hidden; min-width: 0;
}
.card::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(217,67,43,.45); border-radius: 6px 12px 7px 11px / 11px 7px 12px 6px; pointer-events: none; }
.card::after { content: ""; position: absolute; top: 0; right: 0; width: 64px; height: 64px; background: radial-gradient(circle at 100% 0, rgba(217,67,43,.2), transparent 70%); pointer-events: none; }
.card > h2 { padding-bottom: .35rem; position: relative; }
.card > h2::after { content: ""; display: block; width: 46px; height: 5px; margin-top: .35rem; background: var(--red); border-radius: 4px 10px 3px 9px; transform: rotate(-1.5deg); }
.card.flat { box-shadow: none; border-width: 2px; background-color: var(--paper-2); }
.card.flat::before, .card.flat::after { display: none; }
.card .card { box-shadow: 3px 3px 0 rgba(0,0,0,.25); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.grid.narrow { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.two { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .two { grid-template-columns: 1fr 350px; } }

/* entrance motion */
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
main > *, .grid > *, .two > * { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; }
main > *:nth-child(2), .grid > *:nth-child(2), .two > *:nth-child(2) { animation-delay: .07s; }
main > *:nth-child(3), .grid > *:nth-child(3) { animation-delay: .14s; }
main > *:nth-child(4), .grid > *:nth-child(4) { animation-delay: .21s; }
.grid > *:nth-child(n+5) { animation-delay: .28s; }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes breathe { 50% { transform: scale(1.07); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(227,172,58,.75), 3px 3px 0 var(--sumi); } 50% { box-shadow: 0 0 0 9px rgba(227,172,58,0), 3px 3px 0 var(--sumi); } }
@keyframes pop { 0% { transform: scale(.6) rotate(-4deg); opacity: 0; } 70% { transform: scale(1.08) rotate(1deg); } 100% { transform: none; opacity: 1; } }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: .85; } }
@keyframes drift { to { background-position-x: 560px; } }
@keyframes blink { 50% { opacity: .55; } }

/* ---------- buttons, forms ---------- */
.btn { white-space: nowrap;
  position: relative; overflow: hidden; display: inline-block; cursor: pointer; text-decoration: none; text-align: center;
  background: linear-gradient(#ef5a3d, var(--red) 55%, var(--red-2)); color: var(--paper); font-weight: 800; letter-spacing: .03em;
  padding: .55rem 1.1rem; border: 3px solid var(--sumi); border-radius: 9px 13px 9px 12px / 12px 9px 13px 9px;
  box-shadow: 3px 3px 0 var(--sumi); text-shadow: 0 1px 0 rgba(0,0,0,.35);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; min-height: 40px;
}
.btn::after { content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%; background: linear-gradient(105deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); transition: left .5s ease; }
.btn:hover:not(:disabled) { transform: translate(-1px, -2px); box-shadow: 5px 6px 0 var(--sumi); filter: brightness(1.06); }
.btn:hover:not(:disabled)::after { left: 130%; }
.btn:active:not(:disabled) { transform: translate(3px, 3px) scale(.98); box-shadow: 0 0 0 var(--sumi); }
.btn:disabled { opacity: .5; cursor: default; filter: grayscale(.5); }
.btn.alt { background: linear-gradient(#3b6aa0, var(--ai) 55%, var(--indigo)); }
.btn.ghost { background: var(--paper); color: var(--ink); text-shadow: none; }
.btn.gold, .btn.claim { background: linear-gradient(var(--gold-2), var(--gold)); color: var(--sumi); text-shadow: none; }
.btn.claim { animation: pulse 1.8s ease-in-out infinite; }
.btn.small { padding: .25rem .7rem; font-size: .85rem; min-height: 32px; border-width: 2px; box-shadow: 2px 2px 0 var(--sumi); }
input, select {
  font: inherit; padding: .5rem .6rem; border: 3px solid var(--sumi); border-radius: 8px 11px 8px 10px / 10px 8px 11px 8px; background: #fffaf0; color: var(--ink); max-width: 100%; min-height: 42px;
}
input:focus, select:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
label.field { display: block; margin-bottom: .7rem; font-weight: 700; }
label.field input, label.field select { display: block; width: 100%; margin-top: .25rem; }
.err { color: var(--red-2); font-weight: 700; margin: .4rem 0; }
.ok { color: var(--matcha); font-weight: 800; }
.pill { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: .08rem .55rem; border-radius: 99px; background: var(--indigo); color: var(--paper); border: 1.5px solid var(--sumi); }
.pill.live { background: var(--red); animation: blink 1.6s ease-in-out infinite; }
.pill.up { background: var(--ai); } .pill.ended { background: var(--muted); } .pill.soon { background: var(--gold); color: var(--sumi); }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px dashed var(--line); overflow-wrap: break-word; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
tr.me td { background: linear-gradient(90deg, rgba(217,67,43,.2), rgba(227,172,58,.15)); font-weight: 800; }
.bar { height: 12px; background: var(--paper-3); border: 2px solid var(--sumi); border-radius: 8px; overflow: hidden; margin-top: .25rem; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ai), var(--sky)); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.red > i { background: linear-gradient(90deg, var(--red-2), #ff7a55); }
.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button {
  border: 3px solid var(--sumi); background: var(--paper); padding: .35rem .95rem; border-radius: 9px 13px 9px 12px / 12px 9px 13px 9px; cursor: pointer; font-weight: 800; color: var(--ink);
  box-shadow: 2px 2px 0 var(--sumi); transition: transform .12s;
}
.tabs button:hover { transform: translateY(-2px); }
.tabs button.on { background: var(--red); color: var(--paper); box-shadow: 0 0 0 var(--sumi); transform: translate(2px, 2px); }
.cd { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--red-2); }
.bigrank { font-family: var(--serif); font-size: 3.4rem; font-weight: 800; line-height: 1; color: var(--red); text-shadow: 2px 2px 0 var(--gold); }

/* art tiles */
.art { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; background: var(--paper-3); border: 3px solid var(--sumi); border-radius: 9px 12px 9px 11px / 11px 9px 12px 9px; font-family: var(--serif); font-weight: 800; font-size: 1.4rem; color: var(--muted); }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art.lg { width: 96px; height: 96px; }

/* inventory */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 7px; }
.slot { aspect-ratio: 1; position: relative; display: grid; place-items: center; padding: 0; overflow: hidden; cursor: pointer; border: 2px dashed var(--line); background: rgba(0,0,0,.05); border-radius: 8px 11px 8px 10px; transition: transform .12s; }
.slot.filled { border: 3px solid var(--sumi); background: var(--paper); box-shadow: 2px 2px 0 var(--sumi); }
.slot.filled:hover { transform: translateY(-2px) rotate(-1deg); }
.slot.sel { outline: 4px solid var(--red); outline-offset: 1px; }
.slot.locked { background: repeating-linear-gradient(45deg, var(--paper-3) 0 6px, var(--paper-2) 6px 12px); cursor: not-allowed; }
.slot .count { position: absolute; right: 2px; bottom: 2px; background: var(--sumi); color: var(--gold-2); font-size: .68rem; font-weight: 800; padding: 0 .35rem; border-radius: 6px; }
.slot .gt { position: absolute; left: 2px; top: 2px; font-size: .6rem; font-weight: 800; background: var(--gold); color: var(--sumi); padding: 0 .25rem; border-radius: 3px; }
.slot .art { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.slot .art.nm { font-size: .7rem; text-align: center; padding: 2px; word-break: break-word; }

/* map */
.mapwrap { position: relative; border: 3px solid var(--sumi); border-radius: var(--hand); background: #e7d9b4; overflow: hidden; height: min(62vh, 560px); touch-action: none; box-shadow: 5px 5px 0 rgba(0,0,0,.5); }
.mapwrap canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.mapwrap .zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 5px; }
.mapwrap .legend { position: absolute; left: 8px; bottom: 8px; right: 8px; background: rgba(246,237,218,.92); border: 2px solid var(--sumi); border-radius: 8px; padding: .25rem .5rem; font-size: .7rem; }
.squad { display: grid; grid-template-columns: 52px 1fr auto; gap: .7rem; align-items: center; padding: .6rem 0; border-bottom: 1px dashed var(--line); }

/* hero cards by rarity */
.rar-epic { border-color: var(--violet); box-shadow: 5px 5px 0 rgba(107,74,145,.55); }
.rar-legendary { border-color: #8a6410; box-shadow: 5px 5px 0 rgba(227,172,58,.7), 0 0 24px rgba(227,172,58,.5); }
.rar-legendary::after { background: linear-gradient(115deg, transparent 40%, rgba(255,240,168,.55) 50%, transparent 60%); background-size: 250% 100%; width: 100%; height: 100%; animation: shimmer 4s linear infinite; }
.rar-epic .rname { color: var(--violet); } .rar-legendary .rname { color: #9a6c0a; }

/* timeline */
.tl { border-left: 5px solid var(--red); margin-left: .6rem; padding-left: 1.1rem; }
.tl .entry { position: relative; padding: .55rem 0 1rem; }
.tl .entry::before { content: ""; position: absolute; left: -1.7rem; top: .8rem; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 4px solid var(--sumi); }
.tl .entry.live::before { background: var(--red); animation: breathe 1.4s ease-in-out infinite; }
.tl .entry.ended { opacity: .55; }
.card > .tl { margin-top: .5rem; }

/* modal + toasts */
.modal-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1rem; background: rgba(8,12,24,.7); backdrop-filter: blur(3px); animation: rise .2s both; }
.modal { background: var(--paper) var(--grain); border: 4px solid var(--sumi); border-radius: var(--hand); padding: 1.1rem; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 8px 8px 0 rgba(0,0,0,.5); animation: pop .3s both; }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--bnav) + 16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 90; pointer-events: none; padding: 0 .8rem; }
.toast { animation: pop .35s both; pointer-events: auto; max-width: min(420px, 100%); background: var(--sumi) var(--grain); color: var(--paper); font-weight: 700; padding: .65rem 1rem; border: 3px solid var(--gold); border-radius: var(--hand); box-shadow: 4px 4px 0 rgba(0,0,0,.45); }
.toast::before { content: "✦ "; color: var(--gold-2); }
.toast.bad { border-color: var(--red); } .toast.bad::before { content: "! "; color: var(--red); }
@media (min-width: 761px) and (min-height: 521px) { #toasts { left: auto; right: 18px; bottom: 18px; align-items: flex-end; } }
.petal { position: fixed; top: -20px; z-index: 95; pointer-events: none; width: 14px; height: 11px; background: radial-gradient(ellipse at 30% 30%, #ffd0d8, var(--sakura) 70%); border-radius: 80% 0 80% 0; animation: fall var(--t) ease-in forwards; opacity: 1; }

/* ---------- landing + hero banner ---------- */
.hero-land { text-align: center; padding: 2.2rem .5rem 1rem; color: var(--paper); position: relative; }
.hero-land .sun { width: min(55vw, 220px); aspect-ratio: 1; border-radius: 50%; margin: 0 auto 1.2rem; background: radial-gradient(circle at 35% 30%, #ff8a63, var(--red) 55%, var(--red-2)); box-shadow: 0 0 0 10px rgba(246,237,218,.12), 0 0 0 20px rgba(246,237,218,.06), 0 0 70px rgba(217,67,43,.75); animation: breathe 6s ease-in-out infinite; }
.hero-land h1 { font-size: clamp(2.2rem, 9vw, 4rem); letter-spacing: .12em; text-shadow: 0 3px 0 var(--sumi), 0 0 26px rgba(227,172,58,.5); }
.hero-land .kanji { font-family: var(--serif); letter-spacing: .6em; color: var(--gold-2); font-weight: 800; margin-bottom: .5rem; }
.hero-land p { max-width: 34rem; margin: .5rem auto 1rem; font-size: 1.05rem; color: rgba(246,237,218,.88); }
.waves { height: 90px; margin: 1.4rem -1rem; background: var(--wave); background-size: 112px 56px; opacity: 1; animation: drift 24s linear infinite; mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); filter: brightness(2.4); }
.authbox { max-width: 420px; margin: 1.5rem auto; }
.demo-flag { background: var(--gold); color: var(--sumi); text-align: center; font-size: .72rem; font-weight: 800; padding: .15rem; }
.banner {
  position: relative; overflow: hidden; margin-bottom: 1rem; color: var(--paper); border: 3px solid var(--sumi); border-radius: var(--hand); box-shadow: 5px 5px 0 rgba(0,0,0,.5);
  background: linear-gradient(120deg, #1b2e5c, #2f5d8a 60%, #6fa6c9); padding: 1.3rem 1.2rem; min-height: 150px; display: flex; flex-direction: column; justify-content: center;
}
.banner::before { content: ""; position: absolute; inset: 0; background: var(--wave); background-size: 84px 42px; opacity: 1; pointer-events: none; }
.banner .sun { position: absolute; right: 12%; top: -26px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9a73, var(--red) 60%); box-shadow: 0 0 40px rgba(217,67,43,.7); animation: breathe 7s ease-in-out infinite; }
.banner .portrait { position: absolute; right: 0; bottom: 0; height: 118%; width: 46%; background-size: cover; background-position: center top; -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%); mask-image: linear-gradient(90deg, transparent, #000 35%); }
.banner h1 { position: relative; margin: 0 0 .2rem; text-shadow: 0 2px 0 var(--sumi); font-size: 1.6rem; }
.banner p { position: relative; margin: 0; font-weight: 600; max-width: 60%; text-shadow: 0 1px 0 rgba(0,0,0,.5); }
@media (min-width: 761px) and (min-height: 521px) { .banner h1 { font-size: 2.2rem; } .banner { min-height: 170px; padding: 1.6rem 2rem; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
