/* Dice Banners — base look: anime esports UI, navy glass + cobalt, diagonal slashed flag light bands. */
:root {
  --ink: #050a1c; --navy: #0c1430; --navy2: #17224a; --navy3: #23305e;
  --blue: #1d55ff; --blue2: #3d8bff; --cyan: #66dcff; --white: #f4f7ff; --mute: #9fb0d8;
  --gold: #ffc93c; --red: #ff3d5a; --green: #3ee08f;
  --flare: #ff5a3c; --tide: #3cb4ff; --gale: #4fe08a; --lumen: #ffd84a; --umbra: #b07bff;
  --ssr: linear-gradient(135deg, #fff1a8, #ffb526 45%, #ff7ad9); --sr: linear-gradient(135deg, #e6c8ff, #9b5bff); --r: linear-gradient(135deg, #bfe6ff, #3d8bff);
  --font: "Trebuchet MS", "Helvetica Neue", Arial, sans-serif;
  --cut: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html { font-size: clamp(14px, 2.4vh, 22px); }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--white); font-family: var(--font); }
#stage3d { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.screen { position: absolute; inset: 0; pointer-events: auto; overflow: hidden; animation: screenIn .28s cubic-bezier(.2,1.3,.4,1) both; }
.screen.passthru { pointer-events: none; }
.screen.passthru .hit { pointer-events: auto; }
.bgimg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.ol { text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 3px 4px 0 rgba(0,0,0,.45); }
.num { font-weight: 900; font-style: italic; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.mute { color: var(--mute); }

/* Panels */
.panel { position: relative; background: linear-gradient(160deg, rgba(23,34,74,.94), rgba(10,16,40,.94)); border: 1px solid rgba(102,220,255,.35);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); padding: 1rem; }
.panel::before { content: ""; position: absolute; left: 0; top: 0; width: 38%; height: 4px; background: linear-gradient(90deg, var(--blue2), transparent); }
.panel.light { background: linear-gradient(160deg, rgba(248,250,255,.96), rgba(222,230,250,.94)); color: #101a3a; border-color: rgba(29,85,255,.35); }
.panel.light .mute { color: #5a6a94; }

/* Buttons */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 44px; min-width: 44px; padding: .55em 1.4em;
  background: linear-gradient(180deg, #232c48, #141a2e); color: var(--white); border: 0; font: inherit; font-weight: 800; font-size: 1rem; letter-spacing: .04em; cursor: pointer;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); transition: transform .12s, filter .12s; white-space: nowrap; }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.18) 40%, transparent 52%); pointer-events: none; }
.btn:hover, .btn.focus { filter: brightness(1.25); transform: scale(1.04); }
.btn.focus { outline: 3px solid var(--cyan); outline-offset: -3px; }
.btn:active { transform: scale(.94); }
.btn-primary { background: linear-gradient(180deg, #3a7bff, #1440d8 60%, #0e33b8); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.btn-gold { background: linear-gradient(180deg, #ffd96a, #f0a018); color: #2a1600; }
.btn-gold.ol, .btn-gold .ol { text-shadow: 0 1px 0 rgba(255,246,210,.85), 0 -1px 0 rgba(255,246,210,.5); }
.btn-danger { background: linear-gradient(180deg, #ff5d75, #c41d3d); }
.btn-light { background: linear-gradient(180deg, #ffffff, #dfe6f7); color: #14204a; }
.btn[disabled], .btn.disabled { filter: grayscale(.8) brightness(.6); cursor: default; }
.btn-icon { padding: 0; width: 48px; height: 48px; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.btn-icon img { width: 70%; height: 70%; object-fit: contain; }
.btn-big { font-size: 1.35rem; padding: .7em 2.2em; min-height: 56px; }
.btn .cost { display: inline-flex; align-items: center; gap: .2em; font-size: .85em; opacity: .95; }
.btn .cost img { width: 1.2em; height: 1.2em; }

/* Headers: slanted title strip with flag bands */
.hdr { position: absolute; left: 0; top: 0; height: 64px; display: flex; align-items: center; gap: .8rem; padding: 0 1.2rem 0 76px; z-index: 5; }
.hdr .ttl { font-size: 1.5rem; font-weight: 900; font-style: italic; letter-spacing: .06em; padding: .15em 1.6em .15em .8em; background: linear-gradient(90deg, var(--blue), rgba(29,85,255,0));
  clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%); }
.btn-back { flex: none; min-height: 46px; min-width: 46px; padding: .2em 1.1em .2em .8em; gap: .45em; font-size: 1.05rem; font-weight: 900; font-style: italic; animation: slideL .3s both; }
.btn-back .arr { font-style: normal; font-size: 1.1em; line-height: 1; filter: drop-shadow(1px 1px 0 rgba(0,0,30,.7)); }
.btn-back .lb { -webkit-text-stroke: 3px #071436; paint-order: stroke fill; }
.btn-back.float { position: absolute; left: 76px; top: 9px; z-index: 6; }
.vtitle { position: absolute; left: 0; top: 0; bottom: 0; width: 13vh; background: linear-gradient(180deg, var(--blue), #0b2fae); transform: skewX(-8deg); transform-origin: top left; overflow: hidden; }
.vtitle span { position: absolute; left: 50%; top: 52%; transform: translate(-50%,-50%) rotate(-90deg) skewX(8deg); white-space: nowrap; font-size: 7vh; font-weight: 900; font-style: italic; color: rgba(255,255,255,.22); letter-spacing: .05em; }

/* Diagonal flag light bands (the game's motif) */
.bands { position: absolute; inset: -20%; pointer-events: none; overflow: hidden; }
.bands i { position: absolute; left: -30%; width: 160%; height: 7vh; transform: rotate(-18deg); background: linear-gradient(90deg, transparent, rgba(61,139,255,.55) 30%, rgba(255,255,255,.75) 50%, rgba(61,139,255,.5) 70%, transparent);
  filter: blur(1px); animation: bandMove 6s linear infinite; mix-blend-mode: screen; opacity: .55; }
.bands i:nth-child(1) { top: 28%; animation-duration: 7s; }
.bands i:nth-child(2) { top: 46%; height: 2.4vh; animation-duration: 5s; animation-delay: -2s; opacity: .7; }
.bands i:nth-child(3) { top: 70%; height: 4vh; animation-duration: 9s; animation-delay: -4s; }
@keyframes bandMove { from { transform: rotate(-18deg) translateX(-25%); } to { transform: rotate(-18deg) translateX(25%); } }

/* HUD chips */
.chips { position: absolute; top: 10px; right: 70px; display: flex; gap: .5rem; z-index: 6; }
.chip { display: inline-flex; align-items: center; gap: .35em; height: 44px; padding: 0 .9em 0 .4em; background: rgba(8,12,30,.82); border-bottom: 2px solid var(--blue2);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); font-weight: 900; font-style: italic; font-size: 1.05rem; }
.chip img { width: 30px; height: 30px; object-fit: contain; }
@media (max-width: 800px) {
  .chips { gap: .25rem; right: 62px; }
  .chip { padding: 0 .5em 0 .2em; font-size: .85rem; }
  .chip img { width: 24px; height: 24px; }
  .hdr { gap: .5rem; }
  .hdr .ttl { font-size: 1rem; padding: .15em 1em .15em .5em; max-width: 26vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-back { padding: .2em .7em .2em .5em; font-size: .95rem; }
}

/* Cards */
.card { position: relative; width: 9.5rem; aspect-ratio: 3/4.2; background: linear-gradient(170deg, #26335f, #0f1733); overflow: hidden; cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%); transition: transform .12s, filter .12s; border-bottom: 3px solid var(--blue2); }
.card img.por { position: absolute; left: -5%; width: 110%; top: 0; height: 150%; object-fit: cover; object-position: top center; }
.card .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6em .45em .35em; background: linear-gradient(0deg, rgba(5,10,28,.95), transparent); }
.card .nm { font-weight: 900; font-size: .9rem; line-height: 1.1; }
.card .lv { font-weight: 900; font-style: italic; font-size: 1.1rem; }
.card.locked img.por { filter: brightness(0) opacity(.55); }
.card:hover, .card.focus { transform: translateY(-3px) scale(1.03); filter: brightness(1.15); }
.card.focus { outline: 3px solid var(--cyan); outline-offset: -3px; }
.rar { display: inline-block; padding: 0 .4em; font-weight: 900; font-style: italic; font-size: .8rem; color: #1a0f00; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.rar.SSR { background: var(--ssr); } .rar.SR { background: var(--sr); color: #fff; } .rar.R { background: var(--r); color: #fff; }
.el { display: inline-block; width: 1.1em; height: 1.1em; transform: rotate(45deg); border: 2px solid var(--ink); vertical-align: middle; }
.el.flare { background: var(--flare); } .el.tide { background: var(--tide); } .el.gale { background: var(--gale); } .el.lumen { background: var(--lumen); } .el.umbra { background: var(--umbra); }

/* Bars */
.bar { position: relative; height: 10px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.25); overflow: hidden; transform: skewX(-20deg); }
.bar > b { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #3ee08f, #b6ff6a); transition: width .3s; }
.bar.hp-low > b { background: linear-gradient(90deg, #ff3d5a, #ff9a3c); }
.bar.atb > b { background: linear-gradient(90deg, #3d8bff, #66dcff); transition: none; }
.bar.en > b { background: linear-gradient(90deg, #ffb526, #fff1a8); }

/* Modal */
.modal-back { position: absolute; inset: 0; background: rgba(3,6,18,.72); display: flex; align-items: center; justify-content: center; z-index: 40; pointer-events: auto; animation: fadeIn .18s both; }
.modal { max-width: 86vw; max-height: 86vh; overflow: auto; animation: pop .28s cubic-bezier(.2,1.4,.4,1) both; }
.modal .row { display: flex; gap: .8rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }

/* Tabs */
.tabs { display: flex; gap: .3rem; }
.tab { padding: .5em 1.2em; min-height: 44px; display: inline-flex; align-items: center; background: rgba(8,12,30,.7); border: 1px solid rgba(255,255,255,.25); font-weight: 800; cursor: pointer;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.tab.on { background: var(--white); color: #12204a; }
.tab.focus { outline: 3px solid var(--cyan); outline-offset: -3px; }

/* Screen wipe: three slanted bands */
#wipe { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
#wipe i { position: absolute; top: -20%; bottom: -20%; width: 70%; left: -90%; transform: skewX(-20deg); }
#wipe i:nth-child(1) { background: var(--blue); } #wipe i:nth-child(2) { background: var(--white); width: 8%; } #wipe i:nth-child(3) { background: var(--navy); }
#wipe.on i { transition: left .32s cubic-bezier(.7,0,.3,1); }
#wipe.cover i:nth-child(1) { left: -10%; } #wipe.cover i:nth-child(2) { left: 55%; } #wipe.cover i:nth-child(3) { left: 50%; width: 80%; }
#wipe.out i { left: 130% !important; transition: left .32s cubic-bezier(.7,0,.3,1); }

/* Toasts */
#toasts { position: fixed; left: 50%; top: 14%; transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; align-items: center; gap: .4rem; pointer-events: none; }
.toast { padding: .5em 1.6em; background: rgba(8,12,30,.92); border-left: 4px solid var(--cyan); font-weight: 800; animation: pop .25s both; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }

@keyframes screenIn { from { opacity: 0; transform: translateX(3%); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.82); } 100% { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes slideL { from { opacity: 0; transform: translateX(-12%); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: 0; transform: translateX(12%); } to { opacity: 1; transform: none; } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.2%); } }
@keyframes slam { 0% { opacity: 0; transform: scale(2.2) rotate(-6deg); } 60% { opacity: 1; transform: scale(.94) rotate(-6deg); } 100% { transform: scale(1) rotate(-6deg); } }
