/* Screen layouts share the shell's available height, rather than viewport offsets. */
.screen-root.board-content {
  background: linear-gradient(180deg, rgba(8, 17, 27, .45), rgba(8, 17, 27, .12)), url('./assets/backgrounds/board.webp') center 62% / cover;
  border-radius: 0;
}
.board-playfield { align-items: center; padding: 1px; }
.board-grid {
  transform: none;
  aspect-ratio: auto;
  gap: 3px;
  padding: 6px;
  border: 2px solid #94754c;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(34,48,51,.96), rgba(12,26,32,.97));
  box-shadow: 0 8px 18px rgba(0,0,0,.3), inset 0 0 0 2px rgba(239,214,161,.12);
}
.board-cell {
  aspect-ratio: auto;
  border-color: rgba(191,215,216,.13);
  border-radius: 5px;
  background: linear-gradient(155deg, #304751, #253a43);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09);
}
.board-cell.is-producing {
  animation: board-producer-wait .55s ease-in-out infinite alternate;
}
@keyframes board-producer-wait {
  from { border-color: rgba(191,215,216,.18); }
  to { border-color: rgba(245,199,61,.95); }
}
@media (prefers-reduced-motion: reduce) {
  .board-cell.is-producing { animation: none; border-color: rgba(245,199,61,.95); }
}
.board-cell:nth-child(16n + 2), .board-cell:nth-child(16n + 4),
.board-cell:nth-child(16n + 6), .board-cell:nth-child(16n + 8),
.board-cell:nth-child(16n + 9), .board-cell:nth-child(16n + 11),
.board-cell:nth-child(16n + 13), .board-cell:nth-child(16n + 15) { background: linear-gradient(155deg, #283e47, #20343d); }
.board-cell .item-chip { width: 96%; height: 96%; padding: 1px; border-color: transparent; box-shadow: none; text-shadow: none; }
.board-item-art-slot { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.board-cell .item-art { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important; max-width: none; max-height: none; object-fit: contain; transform: none; filter: brightness(1.12) saturate(1.18) contrast(1.04) drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.board-cell .item-art-fallback { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; max-height: none; }
.board-cell .item-icon-fallback { font-size: clamp(16px, calc(var(--board-grid-height, 400px) / 16), 36px) !important; }
/* The label row used to steal 10px from the art, which is why generator and
   item art painted at ~27-30px on a phone and read as blobs. The label is now
   an absolute corner badge and the art owns the whole chip.
   Class name marks the full-art contract: board-art-full. */
.board-cell .item-chip { grid-template-rows: minmax(0, 1fr); }
.board-cell .item-generator { border-radius: 5px; }
.board-cell .item-lvl {
  position: absolute;
  left: 1px;
  bottom: 1px;
  z-index: 2;
  margin: 0;
  padding: 0 3px;
  border-radius: 6px;
  background: rgba(6, 12, 18, 0.74);
  color: #e8f2fb;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.3;
  pointer-events: none;
  text-shadow: 0 1px 1px rgba(0,0,0,0.8);
}

.board-cell .generator-energy-badge { right: -3px; bottom: -3px; width: 14px; height: 14px; font-size: 8px; }
.board-cell.selected { border-color: #ffe2a0; box-shadow: inset 0 0 0 1px #ffe2a0, 0 0 8px rgba(233,193,112,.28); }
.board-content .orders-container { flex-shrink: 0; }
.board-content .compact-request-panel { display: flex; min-height: 124px; align-items: flex-end; justify-content: center; flex-shrink: 0; position: relative; scroll-snap-align: start; }
.board-content .request-character { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 96px; height: 96px; min-height: 0; overflow: visible; pointer-events: none; }
.board-content .request-character img { display: block; width: 96px; height: 96px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 6px 8px rgba(0,0,0,.5)); }
.board-content .request-demand-card { flex-shrink: 0; }
.board-content .request-submit { width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 12px; font-size: 16px; flex-shrink: 0; }
@media (max-height: 700px) {
  .screen-root.board-content { overflow: hidden; }
  .board-content .board-section { min-height: 0; height: 100%; }
  .board-content .board-playfield { min-height: 0; }
}
.board-content .board-field-ops-slot .btn { min-height: 44px; display: grid; justify-items: center; align-content: center; gap: 2px; }
.board-content .board-field-ops-slot .btn span { font-size: 10px; }
.board-content .board-operation-cost { display: inline-flex; align-items: center; gap: 4px; }
.board-cell .item-lvl { color: #f5eed8; font-size: 9px; text-shadow: 0 1px 2px #07121a; }
.board-cell.merge-candidate { border-color: #e8bc60; }
.board-cell.merge-target { border-color: #ffe6a9; background: #496046; }
body.theme-light .board-cell { background: linear-gradient(150deg, #b8ccca, #93adad); }
body.theme-light .board-cell .item-lvl { color: #122a34; text-shadow: none; }

.screen-root.shop-content { padding: 8px; background: linear-gradient(rgba(9,22,32,.76), rgba(9,22,32,.90)), url('./assets/backgrounds/office.webp') center / cover; }
.shop-screen { max-width: 850px; margin-inline: auto; min-width: 0; padding-bottom: 12px; }
.shop-hero {
  position: relative; overflow: hidden; min-height: 170px; padding: 24px 20px;
  display: flex; align-items: center; border: 1px solid rgba(211,174,103,.35); border-radius: 20px;
  background: linear-gradient(90deg, rgba(12,29,43,.90) 10%, rgba(12,29,43,.25)), url('./assets/backgrounds/office.webp') center / cover;
}
.shop-hero-copy { position: relative; z-index: 1; width: 73%; }
.shop-eyebrow { display: block; color: #e4c284; font-size: 10px; font-weight: 700; letter-spacing: 1.3px; }
.shop-hero h2 { margin: 8px 0; color: #fff7e7; font-size: clamp(21px, 4vw, 30px); line-height: 1.15; }
.shop-hero p { margin: 0; max-width: 350px; color: #bccdd8; font-size: 12px; line-height: 1.5; }
.shop-merchant { position: absolute; right: -8px; bottom: -2px; width: 32%; height: 155px; object-fit: contain; object-position: bottom; }
.shop-wallet { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.shop-wallet span { display: flex; gap: 7px; align-items: center; padding: 6px 10px; background: #0a1826; border: 1px solid #395062; border-radius: 20px; color: #f3e8cc; font-size: 12px; }
.shop-wallet i { color: #f1c976; }
.shop-categories { position: sticky; top: -8px; z-index: 3; display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; background: #101e2b; scrollbar-width: thin; }
.shop-categories a { flex: 0 0 auto; border: 1px solid #3b5366; border-radius: 20px; padding: 8px 12px; color: #d5e3ea; font-size: 12px; text-decoration: none; }
.shop-categories a:hover { background: #2b465b; border-color: #e4c284; }
.shop-catalog { display: grid; gap: 24px; padding: 10px 0; }
.shop-category { scroll-margin-top: 58px; }
.shop-category-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.shop-category-heading h3 { margin: 0; color: #f6ecd9; font-size: 16px; overflow-wrap: anywhere; }
.shop-category-heading > span { flex: 0 0 auto; color: #96abbc; font-size: 11px; }
.shop-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.shop-product { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 14px 12px 12px; border: 1px solid #3d5464; border-radius: 16px; background: linear-gradient(155deg, #253d4f, #182b3a); text-align: center; }
.shop-product-art { display: grid; place-items: center; width: 80px; height: 76px; margin-bottom: 10px; border-radius: 50%; background: radial-gradient(circle, rgba(233,195,117,.2), transparent 68%); }
.shop-product-art img { max-width: 74px; max-height: 72px; object-fit: contain; filter: drop-shadow(0 5px 6px rgba(0,0,0,.25)); }
.shop-product-art > i { color: #f2cd85; font-size: 38px; }
.shop-product h4 { margin: 0 0 6px; color: #f6f1e7; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.shop-product p { margin: 0 0 10px; color: #b1c3d0; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.shop-product-reward { margin-top: auto; margin-bottom: 12px; color: #f2cd85; font-size: 12px; }
.shop-buy { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; border: 1px solid #ffe5a5; border-radius: 11px; background: linear-gradient(#f9d88d, #d4a957); color: #292010; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 #896931; }
.shop-buy:active { transform: translateY(2px); box-shadow: 0 1px 0 #896931; }
.shop-buy:disabled { cursor: default; box-shadow: none; background: #2b4051; border-color: #486075; color: #adbdc9; transform: none; }
.shop-product-note { margin-top: 8px; color: #bcc9d4; font-size: 10px; }
.shop-empty { padding: 36px 16px; text-align: center; border: 1px dashed #496478; border-radius: 16px; color: #b4c8d5; }
.shop-empty > i { font-size: 32px; color: #d7b979; }
body.theme-light .screen-root.shop-content { background: #e2ebe9; }
body.theme-light .shop-categories { background: #e2ebe9; }
body.theme-light .shop-categories a { color: #243f4c; }
body.theme-light .shop-category-heading h3 { color: #203b46; }
body.theme-light .shop-category-heading > span { color: #526c75; }

/* Keep the settings control at the far edge while resource pills can shrink. */
.hud-strip .hud-settings-btn { margin-left: auto; }
.hud-strip .resource-pill:not(.hud-settings-btn) { min-width: 0 !important; }

/* Size words from their panel, including its decorative frame and gaps. */
.word-puzzle-screen { padding: 5px; height: 100%; min-height: 0; overflow: hidden; }
.wp-stage, .wp-stage.is-clue-collapsed {
  height: 100%; min-height: 0; overflow: hidden;
  grid-template-areas: "label" "answer" "clue" "board" "actions";
  grid-template-rows: 42px auto auto minmax(0, 1fr) auto;
  gap: 7px;
}
.wp-back { width: 44px; height: 44px; }
.wp-center-label { margin-left: 46px; max-width: calc(100% - 50px); min-width: 0; }
.wp-answer-panel {
  min-width: 0; min-height: 0; padding: 6px 8px; border-width: 14px 12px;
  border-image-width: 16px 14px;
}
.wp-answer-panel .wp-panel-title { margin: 0 0 6px; }
.wp-slots {
  --wp-slot-gap: clamp(2px, 0.8vw, 5px);
  display: grid;
  grid-template-columns: repeat(var(--wp-slot-count), minmax(0, 1fr));
  justify-content: center;
  gap: var(--wp-slot-gap); min-width: 0;
  width: min(100%, calc((100% - 4 * var(--wp-slot-gap)) / 5 * var(--wp-slot-count) + (var(--wp-slot-count) - 1) * var(--wp-slot-gap)));
  max-width: min(100%, calc(var(--wp-slot-count) * 84px + (var(--wp-slot-count) - 1) * var(--wp-slot-gap)));
  height: auto; align-self: center; justify-self: center;
}
.wp-answer-slot {
  width: 100%; height: auto; min-width: 0; min-height: 0; max-height: none;
  aspect-ratio: 1; padding: 0; font-size: clamp(10px, 4vw, 22px);
}
.wp-letter-board, .wp-stage.is-clue-collapsed .wp-letter-board {
  display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; height: 100%;
  padding: 8px 12px; border-width: 18px 14px; border-image-width: 18px 14px;
}
.wp-letter-board .wp-panel-title { margin: 0 0 8px; }
.wp-tiles {
  height: 100%; min-height: 0; grid-auto-rows: minmax(0, 1fr);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  align-content: stretch; align-items: center; gap: 5px;
}
.wp-letter-tile, .wp-stage.is-clue-collapsed .wp-letter-tile {
  width: min(100%, 52px); height: min(100%, 46px); max-width: 100%; max-height: 46px;
  min-width: 0; min-height: 40px; aspect-ratio: 80 / 87;
  font-size: clamp(15px, 3.8vw, 24px);
}
.wp-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); height: auto; gap: 6px; padding: 0; }
.wp-action-btn { min-width: 44px; min-height: 42px; padding: 5px 8px; gap: 6px; font-size: 13px; }
.wp-action-btn span { min-width: 0; overflow-wrap: anywhere; }
.wp-action-btn:disabled { opacity: .55; cursor: default; }
.wp-clue-tab { grid-area: clue; position: static; width: 100%; height: auto; min-height: 44px; writing-mode: horizontal-tb; border-radius: 8px; }
.wp-clue-toggle { min-width: 44px; min-height: 44px; }
.wp-stage .wp-left-panel, .wp-stage.is-clue-collapsed .wp-left-panel { grid-area: clue; position: static; width: 100%; height: auto; min-height: 0; padding: 12px; transform: none; z-index: auto; }
.wp-stage .wp-left-panel.is-collapsed, .wp-stage.is-clue-collapsed .wp-left-panel.is-collapsed { display: none; }
.wp-stage .wp-left-header { grid-template-columns: minmax(0, 1fr) 44px; margin-bottom: 8px; }
.wp-stage .wp-left-panel h2 small { overflow-wrap: anywhere; line-height: 1.4; }
/* Keep the clue drawer out of the puzzle grid. The general mobile panel rule
   above is for the old inline clue card; this higher-specificity rule preserves
   the drawer behavior used by the current word puzzle view. */
.wp-stage .wp-left-panel.wp-clue-drawer,
.wp-stage.is-clue-collapsed .wp-left-panel.wp-clue-drawer {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 80;
  grid-area: auto;
  width: min(84vw, 330px);
  height: auto;
  max-height: none;
  min-height: 0;
  padding: 32px 18px 16px 62px;
  border: 0;
  border-right: 2px solid rgba(206, 172, 108, .5);
  border-radius: 0 16px 16px 0;
  background: url("./assets/word-puzzle/minimal/left-notebook.webp") left top / 100% 100% no-repeat,
    linear-gradient(180deg, #2b2419, #1a1610);
  box-shadow: 12px 0 34px rgba(0, 0, 0, .6);
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 170ms cubic-bezier(.2, .8, .3, 1);
}
.wp-stage .wp-left-panel.wp-clue-drawer.is-collapsed,
.wp-stage.is-clue-collapsed .wp-left-panel.wp-clue-drawer.is-collapsed {
  display: none;
  pointer-events: none;
}
.wp-stage.is-completed { grid-template-areas: "label" "answer" "board" "complete"; grid-template-rows: 48px auto auto auto; min-height: 0; }
.wp-stage.is-completed .wp-actions, .wp-stage.is-completed .wp-clue-tab, .wp-stage.is-completed .wp-left-panel { display: none; }
.wp-stage.is-completed .wp-letter-board { position: relative; min-height: 220px; }
.wp-stage.is-completed .wp-tiles { opacity: .55; }
.wp-complete-card { grid-area: complete; display: grid; justify-items: center; gap: 12px; padding: 12px 8px; text-align: center; color: #fff2d2; }
.wp-complete-card > span { font-size: 14px; color: #c5d6cf; }
.wp-complete-card .btn { width: min(100%, 280px); min-height: 48px; font-size: 15px; }
.wp-stage .case-solved-stamp { width: max-content; max-width: 80%; min-width: 0; padding: 12px 14px; border: 4px double #943f32; border-radius: 3px; background: rgba(239,217,185,.94); color: #8b3028; font-size: clamp(18px, 4.5vw, 26px); line-height: 1.2; letter-spacing: .06em; text-align: center; transform: translate(-50%, -50%) rotate(-12deg); pointer-events: none; }
.wp-action-btn:focus-visible, .wp-answer-slot:focus-visible, .wp-letter-tile:focus-visible { outline: 2px solid #ffe2a0; outline-offset: 2px; }
@media (max-width: 380px) {
  .wp-action-btn { flex-direction: row; gap: 6px; font-size: 13px; }
  .wp-action-btn i { font-size: 16px; }
  .wp-center-label { margin-left: 40px; max-width: calc(100% - 44px); min-width: 0; padding: 4px 8px; }
}
@media (max-height: 650px) {
  .wp-stage, .wp-stage.is-clue-collapsed { gap: 8px; }
  .wp-answer-panel { border-width: 10px; border-image-width: 10px; padding: 5px 8px; }
  .wp-letter-board, .wp-stage.is-clue-collapsed .wp-letter-board { border-width: 12px 10px; border-image-width: 12px 10px; padding: 5px 8px; }
  .wp-letter-tile, .wp-stage.is-clue-collapsed .wp-letter-tile { font-size: 16px; }
}
@media (max-width: 340px) {
  .wp-tiles { grid-template-columns: repeat(4, minmax(44px, 1fr)); }
}

/* Consolidated puzzle sizing overrides the earlier viewport-sized iterations. */
.screen-root.puzzle-content { overflow: hidden; padding: 6px; background: linear-gradient(rgba(8,17,27,.65), rgba(8,17,27,.8)), url('./assets/backgrounds/board.webp') center / cover; }
.puzzle-content .jigsaw-screen { height: 100%; max-height: 100%; min-height: 0; padding: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: auto; background: transparent; }
.puzzle-content .jg-stage {
  height: 100%; max-height: 100%; min-height: 0; min-width: 0;
  padding: 10px; gap: 8px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "title" "progress" "board" "tray" "actions";
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  border-radius: 12px; overflow: hidden;
  background: linear-gradient(150deg, rgba(29,48,60,.95), rgba(16,30,41,.96));
}
.puzzle-content .jg-title-plaque { grid-area: title; margin: 0 0 0 52px; width: calc(100% - 52px); min-height: 56px; max-width: none; padding: 6px 10px; }
.puzzle-content .jg-title-plaque span { font-size: 16px; }
.puzzle-content .jg-title-plaque strong { display: block; max-width: 100%; font-size: 12px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.puzzle-content .jg-title-plaque small { font-size: 10px; }
.puzzle-content .jg-back { width: 44px; min-width: 44px; height: 48px; left: 10px; top: 10px; }
.puzzle-content .jg-progress-card { grid-area: progress; min-width: 0; width: 100%; max-width: none; min-height: 34px; margin: 0; padding: 5px 10px; grid-template-columns: auto auto minmax(0, 1fr); }
.puzzle-content .jg-progress-rail { min-width: 0; }
.puzzle-content .jg-progress-card strong { font-size: 14px; }
.puzzle-content .jg-board-wrap { grid-area: board; width: 100%; height: 100%; min-width: 0; min-height: 0; contain: size; overflow: hidden; place-items: center; }
.puzzle-content .jg-board-shell { width: 100%; max-width: 100%; min-width: 0; min-height: 0; max-height: 100%; aspect-ratio: var(--jg-board-aspect, 1); align-self: center; --jg-frame-pad: 5px; --jg-board-gap: 0px; }
.puzzle-content .jg-board { width: 100%; height: 100%; min-height: 0; max-width: none; gap: 0; padding: 5px; aspect-ratio: auto; border-width: 2px; }
.puzzle-content .jg-slot { padding: 0; border: 0; border-radius: 0; aspect-ratio: auto; }
.puzzle-content .jg-slot.is-filled { background: transparent; }
.puzzle-content .jg-piece.is-locked { border: 0; filter: none; }
.puzzle-content .jg-piece-shape.is-locked { clip-path: none; }
.puzzle-content .jg-preview { border-width: 2px; padding: 5px; }
.puzzle-content .jg-tray { grid-area: tray; min-width: 0; min-height: 90px; height: 90px; padding: 10px 12px; gap: 12px; grid-auto-columns: 64px; grid-template-columns: none; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; border-radius: 10px; scrollbar-width: thin; scrollbar-color: #94754c #12232e; }
.puzzle-content .jg-tray::-webkit-scrollbar { height: 5px; }
.puzzle-content .jg-tray::-webkit-scrollbar-thumb { background: #94754c; }
.puzzle-content .jg-piece-btn { width: 64px; min-width: 64px; height: 64px; min-height: 64px; touch-action: pan-x; }
.puzzle-content .jg-piece-btn.is-selected { outline: 2px solid #edcb81; outline-offset: 3px; border-radius: 6px; }
.puzzle-content .jg-actions { grid-area: actions; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; min-height: 48px; }
.puzzle-content .jg-action { min-width: 44px; min-height: 48px; padding: 6px 4px; font-size: 12px; line-height: 1.2; gap: 4px; flex-direction: column; transform: none; }
.puzzle-content .jg-action:disabled { opacity: .5; cursor: default; }
.puzzle-content .jg-return { grid-column: 1 / -1; }
.puzzle-content .jg-stage.is-completed { min-height: 0; grid-template-areas: "title" "progress" "board" "actions"; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.puzzle-content .jg-stage.is-completed .jg-tray { display: none; }
.puzzle-content .jg-piece.is-locked { pointer-events: none; }
.puzzle-content .jg-loading { max-width: 100%; text-align: center; overflow-wrap: anywhere; }
.puzzle-content .jg-action i { font-size: 14px; }
.puzzle-content .jg-action span { display: inline; }
.puzzle-content .jg-complete-badge { padding: 8px; max-width: calc(100% - 24px); font-size: 14px; overflow-wrap: anywhere; }
.puzzle-content .jg-action[data-jg-action="preview"] { display: flex; }
.puzzle-content.puzzle-busy .jg-board, .puzzle-content.puzzle-busy .jg-tray { pointer-events: none; }
.puzzle-content .jg-slot.jg-drop-target { background: #426152; box-shadow: inset 0 0 0 2px #edcb81; }
.jg-drag-ghost { position: fixed; left: 0; top: 0; z-index: 10000; pointer-events: none; opacity: .9; margin: 0; }
.shop-buy:focus-visible, .shop-categories a:focus-visible, .jg-action:focus-visible, .jg-slot:focus-visible, .jg-piece-btn:focus-visible { outline: 3px solid #84d0ff; outline-offset: 2px; }
@media (max-width: 340px) { .puzzle-content .jg-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 650px) { .shop-products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 650px) {
  .wp-actions, .puzzle-content .jg-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .puzzle-content .jg-stage { min-height: 0; }
}
@media (max-height: 600px) {
  .puzzle-content .jg-stage { padding: 6px; gap: 5px; }
  .puzzle-content .jg-back { top: 6px; left: 6px; }
  .puzzle-content .jg-title-plaque { min-height: 44px; }
  .puzzle-content .jg-tray { min-height: 76px; height: 76px; grid-auto-columns: 52px; padding: 9px 10px; }
  .puzzle-content .jg-piece-btn { width: 52px; min-width: 52px; height: 52px; min-height: 52px; }
}
@media (max-width: 360px) {
  .shop-hero { padding: 18px 12px; }
  .shop-product { padding: 12px 8px; }
  .shop-product h4 { font-size: 12px; }
  .board-grid { gap: 2px; padding: 4px; }
}

/* Event cards grow with their content and share the screen's vertical scroll. */
.event-screen { padding: 0; min-width: 0; overflow: hidden; }
.event-hero { display: grid; align-content: end; gap: 8px; min-height: 156px; padding: 16px; background-position: center; background-size: cover; }
.event-day-badge { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #c29c58; border-radius: 20px; color: #ffe1a1; background: rgba(17,29,41,.9); font-size: 12px; }
.event-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #f5cf86; }
.event-hero h2 { margin: 0; font-size: clamp(20px, 5vw, 28px); line-height: 1.2; color: #fff3d9; overflow-wrap: anywhere; }
.event-hero p { margin: 0; color: #d6e0e4; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.event-body { display: grid; gap: 18px; padding: 14px; min-width: 0; }
.event-section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.event-section-heading h3 { margin: 0; min-width: 0; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.event-section-heading h3 i { color: var(--accent); margin-right: 4px; }
.event-section-heading > span { font-size: 12px; color: var(--ink-muted); }
.event-task-list { display: grid; gap: 10px; }
.event-task { padding: 12px; min-width: 0; background: var(--surface-2); border: 1px solid rgba(255,255,255,.12); }
.event-task.is-ready { border-color: #78c99c; }
.event-task-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.event-task-description { display: flex; align-items: start; gap: 8px; min-width: 0; flex: 1 1 180px; }
.event-task-description > i { flex: 0 0 18px; margin-top: 3px; color: var(--accent); }
.event-task-description > div { min-width: 0; }
.event-task-description strong { display: block; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.event-task-reward { display: block; margin-top: 5px; color: var(--ink-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.event-task-reward i { color: var(--accent); }
.event-task-count { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--ink-muted); }
.event-task.is-claimed .event-task-count { color: var(--ok); }
.event-task-actions { display: flex; justify-content: end; margin-top: 10px; }
.event-task-actions .btn { min-height: 48px; min-width: 130px; max-width: 100%; padding: 10px 14px; font-size: 14px; border-radius: 10px; white-space: normal; }
.event-milestone-claim { min-height: 48px; padding: 12px; border-radius: 12px; font-size: 15px; white-space: normal; line-height: 1.4; }
@media (max-width: 360px) {
  .event-body { padding: 10px; }
  .event-task-actions .btn { width: 100%; }
}
