:root {
  --sky: #eaf2fb;
  --card: #ffffff;
  --card-subtle: #f4f8fc;
  --ink: #102235;
  --muted: #5e738a;
  --line: #cde0f2;
  --swedish-blue: #005293;
  --swedish-gold: #fecb00;
  --gold-glow: rgba(254, 203, 0, 0.45);
  --blue-glow: rgba(0, 82, 147, 0.35);
  --btn-ink: #ffffff;
  --btn-main: #005293;
  --btn-hover: #0066b3;
  --btn-gold: #fecb00;
  --btn-gold-ink: #0d1b2a;
  --btn-off: #d8e5f2;
  --accent-red: #d90429;
  --accent-green: #2b9348;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(16, 34, 53, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 34, 53, 0.1);
  --shadow-lg: 0 16px 40px rgba(16, 34, 53, 0.16);
  --toast-bg: #102235;
  --toast-ink: #ffffff;
  --toast-border: rgba(254, 203, 0, 0.4);
}

[data-theme="dark"] {
  --sky: #0a131e;
  --card: #132234;
  --card-subtle: #1a2c42;
  --ink: #f0f6fc;
  --muted: #95acc5;
  --line: #22374e;
  --swedish-blue: #1c72b8;
  --swedish-gold: #fecb00;
  --btn-main: #fecb00;
  --btn-ink: #0a131e;
  --btn-off: #203348;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
  --toast-bg: #1a2c42;
  --toast-ink: #f0f6fc;
  --toast-border: rgba(254, 203, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--sky);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
  font-size: 15px;
  min-height: 100vh;
  padding-bottom: 90px;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.stripe-banner {
  height: 12px;
  background: repeating-linear-gradient(
    135deg,
    var(--swedish-blue) 0 16px,
    var(--swedish-gold) 16px 26px,
    #ffffff 26px 30px,
    var(--swedish-blue) 30px 46px
  );
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 14px;
}

header {
  padding: 16px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-flag {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

h1 {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--ink);
  line-height: 1.1;
}

.sub {
  font-size: 13px;
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, border-color 0.2s, background 0.2s;
}

.btn-icon:hover {
  border-color: var(--swedish-blue);
  background: var(--card-subtle);
}

.btn-icon:active {
  transform: scale(0.96);
}

.acct-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 10px 0 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.acct-header {
  margin-bottom: 10px;
}

.acct-title {
  font-weight: 800;
  font-size: 14px;
  display: block;
  color: var(--ink);
}

.acct-sub {
  font-size: 12.5px;
  color: var(--muted);
  display: block;
}

.acct-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.acct-inputs input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card-subtle);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.acct-inputs input:focus {
  border-color: var(--swedish-blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.acct-actions {
  display: flex;
  gap: 8px;
}

.btn-main-acct {
  flex: 1;
  background: var(--btn-main);
  color: var(--btn-ink);
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  padding: 9px 14px;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.btn-main-acct:hover {
  filter: brightness(1.1);
}

.btn-main-acct:active {
  transform: scale(0.98);
}

.btn-alt-acct {
  flex: 1;
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--btn-main);
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}

.btn-alt-acct:hover {
  background: var(--card-subtle);
}

.btn-alt-acct:active {
  transform: scale(0.98);
}

.auth-msg {
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  min-height: 1.2em;
  color: var(--accent-red);
}

.auth-msg.success {
  color: var(--accent-green);
}

.acct-logged-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.acct-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.acct-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card-subtle);
  border: 2px solid var(--swedish-gold);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.acct-welcome {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.1;
}

.acct-username {
  font-size: 15px;
  color: var(--ink);
  display: block;
}

.score-box {
  text-align: center;
  padding: 16px 12px 10px;
}

.score-amount {
  font-size: 50px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-shadow: 0 2px 8px var(--gold-glow);
}

.score-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-top: 4px;
}

.score-rate {
  font-size: 15px;
  font-weight: 700;
  color: var(--swedish-blue);
  margin-top: 2px;
}

[data-theme="dark"] .score-rate {
  color: var(--swedish-gold);
}

.buff-pill {
  display: none;
  margin: 10px auto 0;
  width: fit-content;
  background: linear-gradient(135deg, #fecb00, #ff9f1c);
  color: #102235;
  font-weight: 800;
  font-size: 13px;
  padding: 5px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 14px var(--gold-glow);
  animation: pulseBuff 1.2s infinite alternate;
}

@keyframes pulseBuff {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.stage {
  display: flex;
  justify-content: center;
  padding: 16px 0 24px;
  position: relative;
}

#bell-btn {
  width: 196px;
  height: 196px;
  border-radius: 50%;
  border: 5px solid var(--card);
  cursor: pointer;
  position: relative;
  background:
    radial-gradient(circle at 35% 35%, var(--card) 0 38%, transparent 40%),
    conic-gradient(from 0deg, var(--swedish-blue) 0 45deg, var(--swedish-gold) 45deg 90deg, var(--swedish-blue) 90deg 135deg, var(--swedish-gold) 135deg 180deg, var(--swedish-blue) 180deg 225deg, var(--swedish-gold) 225deg 270deg, var(--swedish-blue) 270deg 315deg, var(--swedish-gold) 315deg 360deg);
  box-shadow: 0 12px 28px rgba(0, 82, 147, 0.35), inset 0 0 20px rgba(0,0,0,0.15);
  transition: transform 0.08s cubic-bezier(0.1, 0.9, 0.2, 1), box-shadow 0.08s ease;
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  outline: none;
}

#bell-btn .target-art {
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
  pointer-events: none;
  transition: transform 0.08s ease;
}

#bell-btn:active {
  transform: translateY(6px) scale(0.96);
  box-shadow: 0 4px 12px rgba(0, 82, 147, 0.4);
}

#bell-btn:active .target-art {
  transform: scale(0.92);
}

.click-pop {
  position: absolute;
  pointer-events: none;
  font-weight: 900;
  font-size: 22px;
  color: var(--ink);
  animation: popRise 0.9s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  text-shadow: 0 0 8px var(--sky), 0 0 3px var(--sky);
  z-index: 10;
}

@keyframes popRise {
  0% { opacity: 1; transform: translateY(0) scale(0.8); }
  50% { transform: translateY(-40px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-75px) scale(0.9); }
}

.story-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 8px solid var(--swedish-gold);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.story-card b {
  display: block;
  font-size: 16px;
  color: var(--ink);
}

.story-card p {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 3px;
}

h2 {
  font-size: 19px;
  font-weight: 800;
  margin: 24px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  letter-spacing: -0.3px;
}

h2::after {
  content: "";
  flex: 1;
  height: 6px;
  background: repeating-linear-gradient(135deg, var(--line) 0 5px, transparent 5px 9px);
  border-radius: 3px;
}

.buy-qty-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.buy-qty-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.buy-qty-btn[aria-pressed="true"] {
  background: var(--swedish-blue);
  color: #ffffff;
  border-color: var(--swedish-blue);
  box-shadow: 0 2px 8px var(--blue-glow);
}

[data-theme="dark"] .buy-qty-btn[aria-pressed="true"] {
  background: var(--swedish-gold);
  color: #0a131e;
  border-color: var(--swedish-gold);
  box-shadow: 0 2px 8px var(--gold-glow);
}

.plushie-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plushie-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.plushie-row:hover {
  border-color: var(--swedish-blue);
}

.plushie-row.locked {
  opacity: 0.55;
  filter: grayscale(0.8);
}

.plushie-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid var(--swedish-gold);
  background: var(--card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.plushie-avatar svg {
  width: 44px;
  height: 44px;
}

.plushie-info {
  min-width: 0;
}

.plushie-info b {
  font-size: 16px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

.plushie-info span {
  font-size: 12.5px;
  color: var(--muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plushie-info i {
  font-style: normal;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--swedish-blue);
  display: block;
  margin-top: 2px;
}

[data-theme="dark"] .plushie-info i {
  color: var(--swedish-gold);
}

.buy-btn {
  border: 0;
  border-radius: 12px;
  background: var(--btn-main);
  color: var(--btn-ink);
  font: inherit;
  font-weight: 800;
  padding: 9px 12px;
  min-width: 100px;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: transform 0.08s ease, opacity 0.15s ease, background 0.15s ease;
}

.buy-btn small {
  display: block;
  font-weight: 600;
  font-size: 11px;
  opacity: 0.9;
}

.buy-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.buy-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.buy-btn:disabled {
  background: var(--btn-off);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.upgrades-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upgrade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 8px solid var(--swedish-blue);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.2s;
}

.upgrade-row.done {
  opacity: 0.6;
  border-left-color: var(--accent-green);
}

.upgrade-info b {
  font-size: 15px;
  display: block;
}

.upgrade-info span {
  font-size: 12.5px;
  color: var(--muted);
}

.fika-card {
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.fika-card p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.fika-card b {
  color: var(--ink);
}

.flying-moose {
  position: fixed;
  left: -100px;
  top: 25%;
  font-size: 56px;
  cursor: pointer;
  z-index: 99;
  border: 0;
  background: none;
  padding: 10px;
  animation: flyAcross 10s linear forwards;
  touch-action: manipulation;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

@keyframes flyAcross {
  0% { left: -100px; top: 25%; }
  50% { top: 15%; }
  100% { left: calc(100vw + 40px); top: 30%; }
}

.arena-fab {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 100;
  border-radius: 999px;
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  font-size: 15px;
  background: linear-gradient(135deg, var(--swedish-blue), #003666);
  color: #fff;
  border: 2px solid var(--swedish-gold);
}

[data-theme="dark"] .arena-fab {
  background: linear-gradient(135deg, var(--swedish-gold), #d4a200);
  color: #0a131e;
}

.arena-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--sky);
  padding: 16px 14px 80px;
  overflow-y: auto;
  display: none;
}

.arena-inner {
  max-width: 560px;
  margin: 0 auto;
}

.arena-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.arena-top b {
  font-size: 22px;
}

.boss-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 2px solid var(--accent-red);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
}

.boss-icon {
  font-size: 54px;
  line-height: 1;
}

.boss-meta {
  flex: 1;
  min-width: 0;
}

.boss-meta b {
  font-size: 18px;
  display: block;
}

.hp-bar {
  height: 12px;
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
  margin: 6px 0;
}

.hp-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent-red);
  border-radius: 6px;
  transition: width 0.1s linear;
}

.hp-bar.green i {
  background: var(--accent-green);
}

.team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.team-slot {
  width: 72px;
  text-align: center;
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 6px 4px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: all 0.15s;
}

.team-slot.full {
  border-style: solid;
  border-color: var(--swedish-blue);
}

.team-slot.dead {
  opacity: 0.35;
  filter: grayscale(1);
}

.team-slot .face {
  width: 44px;
  height: 44px;
  margin: 0 auto 4px;
  border-radius: 50%;
  background: var(--card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-slot .face svg {
  width: 34px;
  height: 34px;
}

.team-slot .plus {
  width: 44px;
  height: 44px;
  margin: 0 auto 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: var(--muted);
}

.team-slot .slot-name {
  font-size: 11px;
  font-weight: 700;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fighter-pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.fighter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 6px;
  font: inherit;
  cursor: pointer;
  min-width: 0;
  text-align: left;
}

.fighter-item.equipped {
  border: 2px solid var(--swedish-blue);
  background: var(--card-subtle);
}

.fighter-item .f-face {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sky);
}

.fighter-item .f-face svg {
  width: 26px;
  height: 26px;
}

.fighter-item b {
  font-size: 12px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fighter-item span {
  font-size: 11px;
  color: var(--muted);
  display: block;
}

.toast-msg {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--toast-bg);
  color: var(--toast-ink);
  border: 1px solid var(--toast-border);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13.5px;
  z-index: 999;
  max-width: 90vw;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.story-log {
  max-height: 240px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  box-shadow: var(--shadow-sm);
}

.story-log-item {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.story-log-item:last-child {
  border-bottom: 0;
}

.story-log-item b {
  font-size: 13.5px;
  display: block;
  color: var(--ink);
}

.story-log-item span {
  font-size: 12.5px;
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  place-items: center;
  padding: 16px;
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.modal-box h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.modal-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--sky);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  margin-bottom: 10px;
}

.modal-two {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
