@font-face {
  font-family: "JiangChengYuanTi";
  src: url("./jiangchengyuanti-700w.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #4a4640;
  --muted: #857b72;
  --card: rgba(255, 255, 255, 0.94);
  --glass: rgba(255, 255, 255, 0.12);
  --glass-line: rgba(255, 255, 255, 0.28);
  --line: #655d56;
  --soft: #f8f4ee;
  --shadow: 0 30px 70px rgba(56, 40, 25, 0.14);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "JiangChengYuanTi", "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 222, 165, 0.3), transparent 22%),
    radial-gradient(circle at 88% 18%, rgba(255, 158, 120, 0.18), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(255, 228, 168, 0.22), transparent 24%),
    linear-gradient(135deg, #f8f4ef 0%, #f1ebe2 100%);
}

body.popup-open {
  overflow: hidden;
}

body.license-locked {
  overflow: hidden;
}

body.license-locked .reward-card,
body.license-locked .side-drawer {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.runtime-warning {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  z-index: 160;
  max-width: min(92vw, 840px);
  padding: 16px 22px;
  border-radius: 22px;
  background: rgba(28, 28, 28, 0.88);
  color: #fff;
  text-align: center;
  font-size: 20px;
  line-height: 1.5;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.widget-shell {
  min-height: 100vh;
  padding: 18px 20px 24px;
}

.reward-card {
  width: min(94vw, 1920px);
  min-height: calc(100vh - 12px);
  margin: 0 auto;
  padding: 20px 24px 22px;
  border-radius: 42px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.card-top,
.card-actions,
.card-quick-tools,
.summary-bar,
.summary-item,
.modal-actions,
.field-block,
.panel-bottom-tools,
.tool-pill,
.drawer-head,
.route-point,
.map-stat {
  display: flex;
  align-items: center;
}

.card-top,
.drawer-head,
.modal-actions {
  justify-content: space-between;
}

.card-actions,
.summary-bar,
.panel-bottom-tools,
.route-list {
  gap: 12px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #b48b57;
  font-size: 16px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(24px, 1.9vw, 38px); }
h2 { font-size: clamp(34px, 2.5vw, 44px); }
h3 { font-size: 22px; margin-bottom: 14px; }

.card-top {
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.card-quick-tools {
  gap: 10px;
  flex: 0 0 auto;
}

.ghost-btn,
.solid-btn,
.close-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.ghost-btn:hover,
.solid-btn:hover,
.close-btn:hover,
.tool-pill:hover {
  transform: translateY(-2px);
}

.card-actions .ghost-btn {
  padding: 14px 24px;
  min-height: 58px;
  font-size: 22px;
  font-weight: 700;
}

.ghost-btn {
  background: #f5f1ea;
  color: var(--ink);
}

.ghost-btn.warn {
  background: #fff0e6;
  color: #b35d37;
}

.solid-btn {
  background: #1e1e1e;
  color: #fff;
}

.close-btn {
  padding: 16px 24px;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.summary-bar {
  flex: 0 1 auto;
  margin-top: 0;
  padding: 0;
  border-radius: 28px;
  background: rgba(252, 249, 245, 0.92);
  justify-content: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.summary-item {
  gap: 12px;
  min-height: 58px;
  padding: 14px 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(229, 223, 214, 0.8);
}

.summary-label {
  font-size: 22px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.summary-item strong {
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
}

.member-badge {
  background: linear-gradient(180deg, #fdf6ea 0%, #f8ecda 100%);
  box-shadow:
    inset 0 0 0 1px rgba(214, 185, 139, 0.82),
    0 12px 24px rgba(169, 129, 69, 0.1);
}

.member-badge strong {
  color: #a1692c;
}

.member-badge.is-hidden {
  display: none;
}

.countdown-item {
  background: linear-gradient(180deg, #fff7ee 0%, #fff2de 100%);
  box-shadow:
    inset 0 0 0 1px rgba(235, 205, 164, 0.85),
    0 10px 22px rgba(221, 175, 107, 0.12);
}

.countdown-item .summary-label {
  color: #b57a33;
}

.countdown-item strong {
  color: #9c551d;
}

.countdown-item.is-hidden {
  display: none;
}

.route-board {
  position: relative;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 30px 14px;
}

.route-board::before {
  content: "";
  position: absolute;
  left: 40px;
  right: 40px;
  top: 119px;
  height: 3px;
  border-radius: 999px;
  z-index: 1;
  background: var(--line);
  box-shadow: 0 470px 0 0 var(--line);
}

.route-board.single-row::before {
  box-shadow: none;
}

.route-board::after {
  display: none;
}

.stage-card {
  position: relative;
  min-height: 440px;
  text-align: center;
  z-index: 2;
}

.stage-level {
  margin-top: 0;
  font-size: 36px;
  font-weight: 800;
}

.stage-chapter {
  position: absolute;
  left: 50%;
  top: 48px;
  transform: translateX(-50%);
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
}

.route-point {
  justify-content: center;
  position: absolute;
  left: 50%;
  top: 101px;
  transform: translateX(-50%);
}

.checkpoint-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #808080;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.checkpoint-button.available:hover {
  transform: scale(1.1);
}

.checkpoint-button.completed {
  border-color: transparent;
}

.checkpoint-button:disabled {
  cursor: not-allowed;
}

.stage-percent {
  position: absolute;
  top: 148px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 19px;
  font-weight: 800;
}

.stage-word-editor {
  position: absolute;
  top: 188px;
  left: 50%;
  transform: translateX(-50%);
}

.stage-reward-block {
  position: absolute;
  left: 50%;
  top: 236px;
  transform: translateX(-50%);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.stage-word-label {
  display: none;
}

.stage-word-input {
  width: 84px;
  border: 1px solid #ddd6ca;
  border-radius: 14px;
  height: 40px;
  padding: 0 6px 0 10px;
  line-height: 40px;
  box-sizing: border-box;
  text-align: center;
  text-indent: 4px;
  font-size: 18px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(34, 24, 15, 0.08);
}

.stage-word-input:focus {
  outline: 2px solid rgba(213, 176, 108, 0.4);
  border-color: #d5b06c;
}

.reward-line-board {
  margin-top: 0;
}

.reward-line-board.is-hidden {
  display: none;
}

.reward-tray {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 18px 14px;
}

.reward-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 210px;
  gap: 10px;
}

.reward-thumb-wrap {
  width: 146px;
  height: 146px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff9f0 0%, #fff6ea 100%);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(241, 229, 214, 0.9);
}

.reward-thumb-wrap.empty {
  border: 2px dashed #ddd6ca;
  background: rgba(255, 255, 255, 0.36);
}

.reward-thumb {
  max-width: 134px;
  max-height: 134px;
  object-fit: contain;
}

.reward-name {
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}

.reward-hint {
  max-width: 138px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

.tool-pill {
  gap: 14px;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 22px;
  border: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 242, 233, 0.94));
  box-shadow: 0 18px 36px rgba(48, 35, 21, 0.12);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}

.tool-emoji {
  font-size: 34px;
}

.top-tool {
  padding: 11px 16px;
  font-size: 18px;
}

.drawer-mask,
.modal-mask,
.reward-popup-mask {
  position: fixed;
  inset: 0;
  display: none;
}

.drawer-mask {
  z-index: 80;
  background: rgba(10, 10, 10, 0.48);
  backdrop-filter: blur(16px) saturate(0.75);
  -webkit-backdrop-filter: blur(16px) saturate(0.75);
}

.modal-mask {
  z-index: 100;
  background: rgba(10, 10, 10, 0.34);
  backdrop-filter: blur(12px);
}

.reward-popup-mask {
  z-index: 140;
  background: rgba(8, 8, 8, 0.6);
  backdrop-filter: blur(16px) saturate(0.75);
  -webkit-backdrop-filter: blur(16px) saturate(0.75);
}

.drawer-mask.open,
.modal-mask.open,
.reward-popup-mask.open {
  display: block;
}

.activation-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(80vw, 1280px);
  min-height: min(80vh, 860px);
  max-height: 80vh;
  padding: 42px 42px 36px;
  border-radius: 42px;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 34px 88px rgba(36, 28, 18, 0.22);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.activation-desc {
  margin-top: 14px;
  font-size: 24px;
  line-height: 1.75;
  color: var(--muted);
}

.activation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  margin-top: 24px;
}

.activation-field {
  display: grid;
  gap: 10px;
}

.activation-field-full {
  grid-column: 1 / -1;
}

.activation-field span {
  font-size: 28px;
  font-weight: 800;
  color: var(--muted);
}

.activation-field input {
  width: 100%;
  min-height: 84px;
  padding: 0 26px;
  border: 1px solid #e6dfd3;
  border-radius: 28px;
  font-size: 32px;
  line-height: 84px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
}

.activation-field input:focus {
  border-color: #d5b06c;
}

.activation-device-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 16px;
}

.activation-copy-btn {
  min-height: 84px;
  border-radius: 999px;
  font-size: 30px;
  font-weight: 800;
  justify-content: center;
}

.activation-status {
  min-height: 34px;
  margin-top: 22px;
  font-size: 24px;
  line-height: 1.6;
  color: var(--muted);
}

.activation-status.success {
  color: #2f7a3f;
}

.activation-status.error {
  color: #b35d37;
}

.activation-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.activation-submit-btn {
  min-width: 220px;
  min-height: 84px;
  padding: 0 34px;
  border-radius: 999px;
  font-size: 30px;
  font-weight: 800;
}

.side-drawer {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(92vw, 1820px);
  height: min(94vh, 1180px);
  padding: 28px 30px 32px;
  border-radius: 44px;
  transform: translate(-50%, calc(-50% + 60px));
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at top, rgba(255, 231, 187, 0.16), transparent 40%);
  border: 1px solid var(--glass-line);
  box-shadow:
    0 36px 90px rgba(8, 8, 8, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(22px) saturate(0.9);
  -webkit-backdrop-filter: blur(22px) saturate(0.9);
  transition: transform 0.26s ease, opacity 0.2s ease;
  z-index: 90;
  overflow: auto;
}

.side-drawer.open {
  transform: translate(-50%, -50%);
  opacity: 1;
  pointer-events: auto;
}

.map-drawer {
  overflow: hidden;
}

.warehouse-drawer {
  overflow: auto;
}

.side-drawer .eyebrow,
.side-drawer h2,
.side-drawer h3,
.side-drawer .close-btn,
.side-drawer .route-entry strong,
.side-drawer .inventory-name {
  color: #fff;
}

.side-drawer h3 {
  font-size: 30px;
}

.section-block {
  margin-top: 22px;
}

.map-canvas-wrap {
  margin-top: 12px;
  min-height: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

#china-map-canvas {
  width: min(100%, 1780px);
  height: auto;
  max-height: none;
  aspect-ratio: 1880 / 1020;
  display: block;
  background: transparent;
  margin: 0 auto;
}

.map-focus {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.map-drawer .section-block h3 {
  display: none;
}

.map-hover-info {
  margin-top: 12px;
  min-height: 70px;
  padding: 14px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  line-height: 1.45;
}

.map-stat {
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-size: 17px;
}

.map-stat strong {
  font-size: 22px;
  color: #fff;
}

.route-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.route-entry {
  display: flex;
  gap: 14px;
  padding: 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.route-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.22);
}

.meta-row {
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.74);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(286px, 1fr));
  gap: 24px;
}

.inventory-card {
  min-height: 320px;
  padding: 20px 18px 22px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.inventory-thumb {
  width: 204px;
  height: 204px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
}

.inventory-thumb img {
  max-width: 182px;
  max-height: 182px;
  object-fit: contain;
}

.inventory-name {
  margin-top: 16px;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.inventory-meta {
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.74);
}

.inventory-order {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 18px;
  line-height: 1;
}

.setup-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(98vw, 1760px);
  max-height: calc(100vh - 30px);
  overflow: hidden;
  padding: 30px 34px 28px;
  border-radius: 44px;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 34px 88px rgba(36, 28, 18, 0.2);
}

.setup-grid,
.chapter-grid {
  display: grid;
  gap: 18px;
}

.chapter-grid {
  margin-top: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.setup-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 22px;
}

.setup-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 22px;
  background: rgba(247, 243, 236, 0.92);
}

.setup-inline-field-wide {
  min-width: 430px;
}

.setup-inline-field span {
  font-size: 24px;
  font-weight: 800;
  color: var(--muted);
}

.setup-minute-input {
  width: 138px;
  border: 1px solid #e6dfd3;
  border-radius: 18px;
  min-height: 58px;
  padding: 10px 16px;
  font-size: 26px;
  text-align: center;
  font-family: inherit;
  outline: none;
  background: #fff;
}

.setup-name-preset {
  min-width: 160px;
  border: 1px solid #e6dfd3;
  border-radius: 18px;
  min-height: 58px;
  padding: 0 18px;
  font-size: 22px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.setup-name-preset:focus {
  border-color: #d5b06c;
}

.setup-inline-action {
  min-width: 108px;
  min-height: 58px;
  padding: 0 18px;
  font-size: 22px;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.setup-minute-input:focus {
  border-color: #d5b06c;
}

.setup-column {
  display: grid;
  grid-template-rows: repeat(7, minmax(0, 1fr));
  gap: 21px;
}

.setup-stage-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 138px;
  gap: 14px;
  align-items: center;
}

.setup-stage-index {
  font-size: 22px;
  font-weight: 800;
  color: var(--muted);
  text-align: right;
}

.field-block {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.field-block span {
  font-size: 28px;
  color: var(--muted);
}

.field-block input {
  width: 100%;
  border: 1px solid #e6dfd3;
  border-radius: 22px;
  padding: 18px 20px;
  font-size: 30px;
  font-family: inherit;
  outline: none;
}

.field-block input:focus {
  border-color: #d5b06c;
}

.preview-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.preview-chip-list.is-hidden {
  display: none;
}

.setup-name-input,
.setup-word-input {
  width: 100%;
  border: 1px solid #e6dfd3;
  border-radius: 20px;
  height: 68px;
  padding: 0 18px;
  line-height: 68px;
  box-sizing: border-box;
  font-size: 28px;
  font-family: inherit;
  outline: none;
  color: var(--ink);
}

.setup-word-input {
  text-align: center;
  padding-left: 32px;
  padding-right: 10px;
  text-indent: 10px;
}

.setup-name-input::placeholder,
.setup-word-input::placeholder {
  color: #d1d1d1;
  opacity: 1;
}

.setup-name-input:focus,
.setup-word-input:focus {
  border-color: #d5b06c;
}

.preview-chip {
  padding: 12px 20px;
  border-radius: 999px;
  background: #f5f1ea;
  font-size: 26px;
  font-weight: 700;
}

.setup-modal .ghost-btn,
.setup-modal .solid-btn {
  width: 220px;
  min-height: 62px;
  padding: 10px 18px;
  font-size: 23px;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.reward-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  min-width: 320px;
  max-width: calc(100vw - 24px);
  padding: 18px 24px;
  border-radius: 999px;
  background: rgba(22, 22, 22, 0.92);
  color: #fff;
  text-align: center;
  font-size: 24px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 120;
}

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

.reward-popup-card {
  position: fixed;
  left: 50%;
  top: calc(30%);
  width: min(90vw, 1320px);
  transform: translate(-50%, -50%);
  text-align: center;
}

#reward-fireworks-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
}

.popup-reward-image {
  width: clamp(620px, 54vw, 900px);
  height: clamp(620px, 54vw, 900px);
  object-fit: contain;
  margin-top: -648px;
  filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.24));
}

.popup-reward-image.is-hidden {
  display: none;
}

.reward-popup-card h3 {
  margin-top: -30px;
  font-size: clamp(44px, 3.8vw, 66px);
  line-height: 1.1;
  color: #ffd768;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.reward-popup-card p {
  margin-top: 12px;
  margin-bottom: 12px;
  font-size: clamp(34px, 3vw, 50px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.popup-btn {
  padding: 22px 64px;
  font-size: 42px;
  background: rgba(18, 18, 18, 0.78);
}

@media (max-height: 1100px) {
  .reward-popup-card {
    top: calc(30%);
    width: min(92vw, 1160px);
  }

  .popup-reward-image {
    width: clamp(400px, 36vw, 640px);
    height: clamp(400px, 36vw, 640px);
    margin-top: -520px;
  }

  .reward-popup-card h3 {
    margin-top: -4px;
    font-size: clamp(28px, 2.8vw, 46px);
  }

  .reward-popup-card p {
    font-size: clamp(22px, 2.1vw, 34px);
    margin-bottom: 8px;
  }

  .popup-btn {
    padding: 16px 46px;
    font-size: 34px;
  }
}

@media (max-width: 1180px) {
  .route-board,
  .reward-tray {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .route-board::before,
  .route-board::after {
    display: none;
  }

  .stage-card {
    min-height: 400px;
  }

  .stage-reward-block {
    position: static;
    transform: none;
    margin-top: 22px;
  }

  .route-point,
  .stage-percent,
  .stage-word-editor {
    position: static;
    transform: none;
  }

  .route-point {
    margin-top: 18px;
    justify-content: center;
  }

  .stage-percent {
    margin-top: 14px;
  }

  .stage-word-editor {
    margin-top: 28px;
  }

  .map-focus {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .widget-shell {
    padding: 18px;
  }

  .reward-card {
    width: 100%;
    min-height: auto;
    padding: 22px 18px 30px;
    border-radius: 34px;
  }

  .card-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .card-actions {
    flex-wrap: wrap;
  }

  .card-actions .ghost-btn {
    font-size: 22px;
    padding: 16px 22px;
  }

  .summary-label {
    font-size: 18px;
  }

  .summary-item strong {
    font-size: 18px;
  }

  .stage-level {
    font-size: 38px;
  }

  .stage-chapter {
    margin-top: 18px;
    font-size: 24px;
  }

  .reward-thumb-wrap {
    width: 160px;
    height: 160px;
    border-radius: 28px;
  }

  .reward-thumb {
    max-width: 144px;
    max-height: 144px;
  }

  .reward-name {
    font-size: 24px;
  }

  .panel-bottom-tools {
    flex-direction: column;
  }

  .tool-pill {
    width: 100%;
    font-size: 20px;
  }

  .side-drawer {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    padding: 20px 16px 24px;
    border-radius: 30px;
  }

  .map-focus {
    grid-template-columns: 1fr;
  }

  .route-list,
  .inventory-grid {
    grid-template-columns: 1fr;
  }

  .inventory-card {
    min-height: 210px;
  }

  .setup-modal {
    width: calc(100vw - 20px);
    padding: 20px 16px 24px;
    border-radius: 30px;
    overflow: auto;
  }

  .activation-modal {
    width: calc(100vw - 20px);
    min-height: auto;
    max-height: calc(100vh - 20px);
    padding: 24px 18px 22px;
    border-radius: 28px;
  }

  .activation-grid {
    grid-template-columns: 1fr;
  }

  .activation-field-full {
    grid-column: auto;
  }

  .activation-device-row {
    grid-template-columns: 1fr;
  }

  .chapter-grid {
    grid-template-columns: 1fr;
  }

  .setup-toolbar {
    justify-content: stretch;
    margin-bottom: 18px;
  }

  .setup-inline-field {
    width: 100%;
    justify-content: space-between;
  }

  .setup-stage-row {
    grid-template-columns: 70px minmax(0, 1fr) 112px;
  }

  .setup-stage-index {
    font-size: 20px;
  }

  .field-block span {
    font-size: 20px;
  }

  .field-block input {
    font-size: 22px;
  }

  .setup-name-input,
  .setup-word-input {
    font-size: 22px;
    padding: 12px 14px;
  }

  .setup-inline-field span {
    font-size: 20px;
  }

  .setup-minute-input {
    width: 108px;
    min-height: 48px;
    font-size: 22px;
    padding: 8px 12px;
  }

  .popup-reward-image {
    width: min(84vw, 420px);
    height: min(84vw, 420px);
    margin-top: -260px;
  }

  .reward-popup-card h3 {
    font-size: 40px;
  }

  .reward-popup-card p {
    font-size: 32px;
  }

  .popup-btn {
    padding: 18px 44px;
    font-size: 34px;
  }
}
