:root {
      --bg1: #ff1493;
      --bg2: #ffd700;
      --bg3: #00ffff;
      --panel: rgba(255, 255, 255, 0.94);
      --panel2: rgba(255, 255, 255, 0.78);
      --panel3: rgba(255, 255, 255, 0.58);
      --text: #18212f;
      --muted: #677489;
      --accent: #ff1493;
      --gold: #ffd700;
      --ok: #16a34a;
      --bad: #ef4444;
      --info: #2563eb;
      --shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
      --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.12);
      --radius: 16px;
      --radius2: 22px;
      --radius3: 28px;
    }

    * { box-sizing: border-box; }
    html, body { min-height: 100%; }

    body {
      margin: 0;
      font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
      color: var(--text);
      background:
        radial-gradient(circle at 10% 10%, rgba(255,255,255,.28), transparent 30%),
        radial-gradient(circle at 90% 10%, rgba(255,255,255,.20), transparent 25%),
        linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
      overflow-x: hidden;
      overflow-y: auto;
      touch-action: manipulation;
    }

    .sr-only {
      position: absolute;
      width: 1px; height: 1px;
      padding: 0; margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap; border: 0;
    }

    header {
      padding: 12px 14px 6px;
      text-align: center;
      color: #fff;
      text-shadow: 3px 3px 0 #000, -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000;
      position: relative;
      user-select: none;
      z-index: 4;
    }

    header h1 {
      font-size: clamp(22px, 5vw, 36px);
      margin: 0;
      letter-spacing: .5px;
    }

    header .sub {
      font-size: clamp(12px, 3vw, 14px);
      opacity: .96;
      margin-top: 4px;
    }

    .top-actions {
      position: absolute;
      right: 10px;
      top: 10px;
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .icon-btn {
      border: 0;
      background: rgba(255, 255, 255, .25);
      color: #fff;
      border-radius: 12px;
      padding: 10px 12px;
      cursor: pointer;
      backdrop-filter: blur(6px);
      box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
      font-size: 14px;
      line-height: 1;
      transition: transform .12s ease, background .12s ease;
    }
    .icon-btn:hover { background: rgba(255,255,255,.35); }
    .icon-btn:active { transform: translateY(1px); }
    .icon-btn:focus-visible { outline: 3px solid rgba(255,255,255,.8); outline-offset: 2px; }

    #app {
      max-width: 1260px;
      margin: 0 auto;
      padding: 10px 12px 14px;
      min-height: calc(100vh - 72px);
      height: auto;
      position: relative;
      z-index: 2;
    }

    .layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 400px;
      gap: 14px;
      align-items: start;
    }

    .panel {
      background: var(--panel);
      border-radius: var(--radius2);
      box-shadow: var(--shadow);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      min-height: 0;
      backdrop-filter: blur(8px);
    }

    .main {
      padding: 12px;
      align-items: stretch;
      text-align: center;
      gap: 8px;
    }

    .hero-card {
      background: linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.42));
      border-radius: var(--radius2);
      border: 1px solid rgba(255,255,255,.4);
      box-shadow: var(--shadow-soft);
      padding: 12px;
    }

    .stats {
      width: 100%;
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
      margin-bottom: 8px;
    }

    .stat {
      background: var(--panel2);
      border-radius: 14px;
      padding: 9px 10px;
      text-align: left;
      border: 1px solid rgba(0, 0, 0, .06);
      box-shadow: var(--shadow-soft);
    }

    .stat .k {
      font-size: 11px;
      color: var(--muted);
      font-weight: 700;
      letter-spacing: .03em;
    }

    .stat .v {
      font-size: clamp(16px, 2.4vw, 22px);
      font-weight: 900;
      margin-top: 2px;
      line-height: 1.1;
      overflow-wrap: anywhere;
    }

    .stat .v small {
      font-size: .58em;
      font-weight: 700;
      color: var(--muted);
    }

    .stat .hint {
      font-size: 11px;
      color: var(--muted);
      margin-top: 3px;
    }

    .status-row {
      display: grid;
      grid-template-columns: 1fr minmax(240px, 320px);
      gap: 8px;
      align-items: stretch;
      width: 100%;
      margin-bottom: 6px;
    }

    .combo-strip {
      text-align: center;
      padding: 8px 10px;
      border-radius: var(--radius);
      background: linear-gradient(90deg, rgba(255, 215, 0, .25), rgba(255, 20, 147, .12));
      border: 1px solid rgba(255, 215, 0, .7);
      min-height: 46px;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 10px;
    }

    .pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 9px;
      border-radius: 999px;
      background: rgba(255,255,255,.78);
      border: 1px solid rgba(0,0,0,.05);
      color: var(--text);
      font-weight: 900;
      font-size: 14px;
      box-shadow: 0 2px 10px rgba(0,0,0,.05);
    }

    .recommend-card {
      min-width: 230px;
      max-width: 360px;
      padding: 10px 12px;
      border-radius: var(--radius);
      background: linear-gradient(135deg, rgba(37,99,235,.10), rgba(255,255,255,.75));
      border: 1px solid rgba(37,99,235,.20);
      text-align: left;
      box-shadow: var(--shadow-soft);
    }

    .recommend-card .label {
      color: var(--info);
      font-weight: 900;
      font-size: 12px;
      margin-bottom: 4px;
    }

    .recommend-card .name {
      font-size: 14px;
      font-weight: 900;
      line-height: 1.25;
    }

    .recommend-card .desc {
      font-size: 12px;
      color: var(--muted);
      margin-top: 4px;
    }

    .fever-wrap {
      width: 100%;
      margin-bottom: 12px;
      background: rgba(255,255,255,.72);
      border: 1px solid rgba(255,255,255,.4);
      padding: 12px;
      border-radius: var(--radius2);
      box-shadow: var(--shadow-soft);
    }

    .fever-head {
      display: flex;
      gap: 10px;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
      flex-wrap: wrap;
    }

    .fever-title {
      font-size: 14px;
      font-weight: 900;
      color: #7c2d12;
    }

    .fever-status {
      font-size: 12px;
      color: var(--muted);
      font-weight: 700;
    }

    .meter {
      height: 16px;
      border-radius: 999px;
      background: rgba(0,0,0,.10);
      overflow: hidden;
      position: relative;
    }

    .meter > span {
      position: absolute;
      inset: 0 auto 0 0;
      width: 0%;
      border-radius: inherit;
      background: linear-gradient(90deg, #ffd700, #ff8a00, #ff1493);
      box-shadow: 0 0 18px rgba(255, 20, 147, .25);
      transition: width .15s ease;
    }

    .fever-actions {
      display: flex;
      gap: 8px;
      justify-content: space-between;
      align-items: center;
      margin-top: 10px;
      flex-wrap: wrap;
    }

    .boost-note {
      font-size: 12px;
      color: var(--muted);
      text-align: left;
      flex: 1;
      min-width: 210px;
    }

    .adventure-wrap {
      width: 100%;
      margin-bottom: 12px;
      background: linear-gradient(135deg, rgba(24,33,47,.06), rgba(255,255,255,.76));
      border: 1px solid rgba(24,33,47,.10);
      padding: 12px;
      border-radius: var(--radius2);
      box-shadow: var(--shadow-soft);
      text-align: left;
    }

    .adventure-head {
      display: flex;
      gap: 10px;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
      flex-wrap: wrap;
    }

    .adventure-title {
      font-size: 14px;
      font-weight: 900;
      color: #111827;
    }

    .adventure-stage-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(255,255,255,.78);
      border: 1px solid rgba(0,0,0,.08);
      font-size: 12px;
      font-weight: 900;
      color: var(--text);
    }

    .battle-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr);
      gap: 10px;
      align-items: stretch;
    }

    .battle-box {
      background: rgba(255,255,255,.72);
      border-radius: var(--radius);
      border: 1px solid rgba(0,0,0,.06);
      padding: 12px;
      box-shadow: var(--shadow-soft);
    }

    .enemy-top {
      display: grid;
      grid-template-columns: 56px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      margin-bottom: 10px;
    }

    .enemy-emoji {
      width: 56px;
      height: 56px;
      display: grid;
      place-items: center;
      border-radius: 18px;
      background: linear-gradient(135deg, rgba(255,215,0,.28), rgba(255,255,255,.86));
      border: 1px solid rgba(0,0,0,.08);
      font-size: 32px;
      box-shadow: var(--shadow-soft);
    }

    .enemy-name {
      font-size: 18px;
      font-weight: 900;
      line-height: 1.15;
      overflow-wrap: anywhere;
    }

    .enemy-sub {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      color: var(--muted);
      font-size: 12px;
      margin-top: 4px;
    }

    .enemy-reward {
      font-size: 12px;
      color: var(--ok);
      font-weight: 900;
      margin-top: 6px;
    }

    .battle-bar-wrap {
      margin-top: 10px;
    }

    .battle-bar-meta {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
      font-size: 12px;
      color: var(--muted);
      font-weight: 800;
      flex-wrap: wrap;
    }

    .battle-bar {
      height: 14px;
      border-radius: 999px;
      background: rgba(0,0,0,.10);
      overflow: hidden;
      position: relative;
    }

    .battle-bar > span {
      position: absolute;
      inset: 0 auto 0 0;
      width: 0%;
      border-radius: inherit;
      transition: width .18s ease;
    }

    .battle-bar.hp > span {
      background: linear-gradient(90deg, #ef4444, #f97316);
      box-shadow: 0 0 18px rgba(239,68,68,.2);
    }

    .battle-bar.exp > span {
      background: linear-gradient(90deg, #2563eb, #38bdf8);
      box-shadow: 0 0 18px rgba(37,99,235,.18);
    }

    .battle-mini-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-top: 12px;
    }

    .battle-mini {
      background: rgba(255,255,255,.82);
      border: 1px solid rgba(0,0,0,.06);
      border-radius: 14px;
      padding: 10px;
      box-shadow: var(--shadow-soft);
    }

    .battle-mini .mini-k {
      display: block;
      font-size: 11px;
      color: var(--muted);
      font-weight: 700;
      margin-bottom: 4px;
    }

    .battle-mini .mini-v {
      display: block;
      font-size: 15px;
      font-weight: 900;
      line-height: 1.15;
      overflow-wrap: anywhere;
    }

    .relic-box {
      margin-top: 10px;
      background: rgba(255,255,255,.58);
      border-radius: var(--radius);
      border: 1px solid rgba(0,0,0,.06);
      padding: 12px;
      box-shadow: var(--shadow-soft);
    }

    .relic-title {
      font-size: 13px;
      font-weight: 900;
      color: #111827;
      margin-bottom: 8px;
    }

    .relic-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }

    .relic-item {
      display: grid;
      gap: 4px;
      justify-items: center;
      align-content: start;
      background: rgba(255,255,255,.82);
      border: 1px solid rgba(0,0,0,.06);
      border-radius: 16px;
      padding: 10px 8px;
      min-height: 92px;
      box-shadow: var(--shadow-soft);
      text-align: center;
    }

    .relic-icon {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      display: grid;
      place-items: center;
      background: linear-gradient(135deg, rgba(255,215,0,.35), rgba(255,255,255,.92));
      border: 1px solid rgba(0,0,0,.06);
      font-size: 22px;
    }

    .relic-name {
      font-size: 12px;
      color: var(--muted);
      font-weight: 800;
      line-height: 1.1;
    }

    .relic-level {
      font-size: 15px;
      font-weight: 900;
      line-height: 1.1;
    }

    .relic-note {
      margin-top: 8px;
      font-size: 12px;
      color: var(--muted);
    }


    .doge-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      margin-top: 0;
      margin-bottom: 8px;
      position: relative;
    }

    #dogeBtn {
      border: 0;
      background: transparent;
      cursor: pointer;
      padding: 0;
      border-radius: 999px;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
      position: relative;
    }

    #dogeHalo {
      position: absolute;
      inset: -18px;
      border-radius: 999px;
      background: radial-gradient(circle, rgba(255,255,255,.28), rgba(255,255,255,0) 65%);
      filter: blur(4px);
      opacity: .65;
      pointer-events: none;
      transition: transform .2s ease, opacity .2s ease;
    }

    #doge {
      width: min(250px, 62vw);
      height: auto;
      max-height: 250px;
      border-radius: 999px;
      box-shadow: 0 0 35px rgba(255, 215, 0, .92);
      transition: transform .08s ease, filter .2s ease, box-shadow .2s ease;
      display: block;
      position: relative;
      z-index: 1;
      object-fit: cover;
      background: rgba(255,255,255,.5);
    }

    #dogeBtn:active #doge {
      transform: scale(.95);
    }

    .click-tip {
      font-size: 11px;
      color: var(--muted);
      background: rgba(255,255,255,.72);
      border-radius: 999px;
      padding: 6px 10px;
      box-shadow: var(--shadow-soft);
    }

    .controls {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: center;
      margin: 10px 0 0;
    }

    .btn {
      border: 0;
      cursor: pointer;
      border-radius: 14px;
      padding: 10px 12px;
      min-width: 104px;
      font-weight: 900;
      background: var(--gold);
      color: #111827;
      box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
      transition: transform .08s ease, filter .15s ease, background .15s ease;
    }

    .btn:hover { filter: brightness(1.03); }
    .btn:active { transform: translateY(1px); }
    .btn.secondary { background: rgba(255, 255, 255, .82); }
    .btn.ghost {
      background: rgba(255,255,255,.55);
      color: var(--text);
      box-shadow: none;
      border: 1px solid rgba(0,0,0,.08);
    }
    .btn.primary {
      background: linear-gradient(135deg, #ffd700, #ffae00);
    }
    .btn.info {
      background: linear-gradient(135deg, #60a5fa, #2563eb);
      color: #fff;
    }
    .btn.danger {
      background: rgba(239, 68, 68, .88);
      color: #fff;
    }
    .btn:disabled {
      opacity: .48;
      cursor: not-allowed;
      filter: grayscale(.15);
      transform: none !important;
    }
    .btn:focus-visible {
      outline: 3px solid rgba(17, 24, 39, .35);
      outline-offset: 2px;
    }


    .utility-card {
      margin-top: 10px;
      background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,255,255,.48));
      border-radius: var(--radius);
      border: 1px solid rgba(0,0,0,.06);
      padding: 10px;
      box-shadow: var(--shadow-soft);
    }

    .utility-title {
      font-size: 12px;
      color: var(--muted);
      font-weight: 800;
      text-align: left;
      margin-bottom: 8px;
    }

    .tab-head {
      padding: 14px 14px 10px;
      display: flex;
      gap: 8px;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid rgba(0, 0, 0, .06);
      background: rgba(255,255,255,.38);
      backdrop-filter: blur(8px);
      flex-wrap: wrap;
    }

    .tab-title {
      margin: 0;
      font-size: 18px;
      color: var(--accent);
    }

    .tab-nav {
      display: inline-flex;
      gap: 6px;
      background: rgba(255,255,255,.7);
      border-radius: 999px;
      padding: 4px;
      border: 1px solid rgba(0,0,0,.08);
    }

    .tab-btn {
      border: 0;
      background: transparent;
      border-radius: 999px;
      padding: 10px 14px;
      cursor: pointer;
      font-weight: 900;
      font-size: 13px;
      color: var(--text);
      transition: background .12s ease, color .12s ease;
    }

    .tab-btn[aria-pressed="true"] {
      background: var(--gold);
      color: #111827;
      box-shadow: 0 3px 10px rgba(0,0,0,.08);
    }

    .right-panel-body {
      padding: 12px;
      overflow: auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .panel-note {
      background: linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.46));
      border: 1px solid rgba(0,0,0,.06);
      border-radius: var(--radius);
      padding: 10px 12px;
      font-size: 12px;
      color: var(--muted);
      box-shadow: var(--shadow-soft);
    }

    .section-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .card {
      display: flex;
      gap: 10px;
      align-items: center;
      padding: 12px;
      border-radius: var(--radius);
      background: #fff;
      border: 2px solid rgba(255, 215, 0, .52);
      box-shadow: var(--shadow-soft);
      transition: box-shadow .12s ease, opacity .12s ease, border-color .12s ease;
    }

    @media (hover: hover) and (pointer: fine) {
      .card:hover { box-shadow: 0 10px 18px rgba(0,0,0,.10); }
    }
    .card.locked {
      opacity: .78;
      border-style: dashed;
      border-color: rgba(0,0,0,.10);
      background: rgba(255,255,255,.72);
    }
    .card.done {
      border-color: rgba(22,163,74,.45);
      background: linear-gradient(135deg, rgba(240,253,244,.92), rgba(255,255,255,1));
    }

    .emoji {
      font-size: 34px;
      line-height: 1;
      width: 42px;
      text-align: center;
      flex: 0 0 42px;
    }

    .info {
      flex: 1;
      min-width: 0;
      text-align: left;
    }

    .name {
      font-weight: 900;
      font-size: 15px;
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    .tag {
      font-size: 11px;
      font-weight: 900;
      padding: 3px 8px;
      border-radius: 999px;
      border: 1px solid rgba(0,0,0,.08);
      background: rgba(255,255,255,.86);
      color: var(--muted);
    }

    .desc {
      font-size: 12px;
      color: var(--muted);
      margin-top: 3px;
      line-height: 1.45;
      word-break: break-word;
    }

    .meta {
      font-size: 12px;
      margin-top: 8px;
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    .meta .gain { color: var(--ok); font-weight: 900; }
    .meta .warn { color: #b45309; font-weight: 900; }
    .meta .afford { color: var(--muted); }

    .buy {
      display: flex;
      flex-direction: column;
      gap: 6px;
      align-items: flex-end;
      min-width: 120px;
      text-align: right;
    }

    .price { font-weight: 900; }
    .small { font-size: 12px; color: var(--muted); }

    .buy .buyBtn {
      border: 0;
      cursor: pointer;
      border-radius: 12px;
      padding: 10px 12px;
      font-weight: 900;
      width: 100%;
      background: var(--gold);
      transition: transform .08s ease, filter .12s ease;
    }

    .buy .buyBtn:active { transform: translateY(1px); }
    .buy .buyBtn:disabled {
      opacity: .45;
      cursor: not-allowed;
      filter: grayscale(.85);
    }

    .progress-wrap {
      width: 100%;
      margin-top: 8px;
    }

    .progress-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 4px;
    }

    .progress {
      height: 10px;
      background: rgba(0,0,0,.10);
      border-radius: 999px;
      overflow: hidden;
      position: relative;
    }

    .progress span {
      display: block;
      width: 0%;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #60a5fa, #2563eb);
      transition: width .18s ease;
    }

    #toast {
      position: fixed;
      left: 50%;
      bottom: 18px;
      transform: translateX(-50%);
      padding: 12px 18px;
      border-radius: 999px;
      background: rgba(0, 0, 0, .86);
      color: #fff;
      font-weight: 800;
      box-shadow: 0 14px 35px rgba(0, 0, 0, .45);
      display: none;
      z-index: 2000;
      max-width: min(92vw, 880px);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .84);
      z-index: 3000;
      padding: 18px;
    }

    .modal .content {
      max-width: 760px;
      margin: 0 auto;
      background: #fff;
      border-radius: var(--radius2);
      border: 6px solid var(--gold);
      box-shadow: var(--shadow);
      padding: 16px;
      max-height: 88vh;
      overflow: auto;
      position: relative;
    }

    .modal h3 { margin: 4px 0 10px; color: var(--accent); }
    .close {
      position: absolute;
      top: 8px; right: 10px;
      border: 0;
      cursor: pointer;
      background: rgba(0,0,0,.06);
      border-radius: 12px;
      padding: 10px 12px;
      font-weight: 900;
      font-size: 16px;
    }

    textarea {
      width: 100%;
      min-height: 180px;
      resize: vertical;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      border-radius: 14px;
      border: 1px solid rgba(0,0,0,.15);
      padding: 12px;
    }

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

    .setting {
      background: rgba(0,0,0,.04);
      border: 1px solid rgba(0,0,0,.08);
      border-radius: var(--radius);
      padding: 12px;
      margin: 10px 0;
    }

    .setting label { font-weight: 900; display: block; margin-bottom: 6px; }
    .setting .help { font-size: 12px; color: var(--muted); margin-top: 6px; }
    input[type="range"] { width: 100%; }

    .floating {
      position: absolute;
      pointer-events: none;
      font-weight: 900;
      text-shadow: 2px 2px 6px rgba(0, 0, 0, .55);
      animation: floatUp 1.18s ease-out forwards;
      z-index: 1500;
      will-change: transform, opacity;
    }

    @keyframes floatUp {
      0% { opacity: 1; transform: translateY(0) scale(1); }
      100% { opacity: 0; transform: translateY(-110px) scale(1.08); }
    }

    #rainContainer {
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 1200;
      overflow: hidden;
    }

    .dogeRain {
      position: absolute;
      width: 44px;
      height: 44px;
      background-size: contain;
      background-repeat: no-repeat;
      opacity: .88;
      animation: fall linear forwards;
      will-change: transform;
      filter: drop-shadow(0 8px 12px rgba(0,0,0,.20));
    }

    @keyframes fall {
      0% { transform: translateY(-120px) rotate(0deg); }
      100% { transform: translateY(110vh) rotate(720deg); }
    }

    .golden {
      filter: drop-shadow(0 0 40px var(--gold)) brightness(1.8) saturate(2.5) !important;
      box-shadow: 0 0 45px rgba(255,215,0,.96) !important;
    }

    body.fever-mode {
      background:
        radial-gradient(circle at 50% 15%, rgba(255,255,255,.34), transparent 35%),
        linear-gradient(135deg, #f59e0b, #ef4444, #ff1493, #7c3aed);
    }

    body.fever-mode #dogeHalo {
      transform: scale(1.15);
      opacity: 1;
    }

    body.fever-mode .fever-wrap {
      border-color: rgba(239,68,68,.35);
      background: linear-gradient(135deg, rgba(255,234,234,.9), rgba(255,255,255,.85));
    }

    .offline-summary {
      background: linear-gradient(135deg, rgba(255,255,255,.8), rgba(255,255,255,.55));
      border: 1px solid rgba(0,0,0,.06);
      border-radius: var(--radius);
      padding: 14px;
      box-shadow: var(--shadow-soft);
    }

    .offline-value {
      font-size: clamp(24px, 5vw, 34px);
      font-weight: 900;
      margin: 10px 0 4px;
      color: #b45309;
    }


    @media (min-width: 881px) {
      aside.panel {
        position: sticky;
        top: 12px;
        max-height: calc(100vh - 24px);
      }

      .right-panel-body {
        max-height: calc(100vh - 132px);
      }
    }

    @media (max-width: 1024px) {
      .stats { grid-template-columns: repeat(3, 1fr); }
      .status-row { grid-template-columns: 1fr; }
      .recommend-card { max-width: none; }
      .battle-grid { grid-template-columns: 1fr; }
      #doge { width: min(220px, 58vw); max-height: 220px; }
    }

    @media (max-width: 880px) {
      #app { min-height: 0; height: auto; }
      .layout { grid-template-columns: 1fr; }
      .panel { min-height: unset; }
      aside.panel { position: static; max-height: none; }
      .right-panel-body { max-height: 58vh; }
  
    .utility-card {
      margin-top: 10px;
      background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,255,255,.48));
      border-radius: var(--radius);
      border: 1px solid rgba(0,0,0,.06);
      padding: 10px;
      box-shadow: var(--shadow-soft);
    }

    .utility-title {
      font-size: 12px;
      color: var(--muted);
      font-weight: 800;
      text-align: left;
      margin-bottom: 8px;
    }

    .tab-head { position: sticky; top: 0; z-index: 3; }
      .btn { min-width: 46%; }
      .buy { min-width: 106px; }
    }

    @media (max-width: 560px) {
      .stats { grid-template-columns: 1fr 1fr; }
      .stat .v { font-size: 18px; }
  
    .utility-card {
      margin-top: 10px;
      background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,255,255,.48));
      border-radius: var(--radius);
      border: 1px solid rgba(0,0,0,.06);
      padding: 10px;
      box-shadow: var(--shadow-soft);
    }

    .utility-title {
      font-size: 12px;
      color: var(--muted);
      font-weight: 800;
      text-align: left;
      margin-bottom: 8px;
    }

    .tab-head { align-items: stretch; }
      .tab-nav { width: 100%; justify-content: space-between; }
      .tab-btn { flex: 1 1 0; padding: 10px 8px; }
      #buyModeBox .row { width: 100%; }
      #buyModeBox .segBtn { flex: 1 1 0; min-width: 0; }
      .right-panel-body { max-height: none; overflow: visible; }
      .card { flex-direction: column; align-items: stretch; }
      .emoji { width: auto; flex: none; font-size: 30px; text-align: left; }
      .info { width: 100%; }
      .buy { width: 100%; min-width: 0; align-items: stretch; text-align: left; }
      .buy .buyBtn { width: 100%; }
      .price { text-align: left; }
      .battle-mini-grid { grid-template-columns: 1fr; }
      .enemy-top { grid-template-columns: 1fr; justify-items: start; }
      .progress-meta { flex-direction: column; align-items: flex-start; }
      .name { font-size: 14px; }
      .small { white-space: normal; }
    }


    /* Performance mode: keep the game responsive while tapping repeatedly. */
    body.performance-mode {
      background: linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
    }

    body.performance-mode .panel,
    body.performance-mode .hero-card,
    body.performance-mode .stat,
    body.performance-mode .recommend-card,
    body.performance-mode .fever-wrap,
    body.performance-mode .adventure-wrap,
    body.performance-mode .battle-box,
    body.performance-mode .battle-mini,
    body.performance-mode .relic-box,
    body.performance-mode .relic-item,
    body.performance-mode .utility-card,
    body.performance-mode .card,
    body.performance-mode .panel-note,
    body.performance-mode .tab-head,
    body.performance-mode .modal .content {
      backdrop-filter: none !important;
      box-shadow: 0 4px 14px rgba(0, 0, 0, .10) !important;
    }

    body.performance-mode .icon-btn,
    body.performance-mode #dogeHalo,
    body.performance-mode .dogeRain {
      filter: none !important;
      backdrop-filter: none !important;
    }

    body.performance-mode .meter > span,
    body.performance-mode .battle-bar > span,
    body.performance-mode .progress span,
    body.performance-mode #doge,
    body.performance-mode .btn,
    body.performance-mode .card,
    body.performance-mode .tab-btn {
      transition-duration: .001ms !important;
    }

    @media (prefers-reduced-motion: reduce) {
      * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
      }
    }
