/* CORNERZ RUSH — game screen styles (portrait, 360–430px phones, centred on desktop)
 * Look: "card shop arena at night" — dark glass panels, Cornerz yellow + violet neon edges,
 * a neon grid floor, light beams and floating card silhouettes. */
:root {
  --ink: #0D0826;
  --night: #120C30;
  --p1: #1A1240;
  --p2: #241A55;
  --p3: #3D2A85;
  --vio: #9F7BFF;
  --vio-d: #6B47E0;
  --vio-l: #CBB8FF;
  --y: #FFCB05;
  --y-l: #FFE45C;
  --y-d: #C98A00;
  --cyan: #6FE6FF;
  --txt: #fff;
  --txt-2: #DCD4FA;
  --txt-3: #ABA0D8;
  --grad-bg: linear-gradient(180deg, #120C30 0%, #1A1240 38%, #241A55 72%, #150E38 100%);
  --grad-cta: linear-gradient(180deg, #FFF08A 0%, #FFCB05 48%, #F0A500 100%);   /* Cornerz yellow */
  --glass: linear-gradient(180deg, rgba(61, 42, 133, .62) 0%, rgba(26, 18, 64, .82) 100%);
  --glass-edge: inset 0 0 0 1.5px rgba(159, 123, 255, .65), inset 0 1px 0 1.5px rgba(255, 255, 255, .08);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  --font-heavy: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Arial Black", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  --cell: 58px;
  --gap: 3px;
  --speed: 1;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: #07041A radial-gradient(90% 70% at 50% 30%, #2A1E66 0%, #120C30 60%, #07041A 100%);
  color: var(--txt);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }

/* the artifact page adds img{max-width:100%}: it squashes the mascot, so undo it inside the game */
#app img { max-width: none; }

#app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100%;
  max-height: 940px;
  margin: 0 auto;
  overflow: hidden;
  overflow: clip;   /* clip: hidden still lets focus/scrollIntoView scroll the frame sideways */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: env(safe-area-inset-top) 12px calc(env(safe-area-inset-bottom) + 6px);
  background: var(--grad-bg);
}
@media (min-width: 500px) {
  body { display: flex; align-items: center; justify-content: center; }
  #app {
    border-radius: 26px; height: min(100%, 932px);
    box-shadow: 0 0 0 1.5px rgba(159, 123, 255, .55), 0 0 0 5px #0D0826, 0 0 0 6.5px rgba(255, 203, 5, .5), 0 0 60px rgba(124, 91, 232, .45), 0 30px 90px rgba(0, 0, 0, .6);
  }
}

/* ---------- background: beams, card silhouettes, neon floor, sparkles ---------- */
.bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bg::before {           /* violet haze at the top and a yellow glow behind the board */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(70% 28% at 50% 0%, rgba(159, 123, 255, .45), transparent 70%),
    radial-gradient(60% 30% at 50% 46%, rgba(255, 203, 5, .10), transparent 70%),
    radial-gradient(50% 30% at 0% 70%, rgba(111, 230, 255, .10), transparent 70%),
    radial-gradient(50% 30% at 100% 62%, rgba(255, 95, 210, .10), transparent 70%);
}
.bg-beams {
  position: absolute; left: 50%; top: -6%; width: 220%; height: 85%; margin-left: -110%;
  background:
    repeating-conic-gradient(from 160deg at 50% 0%, transparent 0deg 6deg, rgba(255, 203, 5, .10) 6.5deg 8deg, transparent 8.5deg 15deg, rgba(159, 123, 255, .16) 15.5deg 18deg, transparent 18.5deg 24deg);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .6) 40%, transparent 80%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .6) 40%, transparent 80%);
  transform-origin: 50% 0;
  animation: sway 9s ease-in-out infinite alternate;
}
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.bg-grid {
  position: absolute; left: -60%; right: -60%; bottom: -4%; height: 40%;
  background-image:
    linear-gradient(rgba(159, 123, 255, .7) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgba(159, 123, 255, .55) 1.5px, transparent 1.5px);
  background-size: 46px 46px;
  transform: perspective(240px) rotateX(64deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, .7) 45%, transparent 95%);
  mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, .7) 45%, transparent 95%);
  animation: gridmove 3.2s linear infinite;
}
@keyframes gridmove { from { background-position: 0 0; } to { background-position: 0 46px; } }
.bg-horizon {
  position: absolute; left: 0; right: 0; bottom: 33%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 203, 5, .7) 30%, #FFE45C 50%, rgba(255, 203, 5, .7) 70%, transparent);
  box-shadow: 0 0 18px 4px rgba(255, 203, 5, .25);
  opacity: .7;
}
.bg-cards i {
  position: absolute; display: block; width: 46px; height: 64px; border-radius: 6px;
  border: 1.5px solid rgba(159, 123, 255, .45);
  background:
    linear-gradient(135deg, transparent 0 40%, rgba(255, 255, 255, .10) 46%, transparent 52%),
    linear-gradient(160deg, rgba(159, 123, 255, .22), rgba(26, 18, 64, .1));
  box-shadow: 0 0 14px rgba(159, 123, 255, .25);
  animation: drift 7s ease-in-out infinite;
}
.bg-cards i::after {     /* small yellow square, a nod to the Cornerz mark */
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 2px; background: rgba(255, 203, 5, .55);
}
.bg-cards i:nth-child(1) { left: -12px; top: 12%; transform: rotate(-18deg); opacity: .7; }
.bg-cards i:nth-child(2) { right: -10px; top: 9%; transform: rotate(16deg); opacity: .6; animation-delay: -2s; }
.bg-cards i:nth-child(3) { left: 4%; top: 60%; transform: rotate(10deg) scale(.8); opacity: .45; animation-delay: -4s; }
.bg-cards i:nth-child(4) { right: 3%; top: 56%; transform: rotate(-12deg) scale(.9); opacity: .5; animation-delay: -1s; }
.bg-cards i:nth-child(5) { left: 44%; top: 1%; transform: rotate(4deg) scale(.6); opacity: .35; animation-delay: -5s; }
@keyframes drift { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.bg-sparkles span {
  position: absolute; display: block; width: 14px; height: 14px;
  background: currentColor;
  clip-path: polygon(50% 0, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0 50%, 44% 44%);
  filter: drop-shadow(0 0 4px currentColor);
  animation: twinkle 2.8s ease-in-out infinite;
  opacity: .85;
}
@keyframes twinkle { 0%, 100% { transform: scale(.4) rotate(45deg); opacity: .25; } 50% { transform: scale(1) rotate(0deg); opacity: 1; } }

/* ---------- top bar ---------- */
.topbar {
  position: relative; z-index: 3;
  width: 100%; height: 50px; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 6px;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--glass); color: var(--y);
  display: grid; place-items: center;
  box-shadow: var(--glass-edge), 0 0 12px rgba(159, 123, 255, .3), 0 4px 10px rgba(0, 0, 0, .35);
  flex: none;
}
.icon-btn svg { width: 22px; height: 22px; filter: drop-shadow(0 0 4px rgba(255, 203, 5, .45)); }
.icon-btn:active { transform: translateY(1px) scale(.96); }
.icon-btn:disabled { opacity: .45; }
/* sound on/off (aria-pressed="true" = sound on) */
.sound-btn .snd-off { display: none; }
.sound-btn[aria-pressed="false"] { color: var(--txt-3); }
.sound-btn[aria-pressed="false"] svg { filter: none; }
.sound-btn[aria-pressed="false"] .snd-on { display: none; }
.sound-btn[aria-pressed="false"] .snd-off { display: inline; }
/* four items in the top bar: keep the + button whole and let long balances (10,000,000) fit on small phones */
.topbar .balance { min-width: 0; }
.topbar .plus-btn { flex: none; }
.topbar .balance-num { min-width: 0; overflow: hidden; }
@media (max-width: 374px) {
  .topbar .icon-btn { width: 34px; height: 34px; }
  .topbar .icon-btn svg { width: 20px; height: 20px; }
  .topbar .balance .coin-ico { width: 22px; height: 22px; }
  .topbar .balance-num { font-size: 15px; }
}
@media (max-width: 340px) {
  .topbar { gap: 6px; }
  .topbar .balance-num { font-size: 13px; }
}
.balance {
  flex: 1; max-width: 230px; height: 38px;
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, rgba(13, 8, 38, .85), rgba(36, 26, 85, .85));
  border-radius: 10px; padding: 0 4px 0 6px;
  box-shadow: inset 0 0 0 1.5px rgba(255, 203, 5, .75), 0 0 14px rgba(255, 203, 5, .22), 0 4px 10px rgba(0, 0, 0, .35);
}
.coin-ico { width: 26px; height: 26px; flex: none; vertical-align: middle; }
.coin-ico.sm { width: 18px; height: 18px; }
.coin-ico.lg { width: 40px; height: 40px; }
.balance-num {
  flex: 1; text-align: right; font-family: var(--font-heavy); font-weight: 900; font-size: 17px;
  color: #fff; letter-spacing: .03em; font-variant-numeric: tabular-nums; white-space: nowrap;
  text-shadow: 0 0 8px rgba(255, 203, 5, .35);
}
.plus-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--grad-cta); color: var(--p1); display: grid; place-items: center;
  box-shadow: inset 0 -2px 0 rgba(120, 70, 0, .35), 0 0 8px rgba(255, 203, 5, .5);
}
.plus-btn svg { width: 18px; height: 18px; }

/* ---------- headings (data-text copy = dark outline + neon glow) ---------- */
.outline-h { position: relative; display: inline-block; }
.outline-h::before {
  content: attr(data-text);
  position: absolute; left: 0; top: 0; z-index: -1;
  -webkit-text-stroke: 6px var(--ink);
  color: var(--ink);
  text-shadow: 0 0 18px rgba(255, 203, 5, .55), 0 3px 0 var(--ink);
}

/* ---------- logo ---------- */
.logo {
  position: relative; z-index: 2; flex: none;
  margin-top: 2px; height: 50px;
  font-family: var(--font-heavy); font-weight: 900; font-style: italic;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.logo-mark {
  position: relative; width: 30px; height: 30px; flex: none; border-radius: 7px; background: #fff;
  box-shadow: 0 0 0 2px var(--ink), 0 0 14px rgba(255, 255, 255, .45); transform: skewX(-8deg);
}
.logo-mark::before {   /* black C */
  content: ""; position: absolute; left: 6px; top: 6px; width: 13px; height: 18px;
  border: 4.5px solid #111; border-right: 0; border-radius: 6px 0 0 6px;
}
.logo-mark::after {    /* yellow square */
  content: ""; position: absolute; right: 4px; bottom: 5px; width: 8px; height: 8px; border-radius: 2px;
  background: var(--y); box-shadow: 0 0 0 1px #111;
}
.logo-main {
  font-size: 29px; color: #fff; letter-spacing: .04em;
  text-shadow: 0 0 2px #fff, 0 0 10px rgba(159, 123, 255, .95), 0 0 22px rgba(124, 91, 232, .8), 0 3px 0 var(--ink);
}
.logo-rush {
  position: relative; font-size: 24px; letter-spacing: .08em; color: var(--p1);
  padding: 2px 10px 2px 8px; line-height: 1.1;
  background: var(--grad-cta); border-radius: 4px; transform: skewX(-12deg);
  box-shadow: 0 0 0 2px var(--ink), 0 0 16px rgba(255, 203, 5, .75), 0 0 32px rgba(255, 203, 5, .35);
}

/* ---------- win bar ---------- */
.winbar {
  position: relative; z-index: 2; flex: none;
  width: calc(var(--cell) * 6 + var(--gap) * 5 + 20px); max-width: 100%;
  height: 40px; margin-top: 4px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(13, 8, 38, .9), rgba(36, 26, 85, .9) 50%, rgba(13, 8, 38, .9));
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1.5px rgba(255, 203, 5, .55), 0 0 14px rgba(255, 203, 5, .18);
  overflow: hidden;
}
.winbar::before, .winbar::after {    /* chevrons at both ends */
  content: ""; position: absolute; top: 50%; width: 10px; height: 10px; margin-top: -5px;
  border: solid var(--y); border-width: 0 2.5px 2.5px 0; opacity: .8;
}
.winbar::before { left: 12px; transform: rotate(-45deg); }
.winbar::after { right: 12px; transform: rotate(135deg); }
.win-text {
  font-family: var(--font-heavy); font-weight: 900; font-size: 18px; color: #fff;
  white-space: nowrap; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(255, 203, 5, .5);
}
.win-text.idle { font-size: min(14px, 3.4vw); color: var(--txt-2); font-weight: 800; text-shadow: none; }
.win-text.hot {
  background: linear-gradient(180deg, #FFF6B8 10%, #FFCB05 60%, #FFA500); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-size: 21px; text-shadow: none; filter: drop-shadow(0 0 6px rgba(255, 203, 5, .6));
}
.win-text.mult { color: var(--cyan); font-size: 21px; text-shadow: 0 0 10px rgba(111, 230, 255, .8); }
.winbar.flash { animation: barflash .5s ease-out; }
@keyframes barflash {
  0% { box-shadow: inset 0 0 0 1.5px #FFE45C, 0 0 0 0 rgba(255, 203, 5, .9), 0 0 24px rgba(255, 203, 5, .6); }
  100% { box-shadow: inset 0 0 0 1.5px rgba(255, 203, 5, .55), 0 0 0 12px rgba(255, 203, 5, 0), 0 0 14px rgba(255, 203, 5, .18); }
}

/* ---------- board: dark glass case with neon edge and lit card slots ---------- */
.board-wrap {
  position: relative; z-index: 2; flex: none;
  margin-top: 8px;
  padding: 10px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(61, 42, 133, .55), rgba(13, 8, 38, .92) 60%),
    var(--night);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 203, 5, .85),
    inset 0 0 18px rgba(159, 123, 255, .35),
    0 0 0 3px var(--ink),
    0 0 0 4.5px rgba(159, 123, 255, .85),
    0 0 26px rgba(159, 123, 255, .55),
    0 12px 30px rgba(0, 0, 0, .5);
}
.board-wrap::before {      /* one lit slot per cell (cell-sized tiles, gaps masked out) */
  content: ""; position: absolute; inset: 10px; border-radius: 6px; pointer-events: none;
  background:
    radial-gradient(circle at 50% 28%, rgba(159, 123, 255, .38), rgba(61, 42, 133, .28) 55%, rgba(26, 18, 64, .35) 100%)
    0 0 / calc(var(--cell) + var(--gap)) calc(var(--cell) + var(--gap));
  -webkit-mask:
    linear-gradient(90deg, #000 var(--cell), transparent 0) 0 0 / calc(var(--cell) + var(--gap)) 100%,
    linear-gradient(180deg, #000 var(--cell), transparent 0) 0 0 / 100% calc(var(--cell) + var(--gap));
  -webkit-mask-composite: source-in;
  mask:
    linear-gradient(90deg, #000 var(--cell), transparent 0) 0 0 / calc(var(--cell) + var(--gap)) 100%,
    linear-gradient(180deg, #000 var(--cell), transparent 0) 0 0 / 100% calc(var(--cell) + var(--gap));
  mask-composite: intersect;
}
.board-wrap::after {       /* yellow corner brackets */
  content: ""; position: absolute; inset: -7px; pointer-events: none; border-radius: 18px;
  --b: linear-gradient(var(--y), var(--y));
  background:
    var(--b) 0 0 / 18px 3px no-repeat, var(--b) 0 0 / 3px 18px no-repeat,
    var(--b) 100% 0 / 18px 3px no-repeat, var(--b) 100% 0 / 3px 18px no-repeat,
    var(--b) 0 100% / 18px 3px no-repeat, var(--b) 0 100% / 3px 18px no-repeat,
    var(--b) 100% 100% / 18px 3px no-repeat, var(--b) 100% 100% / 3px 18px no-repeat;
  filter: drop-shadow(0 0 4px rgba(255, 203, 5, .8));
}
.board {
  position: relative;
  width: calc(var(--cell) * 6 + var(--gap) * 5);
  height: calc(var(--cell) * 5 + var(--gap) * 4);
  overflow: hidden;
  border-radius: 6px;
}
.cell {
  position: absolute; left: 0; top: 0;
  width: var(--cell); height: var(--cell);
  will-change: transform;
}
.cell img { width: 100%; height: 100%; display: block; pointer-events: none; padding: 2px; }
.cell.win img { animation: winpulse calc(.42s / var(--speed)) ease-in-out infinite alternate; filter: drop-shadow(0 0 5px #fff) drop-shadow(0 0 10px var(--y)); }
@keyframes winpulse { from { transform: scale(1) rotate(0deg); } to { transform: scale(1.12) rotate(-3deg); } }
.cell.dim img { opacity: .5; filter: saturate(.7) brightness(.75); transition: opacity .2s; }
.cell.bub img { padding: 0; }
.cell.bub .mult {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-heavy); font-weight: 900; font-style: italic;
  font-size: calc(var(--cell) * .32); color: #fff; letter-spacing: -.03em;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
  text-shadow: 0 0 6px rgba(255, 255, 255, .5);
}
.cell.bub.big .mult { font-size: calc(var(--cell) * .28); }
.cell.bub.glow img { filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 14px var(--y)); }

.fx { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 3; }
.spark {
  position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  background: var(--y);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.ring {
  position: absolute; left: 0; top: 0; border-radius: 10px;
  border: 2.5px solid var(--y); box-shadow: 0 0 12px var(--y), inset 0 0 8px rgba(255, 203, 5, .6);
}
.pay-float {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); z-index: 2;
  font-family: var(--font-heavy); font-weight: 900; font-style: italic; font-size: 23px; color: var(--y-l); white-space: nowrap;
  -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill;
  filter: drop-shadow(0 0 6px rgba(255, 203, 5, .7));
}

/* ---------- score bar ---------- */
.scorebar {
  position: relative; z-index: 2; flex: none;
  z-index: 3;
  width: calc(var(--cell) * 6 + var(--gap) * 5 - 28px); max-width: calc(100% - 40px);
  height: 52px; margin-top: -1px;
  border-radius: 0 0 18px 18px;
  background:
    repeating-linear-gradient(115deg, rgba(159, 123, 255, .10) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #0D0826 0%, #241A55 100%);
  box-shadow: inset 1.5px 0 0 rgba(159, 123, 255, .8), inset -1.5px 0 0 rgba(159, 123, 255, .8), inset 0 -2px 0 var(--y),
    0 3px 0 0 var(--ink), 0 0 20px rgba(255, 203, 5, .22), 0 12px 22px rgba(0, 0, 0, .45);
  display: flex; align-items: center; gap: 8px; padding: 0 16px 2px;
  color: #fff;
}
.score-lbl {
  font-family: var(--font-heavy); font-weight: 900; font-size: 13px; color: var(--p1);
  background: var(--grad-cta); border-radius: 4px; padding: 4px 10px; flex: none;
  transform: skewX(-10deg); box-shadow: 0 0 10px rgba(255, 203, 5, .45);
}
.score-num {
  flex: 1; min-width: 0; text-align: right; white-space: nowrap; font-family: var(--font-heavy); font-weight: 900; font-size: 30px;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
  background: linear-gradient(180deg, #fff 30%, #FFE45C 75%, #FFB800 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 6px rgba(255, 203, 5, .45));
}
.score-unit { flex: none; white-space: nowrap; font-weight: 800; font-size: 13px; color: var(--txt-2); }
/* long scores (set by setScore): 5,000,000 = 9 chars, 10,000,000 = 10 */
.score-num[data-len="9"] { font-size: 25px; }
.score-num[data-len="10"] { font-size: 22px; }
@media (max-width: 374px) {
  .score-num[data-len="9"] { font-size: 22px; }
  .score-num[data-len="10"] { font-size: 19px; }
}
.scorebar.bump { animation: bump .35s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* ---------- stage: character + controls ---------- */
.stage {
  position: relative; z-index: 2;
  width: 100%; flex: 1; min-height: 150px;
  display: flex; flex-direction: row-reverse; align-items: stretch;
  margin-top: 8px;
}
.chara {
  position: relative; width: 36%; flex: none;
  pointer-events: none;
}
.chara::before {       /* spotlight disc under the mascot */
  content: ""; position: absolute; left: -20px; right: -30px; bottom: -14px; height: 40px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 203, 5, .45), rgba(159, 123, 255, .25) 60%, transparent);
}
.chara img {
  position: absolute; right: -50px; bottom: -8px;
  height: calc(100% + 30px); max-height: 330px; width: auto;
  transform-origin: 50% 100%;
  animation: idle 3.4s ease-in-out infinite;
  filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, .9)) drop-shadow(0 0 12px rgba(159, 123, 255, .6));
}
@keyframes idle { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-4px) rotate(-1deg); } }
.chara.happy img { animation: hop .5s ease-out 2; }
.chara.wow img { animation: wow .6s ease-out 3; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-14px) rotate(2deg); } }
@keyframes wow { 0%, 100% { transform: translateY(0) scale(1); } 35% { transform: translateY(-20px) scale(1.05) rotate(-3deg); } 70% { transform: translateY(-6px) scale(1.02) rotate(2deg); } }
.say {
  position: absolute; z-index: 4;
  background: var(--y); color: var(--p1);
  font-weight: 900; font-size: 14px; white-space: nowrap;
  padding: 7px 12px; border-radius: 10px 10px 10px 3px;
  box-shadow: 0 0 0 2px var(--ink), 0 0 16px rgba(255, 203, 5, .55);
  animation: pop .3s cubic-bezier(.3, 1.6, .5, 1);
}
.chara .say { right: 2px; top: -6px; font-size: 13px; padding: 6px 10px; border-radius: 10px 10px 3px 10px; }
.chara .say::after { left: auto; right: 14px; border-left-width: 7px; border-right-width: 2px; }
.say::after {
  content: ""; position: absolute; left: 14px; bottom: -7px;
  border: 7px solid transparent; border-top-color: var(--y); border-bottom: 0; border-left-width: 2px;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.controls {
  position: relative; z-index: 3;
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 10px;
  padding: 22px 0 6px;
}
.capsule-deco {
  position: absolute; left: 4px; bottom: 30px; width: 56px; height: 56px; z-index: 1; pointer-events: none;
  animation: float 3.6s ease-in-out infinite; opacity: .95;
}
.price-pill {
  align-self: flex-start; white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
  background: rgba(13, 8, 38, .78); border-radius: 8px; padding: 4px 12px 4px 4px;
  font-weight: 800; font-size: 12px; color: var(--txt-2);
  box-shadow: inset 0 0 0 1.5px rgba(159, 123, 255, .65), 0 0 10px rgba(159, 123, 255, .3);
}
.pp-lbl { white-space: nowrap; background: var(--vio-d); color: #fff; border-radius: 5px; padding: 2px 8px; font-size: 11px; margin-right: 2px; }
.price-pill b { font-family: var(--font-heavy); font-weight: 900; font-size: 16px; color: var(--y); text-shadow: 0 0 6px rgba(255, 203, 5, .4); }

.btn-main, .btn-sub {
  position: relative; min-height: 54px; border-radius: 14px; overflow: hidden;
  font-family: var(--font-heavy); font-weight: 900; font-size: 17px; letter-spacing: .03em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15;
  transition: transform .08s, filter .2s;
}
.btn-main {
  color: var(--p1); background: var(--grad-cta);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55), 0 0 0 2px var(--ink), 0 4px 0 2px #8A5A00, 0 0 22px rgba(255, 203, 5, .45);
}
.btn-main::after {       /* moving shine */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent);
  transform: skewX(-20deg); pointer-events: none;
  animation: shine 3s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.btn-main:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55), 0 0 0 2px var(--ink), 0 1px 0 2px #8A5A00, 0 0 14px rgba(255, 203, 5, .4); }
.btn-main:disabled { filter: grayscale(.6) brightness(.8); opacity: .8; }
.btn-main:disabled::after { animation: none; display: none; }
.btn-main small { font-size: 11px; font-weight: 800; opacity: .9; }
.btn-main.pulse { animation: cta 1.6s ease-in-out infinite; }
@keyframes cta { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
.btn-sub {
  color: #fff; background: var(--glass);
  box-shadow: var(--glass-edge), 0 0 0 2px var(--ink), 0 4px 0 2px #120C30, 0 0 14px rgba(159, 123, 255, .35);
}
.btn-sub:active:not(:disabled) { transform: translateY(3px); }
.btn-sub:disabled { opacity: .55; }
.btn-main.wide { width: 100%; }
#btnPlay { white-space: nowrap; font-size: 16px; padding: 0 8px; }

.spin-status {
  height: 54px; border-radius: 14px;
  background: rgba(13, 8, 38, .85);
  display: flex; align-items: baseline; justify-content: center; gap: 6px; padding-top: 12px;
  font-weight: 800; color: var(--txt-2); font-size: 14px;
  box-shadow: inset 0 0 0 1.5px rgba(255, 203, 5, .7), 0 0 16px rgba(255, 203, 5, .25);
}
.spin-status b { font-family: var(--font-heavy); font-weight: 900; font-size: 30px; color: var(--y); line-height: 1; text-shadow: 0 0 10px rgba(255, 203, 5, .6); }
.sub-row { display: flex; gap: 8px; justify-content: center; }
.chip {
  flex: 1; height: 36px; border-radius: 9px; background: rgba(26, 18, 64, .96);
  color: var(--txt-2); font-weight: 800; font-size: 12px; white-space: nowrap;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  box-shadow: inset 0 0 0 1.5px rgba(159, 123, 255, .55);
}
.chip svg { width: 15px; height: 15px; }
.chip[aria-pressed="true"] { background: var(--grad-cta); color: var(--p1); box-shadow: 0 0 0 1.5px var(--ink), 0 0 12px rgba(255, 203, 5, .5); }
.chip:disabled { color: rgba(220, 212, 250, .4); background: rgba(18, 12, 48, .96); box-shadow: inset 0 0 0 1.5px rgba(159, 123, 255, .28); }
.chip-skip:not(:disabled) { color: var(--y); box-shadow: inset 0 0 0 1.5px var(--y), 0 0 12px rgba(255, 203, 5, .35); }

/* ---------- overlays + sheets (dark glass, yellow headings) ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(7, 4, 26, .72);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: fade .2s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: relative; width: 100%; max-height: 100%; overflow: auto;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 203, 5, .10), transparent 90px),
    linear-gradient(180deg, #2A1E66 0%, #1A1240 45%, #120C30 100%);
  border-radius: 18px; padding: 18px 16px 18px;
  box-shadow: inset 0 0 0 1.5px rgba(159, 123, 255, .75), inset 0 3px 0 0 var(--y), 0 0 0 2px var(--ink), 0 0 34px rgba(159, 123, 255, .4), 0 20px 50px rgba(0, 0, 0, .55);
  animation: rise .28s cubic-bezier(.25, 1.4, .5, 1);
}
.sheet.small { max-width: 340px; text-align: center; }
@keyframes rise { from { transform: translateY(24px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-title { margin: 4px 0 10px; font-family: var(--font-heavy); font-weight: 900; font-size: 20px; color: var(--y); text-align: center; letter-spacing: .04em; text-shadow: 0 0 12px rgba(255, 203, 5, .45); }
.sheet-title small { font-size: 12px; color: var(--txt-2); font-weight: 800; margin-left: 4px; text-shadow: none; }
.confirm-text { font-size: 16px; font-weight: 800; margin: 6px 0; color: #fff; }
.confirm-text b { font-family: var(--font-heavy); font-weight: 900; font-size: 21px; color: var(--y); }
.confirm-sub { font-size: 13px; color: var(--txt-2); margin: 6px 0 10px; line-height: 1.6; word-break: keep-all; line-break: strict; overflow-wrap: anywhere; text-wrap: balance; }
.confirm-sub b { color: var(--y); }
.confirm-after { font-size: 12px; color: var(--txt-3); margin: 0 0 14px; }
.confirm-after b { color: #fff; }
.btn-row { display: flex; gap: 12px; }
.btn-row > * { flex: 1; }

.ribbon-pill {
  display: inline-block; background: var(--grad-cta); color: var(--p1);
  font-weight: 900; font-size: 12px; padding: 4px 14px; border-radius: 4px;
  box-shadow: 0 0 0 2px var(--ink), 0 0 12px rgba(255, 203, 5, .5);
  transform: skewX(-12deg);
}
.outline-h {
  font-family: var(--font-heavy); font-weight: 900; color: #fff; margin: 0;
  isolation: isolate; letter-spacing: .03em;
}
.outline-h.big { font-size: 40px; }

/* notice: header band (logo strip + left-aligned title, mascot peeking in from the right) + STEP tiles */
.notice-sheet { max-width: 380px; padding: 0 14px 0; }
/* the close button stays visible at the bottom of the scrolling sheet */
.notice-sheet #noticeClose { position: sticky; bottom: 0; z-index: 3; margin-bottom: 14px; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55), 0 0 0 2px var(--ink), 0 4px 0 2px #8A5A00, 0 -14px 16px 10px #120C30; }
.notice-head {
  position: relative; overflow: hidden;
  margin: 0 -14px 12px; padding: 16px 128px 14px 16px; min-height: 118px;
  display: flex; align-items: flex-end;
  background:
    linear-gradient(112deg, transparent 0 58%, rgba(255, 203, 5, .85) 58% 59.5%, transparent 59.5% 63%, rgba(255, 203, 5, .4) 63% 64%, transparent 64%),
    repeating-linear-gradient(112deg, rgba(255, 255, 255, .04) 0 2px, transparent 2px 10px),
    linear-gradient(112deg, #3D2A85 0%, #2A1E66 55%, #4A2FB0 100%);
  box-shadow: inset 0 -2px 0 var(--y), 0 6px 16px rgba(0, 0, 0, .35);
}
.notice-head::after {      /* glow behind the mascot */
  content: ""; position: absolute; right: -10px; bottom: -40px; width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 203, 5, .45), rgba(159, 123, 255, .2) 60%, transparent);
}
.idol-frame {
  position: absolute; z-index: 1; right: -4px; bottom: 0; width: 132px; height: 128px;
  overflow: hidden; background: none;
}
.idol-frame img {
  width: 100%; height: auto; display: block; margin-top: 4px;
  filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, .9)) drop-shadow(0 0 10px rgba(159, 123, 255, .7));
}
.notice-title { position: relative; z-index: 2; }
.notice-title::before {    /* logo strip */
  content: "CORNERZ RUSH"; display: block; margin-bottom: 6px;
  font-family: var(--font-heavy); font-weight: 900; font-style: italic; font-size: 11px; letter-spacing: .22em; color: rgba(255, 255, 255, .6);
}
.notice-head .ribbon-pill {
  transform: none; background: none; box-shadow: none; padding: 0 0 0 10px; border-radius: 0;
  color: var(--y); font-size: 12px; letter-spacing: .08em; border-left: 3px solid var(--y);
}
.notice-title h2 {
  display: block; font-size: 36px; margin-top: 4px; color: #fff; font-style: italic; letter-spacing: .06em;
  text-shadow: 0 0 10px rgba(159, 123, 255, .9), 0 0 22px rgba(124, 91, 232, .6);
}
.notice-title h2::before { text-shadow: 0 3px 0 var(--ink); }
.notice-title h2::after {  /* yellow slash under the title */
  content: ""; position: absolute; left: 2px; right: -10px; bottom: -4px; height: 5px;
  background: var(--grad-cta); transform: skewX(-24deg); border-radius: 1px; box-shadow: 0 0 10px rgba(255, 203, 5, .6);
}
.rules { margin: 0 0 10px; padding: 0; list-style: none; counter-reset: r; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rules li {
  position: relative; counter-increment: r; padding: 28px 10px 10px; font-size: 12px; line-height: 1.55; color: var(--txt-2);
  border-radius: 4px 12px 4px 12px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .06), transparent 40%),
    linear-gradient(180deg, rgba(61, 42, 133, .5), rgba(13, 8, 38, .6));
  box-shadow: inset 0 0 0 1px rgba(159, 123, 255, .42);
}
.rules li:last-child { grid-column: 1 / -1; }
.rules li::before {
  content: "STEP " counter(r); position: absolute; left: 0; top: 0; height: 20px; padding: 0 10px 0 9px;
  border-radius: 4px 0 10px 0;
  background: var(--grad-cta); color: var(--p1);
  font-family: var(--font-heavy); font-weight: 900; font-style: italic; font-size: 10.5px; letter-spacing: .08em; line-height: 20px;
}
.rules li::after {         /* small Cornerz-yellow square in the tile corner */
  content: ""; position: absolute; right: 8px; top: 8px; width: 6px; height: 6px; border-radius: 1.5px;
  background: var(--y); opacity: .7; box-shadow: 0 0 6px rgba(255, 203, 5, .7);
}
.rules b { color: var(--y); }
.notice-links { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 2px 14px; font-size: 12px; font-weight: 800; }
.notice-links a, .link-btn { color: var(--vio-l); text-decoration: underline; text-underline-offset: 3px; }
@media (max-height: 700px) {
  .notice-head { min-height: 96px; padding-top: 12px; padding-bottom: 12px; }
  .idol-frame { width: 108px; height: 104px; }
  .notice-sheet .notice-title h2 { font-size: 28px; }
  .notice-sheet .rules { gap: 6px; }
  .notice-sheet .rules li { font-size: 11.5px; line-height: 1.45; padding: 25px 8px 8px; }
}
@media (max-width: 340px) {
  .rules { grid-template-columns: 1fr; }
}

/* result */
.result-ov { background: radial-gradient(circle at 50% 45%, rgba(255, 203, 5, .28), rgba(61, 42, 133, .55) 40%, rgba(7, 4, 26, .85) 75%); }
.result-sheet { max-width: 340px; text-align: center; padding: 22px 18px 20px; overflow: visible; }
.result-burst {
  position: absolute; left: 50%; top: -62px; width: 120px; height: 120px; margin-left: -60px;
  background: url("../assets/img/capsule.png") center / contain no-repeat;
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-6px) rotate(5deg); } }
.result-sheet .ribbon-pill { margin-top: 40px; }
.result-sheet h2 { display: block; margin: 8px auto 4px; width: max-content; }
.result-score {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 4px;
  font-family: var(--font-heavy); font-weight: 900; font-size: 40px; color: var(--y); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(255, 203, 5, .5);
}
.result-score small { font-size: 16px; color: var(--txt-2); white-space: nowrap; align-self: flex-end; margin-bottom: 8px; text-shadow: none; }
.result-score { white-space: nowrap; max-width: 100%; }
/* long scores (set by showResult) shrink so icon, number and unit stay in the sheet */
.result-score[data-len="9"] { font-size: min(34px, 8.6vw); }
.result-score[data-len="10"] { font-size: min(30px, 7.6vw); }
.result-score[data-len="9"] .coin-ico.lg, .result-score[data-len="10"] .coin-ico.lg { width: 32px; height: 32px; }
.result-score[data-len="9"] small, .result-score[data-len="10"] small { font-size: 14px; margin-bottom: 5px; }
.result-msg { font-size: 14px; color: var(--txt-2); font-weight: 800; margin: 4px 0 16px; line-height: 1.6; }

/* card reveal */
.reveal-ov { background: radial-gradient(circle at 50% 42%, #4A2FB0 0%, #241A55 45%, #0A061F 100%); flex-direction: column; overflow: hidden; }
.reveal-ov.rainbow { background: radial-gradient(circle at 50% 42%, rgba(255, 203, 5, .55) 0%, #4A2FB0 32%, #241A55 60%, #0A061F 100%); }
.reveal-ov::before {      /* neon floor under the card */
  content: ""; position: absolute; left: -50%; right: -50%; bottom: -6%; height: 34%; pointer-events: none;
  background-image: linear-gradient(rgba(255, 203, 5, .5) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(159, 123, 255, .5) 1.5px, transparent 1.5px);
  background-size: 40px 40px; transform: perspective(220px) rotateX(62deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(0deg, #000, transparent 90%); mask-image: linear-gradient(0deg, #000, transparent 90%);
}
.rays {
  position: absolute; left: 50%; top: 42%; width: 180vmax; height: 180vmax; margin: -90vmax 0 0 -90vmax;
  background: repeating-conic-gradient(from 0deg, rgba(159, 123, 255, .22) 0deg 5deg, transparent 5deg 15deg, rgba(255, 203, 5, .10) 15deg 18deg, transparent 18deg 30deg);
  -webkit-mask-image: radial-gradient(circle, #000 8%, transparent 40%); mask-image: radial-gradient(circle, #000 8%, transparent 40%);
  animation: spin 18s linear infinite; pointer-events: none;
}
.reveal-ov.rainbow .rays { background: repeating-conic-gradient(from 0deg, rgba(255, 203, 5, .38) 0deg 6deg, rgba(111, 230, 255, .16) 6deg 10deg, transparent 10deg 15deg, rgba(255, 95, 210, .2) 15deg 18deg, transparent 18deg 24deg); animation-duration: 9s; }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.reveal-inner { position: relative; z-index: 2; width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; }
.reveal-head { height: 54px; display: grid; place-items: center; }
.reveal-head .outline-h { font-size: 42px; font-style: italic; color: var(--y); letter-spacing: .06em; }
.flip { width: 200px; height: 280px; perspective: 1000px; margin: 6px 0 12px; }
.flip-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3, 1.3, .5, 1); }
.flip.open .flip-inner { transform: rotateY(180deg); }
.flip.shake { animation: shake .5s ease-in-out 2; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg) scale(1.02); } 75% { transform: rotate(4deg) scale(1.02); } }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px rgba(255, 203, 5, .85), 0 0 34px rgba(255, 203, 5, .45), 0 16px 34px rgba(0, 0, 0, .55); }
.face img { width: 100%; height: 100%; display: block; object-fit: cover; }
.face.front { transform: rotateY(180deg); background: var(--ink); }
.front .foil {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, .85) 42%, rgba(111, 230, 255, .6) 48%, rgba(255, 203, 5, .6) 54%, transparent 72%);
  background-size: 250% 100%; animation: foil 2.4s ease-in-out infinite;
}
@keyframes foil { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

/* PT exchange card */
.coin-card {
  position: absolute; inset: 0; border-radius: 14px; overflow: hidden;
  background: linear-gradient(165deg, #3D2A85 0%, #241A55 50%, #120C30 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 16px 12px 16px;
  box-shadow: inset 0 0 0 4px var(--y), inset 0 0 0 6px var(--ink), inset 0 0 0 7.5px rgba(159, 123, 255, .8);
  text-align: center;
}
.coin-card::before {
  content: ""; position: absolute; inset: 0; opacity: .6;
  background: repeating-conic-gradient(from 0deg at 50% 46%, rgba(255, 203, 5, .22) 0deg 5deg, transparent 5deg 15deg);
}
.coin-card > * { position: relative; }
.cc-title {
  margin-top: 6px; font-family: var(--font-heavy); font-weight: 900; font-size: 14px; color: var(--p1); letter-spacing: .02em; white-space: nowrap;
  background: var(--grad-cta); border-radius: 4px; padding: 4px 12px;
  box-shadow: 0 0 0 2px var(--ink), 0 0 12px rgba(255, 203, 5, .5);
}
.face .coin-card .cc-coin { width: 96px; height: 96px; flex: none; filter: drop-shadow(0 0 12px rgba(255, 203, 5, .6)); animation: coinspin 2.6s ease-in-out infinite; }
@keyframes coinspin { 0%, 100% { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(25deg) translateY(-4px); } }
.cc-amt { white-space: nowrap; font-family: var(--font-heavy); font-weight: 900; font-size: 24px; color: var(--y); line-height: 1.1; font-variant-numeric: tabular-nums; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.cc-amt small { font-size: 14px; color: #fff; }
/* 7+ digit amounts: smaller number, PT on its own line (set by reveal) */
.cc-amt[data-len="9"] { font-size: 22px; }
.cc-amt[data-len="10"] { font-size: 21px; }
.cc-amt[data-len="9"] small, .cc-amt[data-len="10"] small { display: block; font-size: 13px; line-height: 1.2; }
.cc-note { font-size: 9.5px; color: var(--txt-2); font-weight: 800; line-height: 1.4; margin-bottom: 2px; }

.prize-info {
  text-align: center; min-height: 52px; background: rgba(13, 8, 38, .88); border-radius: 12px; padding: 8px 16px 9px;
  box-shadow: inset 0 0 0 1.5px rgba(159, 123, 255, .7), 0 0 18px rgba(159, 123, 255, .35), 0 8px 18px rgba(0, 0, 0, .4); max-width: 330px;
}
.prize-name { font-weight: 800; font-size: 14px; color: #fff; }
.prize-val { margin-top: 3px; font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 203, 5, .12); color: var(--txt-2); border-radius: 6px; padding: 3px 12px 3px 6px; box-shadow: inset 0 0 0 1px rgba(255, 203, 5, .45); }
.prize-val b { font-family: var(--font-heavy); font-weight: 900; font-size: 17px; color: var(--y); }
.reveal-btns { width: 100%; margin-top: 14px; }
.reveal-btns .btn-sub, .reveal-btns .btn-main { font-size: 15px; }
.reveal-note { background: rgba(13, 8, 38, .78); border-radius: 10px; padding: 6px 10px; color: var(--txt-2); font-size: 11px; font-weight: 800; text-align: center; margin: 12px 4px 0; line-height: 1.5; min-height: 16px; box-shadow: inset 0 0 0 1px rgba(159, 123, 255, .35); }
.reveal-girl {
  position: absolute; z-index: 3; right: -22px; top: 0; height: 25%; max-height: 230px;   /* bust image: keep her face clear of the card */
  -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent);
  animation: slidein .7s cubic-bezier(.3, 1.4, .5, 1); filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 18px rgba(159, 123, 255, .7)); opacity: .96;
}
@keyframes slidein { from { transform: translateX(60%) rotate(8deg); opacity: 0; } to { transform: none; opacity: .96; } }
.reveal-say { right: 33%; top: 3%; z-index: 4; border-radius: 10px 10px 3px 10px; }
.reveal-say::after { left: auto; right: 14px; border-left-width: 7px; border-right-width: 2px; }

/* lineup */
.lineup-sheet { max-width: 400px; max-height: 92%; padding: 18px 14px 16px; }
.x-btn { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 9px; background: rgba(13, 8, 38, .8); color: var(--y); font-size: 20px; font-weight: 800; line-height: 32px; box-shadow: inset 0 0 0 1.5px rgba(159, 123, 255, .65); }
.tier { border-radius: 12px; background: rgba(13, 8, 38, .55); box-shadow: inset 0 0 0 1.5px rgba(159, 123, 255, .35); padding: 10px; margin-bottom: 10px; }
.tier-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tier-name { font-family: var(--font-heavy); font-weight: 900; font-size: 15px; color: #fff; padding: 3px 12px; border-radius: 5px; background: var(--vio-d); }
.tier.t0 { box-shadow: inset 0 0 0 1.5px rgba(255, 203, 5, .75), 0 0 14px rgba(255, 203, 5, .18); }
.tier.t0 .tier-name { background: var(--grad-cta); color: var(--p1); }
.tier.zero .tier-name { background: #4A4270; color: var(--txt-2); }
.tier-min { font-size: 12px; font-weight: 800; color: var(--txt-2); }
.tier-prob { margin-left: auto; font-family: var(--font-heavy); font-weight: 900; font-size: 14px; color: var(--y); }
.tier-prizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.tp { text-align: center; min-width: 0; }
.tp img { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 1px rgba(159, 123, 255, .5), 0 2px 6px rgba(0, 0, 0, .4); background: #241A55; }
.tp span { display: block; font-size: 10px; font-weight: 800; color: #fff; margin-top: 3px; white-space: nowrap; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; }
.tier-empty { font-size: 12px; color: var(--txt-3); margin: 6px 0 0; }
.lineup-note { font-size: 11px; color: var(--txt-3); line-height: 1.6; margin: 4px 2px 0; }

/* big win: girl off to the right, title on a diagonal slash banner */
.bigwin {
  position: absolute; inset: 0; z-index: 15; display: flex; align-items: flex-start; justify-content: flex-start;
  background: radial-gradient(circle at 70% 52%, rgba(255, 203, 5, .30), rgba(61, 42, 133, .8) 40%, rgba(7, 4, 26, .94) 75%);
  animation: fade .2s ease-out; overflow: hidden;
}
.bigwin-rays {
  position: absolute; left: 72%; top: 55%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax;
  background: repeating-conic-gradient(rgba(255, 203, 5, .22) 0deg 4deg, transparent 4deg 12deg, rgba(159, 123, 255, .22) 12deg 16deg, transparent 16deg 24deg);
  animation: spin 10s linear infinite;
}
.bigwin-girl { position: absolute; bottom: -24px; right: -26%; height: 56%; animation: slidein .55s cubic-bezier(.3, 1.4, .5, 1); filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 20px rgba(255, 203, 5, .55)); }
.bigwin-text {
  position: relative; z-index: 2; width: 100%; margin-top: 24%; padding: 18px 0 0 20px; text-align: left;
  rotate: -8deg; animation: slash .45s cubic-bezier(.3, 1.5, .5, 1);
}
.bigwin-text::before, .bigwin-text::after {    /* slash banner: dark shadow strip + yellow strip */
  content: ""; position: absolute; z-index: -1; left: -14%; right: -14%; top: 8px; height: 76px;
  clip-path: polygon(0 18%, 100% 0, 100% 82%, 0 100%);
}
.bigwin-text::before { background: var(--ink); transform: translate(6px, 8px); }
.bigwin-text::after { background: linear-gradient(90deg, #FFE45C, #FFCB05 50%, #F0A500); }
.bigwin-text .outline-h { font-size: 46px; white-space: nowrap; font-style: italic; color: #fff; display: inline-block; letter-spacing: .04em; }
/* own line under the title, so the title can stay inline-block (its outline copy is placed at left:0 of its own box) */
.bigwin-text b {
  display: block; width: max-content; margin: 26px 0 0 6px; padding: 4px 16px 4px 12px;
  font-family: var(--font-heavy); font-weight: 900; font-style: italic; font-size: 30px; color: var(--y);
  background: rgba(13, 8, 38, .88); border-radius: 2px 12px 2px 12px; border-left: 4px solid var(--y);
  box-shadow: inset 0 0 0 1.5px rgba(159, 123, 255, .8), 0 0 18px rgba(159, 123, 255, .45);
  text-shadow: 0 0 10px rgba(255, 203, 5, .5);
}
@keyframes slash { from { transform: translateX(-110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes zoom { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 374px) { .bigwin-text .outline-h { font-size: 40px; } .bigwin-text b { font-size: 26px; } }

.confetti { position: absolute; top: -20px; width: 8px; height: 13px; border-radius: 1px; }

/* toast + loading */
.toast {
  position: absolute; left: 50%; top: 104px; z-index: 40; transform: translateX(-50%);
  max-width: 88%; width: max-content;
  background: rgba(13, 8, 38, .95); color: #fff; font-weight: 800; font-size: 13px; line-height: 1.5;
  padding: 10px 16px; border-radius: 10px; text-align: center;
  box-shadow: inset 0 0 0 1.5px var(--y), 0 0 18px rgba(255, 203, 5, .3), 0 8px 20px rgba(0, 0, 0, .45); animation: pop .25s ease-out;
}
.loading { position: absolute; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; text-align: center; background: var(--grad-bg); color: var(--txt-2); font-weight: 800; }
#app:not(.is-loading) .loading { display: none; }
.loader-card {
  width: 44px; height: 62px; border-radius: 6px; margin-bottom: 6px;
  background: linear-gradient(160deg, #3D2A85, #1A1240);
  box-shadow: 0 0 0 2px var(--y), 0 0 18px rgba(255, 203, 5, .5);
  position: relative; animation: cardflip 1.2s ease-in-out infinite;
}
.loader-card::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 3px; background: var(--y); }
@keyframes cardflip { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(180deg); } }

/* narrow phones: keep the logo inside the frame */
@media (max-width: 374px) {
  .logo-main { font-size: 25px; } .logo-rush { font-size: 21px; }
}
@media (max-width: 340px) {
  .logo { gap: 4px; }
  .logo-mark { display: none; }
  .logo-main { font-size: 22px; } .logo-rush { font-size: 18px; }
}

/* short screens */
@media (max-height: 700px) {
  .logo { height: 40px; }
  .logo-main { font-size: 23px; } .logo-rush { font-size: 19px; }
  .logo-mark { width: 24px; height: 24px; }
  .logo-mark::before { left: 5px; top: 4px; width: 10px; height: 16px; border-width: 4px; }
  .logo-mark::after { width: 7px; height: 7px; right: 3px; bottom: 4px; }
  .scorebar { height: 46px; margin-top: 10px; }
  .score-num { font-size: 25px; }
  .btn-main, .btn-sub { min-height: 46px; font-size: 15px; }
  .spin-status { height: 46px; padding-top: 8px; }
  .chip { height: 32px; }
  .capsule-deco { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-sparkles span, .bg-beams, .bg-grid, .bg-cards i, .chara img, .btn-main.pulse, .btn-main::after, .rays, .bigwin-rays, .front .foil, .cc-coin, .result-burst, .capsule-deco, .loader-card { animation: none !important; }
  .btn-main::after { display: none; }
  .cell.win img { animation: none; transform: scale(1.08); }
}

/* prize list: the PT交換専用カード entry */
.tp-cc {
  width: 100%; aspect-ratio: 5 / 7; border-radius: 6px;
  background: linear-gradient(165deg, #3D2A85, #120C30);
  box-shadow: inset 0 0 0 2px var(--y), 0 2px 6px rgba(0, 0, 0, .4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.tp-cc img { width: 58%; aspect-ratio: 1; box-shadow: none; background: none; border-radius: 50%; }
.tp-cc b { font-size: 8.5px; line-height: 1.2; color: var(--y); font-weight: 900; }
.tp.tp-coin span { white-space: normal; line-height: 1.25; font-size: 9.5px; word-break: keep-all; line-break: strict; overflow-wrap: anywhere; }

/* prize list: 「発送のみ」 badge on a ship-only card (交換不可) */
.tp.tp-ship { position: relative; }
.tp-badge {
  position: absolute; left: 50%; top: 3px; transform: translateX(-50%);
  font-style: normal; font-size: 8.5px; font-weight: 900; line-height: 1; white-space: nowrap;
  color: var(--p1); background: var(--y); padding: 3px 5px; border-radius: 4px;
}
