@font-face {
  font-family: "Fusion Pixel";
  src: url("/fonts/fusion-pixel-12.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c1016;
  --panel: #141922;
  --line: #31384a;
  --text: #e7ecf5;
  --dim: #93a0b5;
  --warm: var(--warm);
  --warm-hi: var(--warm-hi);
  --warm-lo: var(--warm-lo);
  --ink: var(--ink);
  color: var(--text);
  background: var(--bg);
  font-family: "Fusion Pixel", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.45;
  font-smooth: never;
  -webkit-font-smoothing: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
button, input { font: inherit; color: inherit; }
button {
  background: var(--panel);
  border: 2px solid var(--line);
  padding: 8px 10px;
  min-height: 32px;
  cursor: pointer;
}
button:hover, button:focus-visible { border-color: var(--warm); outline: none; }
button.on { background: var(--warm); color: var(--ink); border-color: var(--warm); }
.dim { color: var(--dim); }

/* 画布铺满屏幕时会超出视口，放在固定容器里裁掉，避免手机把布局宽度撑大 */
#stage { position: fixed; inset: 0; overflow: hidden; }
#scene {
  position: absolute;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  background: #070b12;
}

#gate {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(8, 10, 16, 0.28);
  border: 0;
  width: 100%;
}
#gate .mark { font-size: 36px; letter-spacing: 4px; }
#gate .playbox {
  background: var(--warm);
  color: var(--ink);
  padding: 12px 28px;
  border: 2px solid #ffd89a;
  font-size: 24px;
}
#gate .hint { color: var(--text); background: var(--panel); padding: 6px 8px; border: 2px solid var(--line); }

#top, #dock, .edge, .sheet, .pop { z-index: 3; }
#top {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(10px + env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  pointer-events: none;
}
#top button, .top-actions { pointer-events: auto; }
#cname, #wclock { font-size: 24px; line-height: 1.2; text-shadow: 2px 2px 0 #070b12; }
#cmeta { margin-top: 4px; color: var(--text); background: var(--panel); display: inline-block; padding: 4px 6px; border: 2px solid var(--line); font-size: 14px; }
#fcast { margin-top: 4px; color: var(--dim); background: var(--panel); display: inline-block; padding: 2px 6px; border: 2px solid var(--line); font-size: 12px; }
#fcast:empty { display: none; }
#fcast a { color: var(--warm); }
.top-actions { display: flex; gap: 6px; }

.edge {
  position: absolute;
  top: 42%;
  width: 36px;
  height: 48px;
  font-size: 24px;
  background: rgba(20, 25, 34, 0.88);
}
.edge.right { right: 8px; }
#prev-city { left: 8px; }

#dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(12, 16, 22, 0.92);
  border-top: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row { display: flex; gap: 8px; align-items: center; }
.wrap { flex-wrap: wrap; }
.track { flex: 1; min-width: 140px; }
#title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#time { color: var(--dim); }
input[type="range"] {
  width: 100%;
  accent-color: var(--warm);
  height: 16px;
}
.vol { display: flex; align-items: center; gap: 6px; color: var(--dim); }
.vol input { width: 88px; }
.seg { display: flex; }
select {
  background: var(--panel);
  color: var(--text);
  border: 2px solid var(--line);
  padding: 6px 8px;
  min-height: 32px;
  font: inherit;
  cursor: pointer;
}
select:focus-visible { border-color: var(--warm); outline: none; }
.seg button { margin: 0; }
.seg button + button { border-left: 0; }

#eq { image-rendering: pixelated; background: #0c1016; border: 2px solid var(--line); flex: none; }

.sheet, .pop {
  position: absolute;
  inset: 0;
  background: #0c1016;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
.sheet[hidden], .pop[hidden], #gate[hidden] { display: none; }
.sheet-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-bottom: 2px solid var(--line);
}
.sheet-bar b { font-size: 16px; }
.sheet-bar .dim { flex: 1; }
#grid, #tracks { overflow: auto; padding: 10px; flex: 1 1 auto; min-height: 0; }
#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  text-align: left;
  background: #10151e;
}
.card canvas {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #070b12;
}
.card span { padding: 6px 8px 0; }
.card .en { color: var(--dim); padding-bottom: 8px; }
.card.on { background: #10151e; color: var(--text); border-color: var(--warm); }

.track-btn { display: flex; justify-content: space-between; width: 100%; margin-bottom: 6px; }
.track-btn.on { background: #1c2433; color: var(--warm); border-color: var(--warm); }

.pop { padding: 12px; gap: 8px; }
#clockline { font-size: 16px; }
#phone-hint { max-width: 520px; }

body.ui-off #top,
body.ui-off #dock,
body.ui-off .edge { opacity: 0; pointer-events: none; }

@media (max-width: 720px) {
  #cmeta { max-width: 70vw; }
  .edge { top: auto; bottom: 128px; }
  #title { max-width: 46vw; }
}

@media (max-height: 520px) {
  #cname, #wclock { font-size: 16px; }
  #dock { gap: 4px; padding-top: 4px; }
  button { min-height: 28px; padding: 4px 8px; }
}

/* 顶部信息：文字块占满可用宽度，按钮不换行 */
#cmeta, #fcast { display: block; width: fit-content; max-width: 100%; box-sizing: border-box; }
#top button, .top-actions select { white-space: nowrap; }
.top-actions select { max-width: 150px; }
/* 手机：语言和两个按钮竖排在右上角，文字块在左边占满 */
@media (max-width: 720px) {
  .top-actions { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; flex-direction: column; align-items: flex-end; gap: 4px; }
  .top-actions select { max-width: 96px; }
  #top > div:first-child { padding-right: 110px; min-width: 0; }
  #cmeta, #fcast { width: 100%; }
}
/* 底部小动物的控件 */
.pet-ctl { display: flex; align-items: center; gap: 6px; color: var(--dim); }
#pet-size { width: 96px; }

/* ===== 自适应：手机竖屏（9:16）===== */
@media (orientation: portrait) and (max-width: 600px) {
  #top { left: 10px; right: 10px; top: calc(8px + env(safe-area-inset-top)); }
  #cname, #wclock { font-size: 20px; }
  #cmeta { font-size: 12px; }
  #fcast { font-size: 10.5px; }
  .top-actions { top: calc(8px + env(safe-area-inset-top)); }
  #dock { padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 6px; }
  #dock .row { gap: 5px; flex-wrap: wrap; }
  #dock button, #dock select { font-size: 12px; padding: 5px 7px; min-height: 30px; }
  #dock .track { flex: 1 1 140px; min-width: 0; }
  #eq { display: none; }
  .vol input, .pet-ctl input[type="range"] { width: 72px; }
  #pet-size { width: 72px; }
  .edge { top: 36%; width: 30px; height: 40px; font-size: 20px; }
  .top-actions select { max-width: 96px; }
}

/* ===== 自适应：手机横屏（16:9，矮）===== */
@media (orientation: landscape) and (max-height: 500px) {
  #top { top: calc(6px + env(safe-area-inset-top)); }
  #cname, #wclock { font-size: 15px; }
  #cmeta { font-size: 11px; padding: 2px 5px; }
  #fcast { font-size: 10px; padding: 1px 5px; }
  #dock { padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); gap: 4px; }
  #dock .row { gap: 4px; }
  #dock button, #dock select { font-size: 11px; padding: 3px 6px; min-height: 26px; }
  #eq { display: none; }
  .track { min-width: 120px; }
  .top-actions select { max-width: 110px; }
  .edge { width: 28px; height: 36px; font-size: 18px; }
}

/* ===== 更友好的按钮：圆角、柔和、按下有回弹（画面仍是像素）===== */
button, select { border-radius: 12px; }
button {
  background: #1a2130;
  border-color: var(--line);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}
button:hover, button:focus-visible { border-color: var(--warm); }
button:active { transform: scale(0.97); }
button.on {
  background: var(--warm);
  color: var(--ink);
  border-color: #ffd89a;
  box-shadow: 0 2px 8px rgba(240, 180, 90, 0.35);
}
button.round {
  min-width: 62px; height: 42px; min-height: 42px; padding: 0 10px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
}
select { background: #1a2130; border-color: var(--line); border-radius: 12px; }
.seg { gap: 4px; }
.seg button, .seg button + button { border-left: 2px solid var(--line); border-radius: 999px; }
.seg button:first-child { border-left: 2px solid var(--line); }
.seg button.on { border-left-color: #ffd89a; }
#cmeta, #fcast { border: none; border-radius: 12px; background: rgba(14, 18, 26, 0.82); }
.edge { border-radius: 50%; }

/* 底栏：上边圆角，像一张托起的卡片 */
#dock {
  border-top: none;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, rgba(14, 18, 26, 0.92), rgba(10, 13, 19, 0.97));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
}
/* 二级面板：点「更多」展开，分组排列，超出时在里面滚动 */
#drawer { display: flex; flex-direction: column; gap: 10px; max-height: 48vh; overflow-y: auto; padding-top: 4px; }
#drawer[hidden] { display: none; }
.grp { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); }
.grp-title { font-size: 11px; color: var(--dim); letter-spacing: 0.04em; }
.grp .row { gap: 6px; }

/* ===== 手机：城市列表像苹果天气，一行一座城，左边名字，右边小缩略图 ===== */
@media (max-width: 720px), (max-height: 500px) {
  #grid { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
  .card {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 104px 1fr;
    column-gap: 12px;
    align-items: center;
    padding: 8px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid #232b3b;
    width: 100%;
  }
  .card canvas { grid-column: 1; grid-row: 1 / span 2; width: 104px; height: 58px; border-radius: 8px; }
  .card > span:first-of-type { grid-column: 2; grid-row: 1; padding: 0; font-size: 16px; }
  .card .en { grid-column: 2; grid-row: 2; padding: 0 0 0; font-size: 12px; color: var(--dim); }
  .card.on { border-color: var(--warm); background: #1c2230; }
}

/* 桌面和宽屏：二级面板的分组横向排开，少占高度 */
@media (min-width: 721px) and (min-height: 501px) {
  #drawer { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
  #drawer .grp { flex: 1 1 280px; }
}

/* ===== 精细化的界面：统一的颜色和质感（参考但不照搬，保持我们的像素风）===== */
:root {
  --glass: rgba(12, 16, 22, 0.74);
  --glass-strong: rgba(12, 16, 22, 0.9);
  --glass-line: rgba(255, 255, 255, 0.08);
  --accent-2: #ffd89a;
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.38);
}

/* 画面边缘的暗角，让中间的场景更有层次（不挡操作） */
#stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 42%, transparent 58%, rgba(4, 6, 10, 0.42) 100%);
  pointer-events: none;
}

/* 顶部信息：标题更醒目，信息块做成磨砂玻璃 */
#cname, #wclock { text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 18px rgba(0, 0, 0, 0.25); letter-spacing: 0.02em; }
#cmeta, #fcast {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 5px 10px;
}
#cmeta { box-shadow: var(--shadow-soft); }
#fcast { color: var(--dim); }

/* 底栏：磨砂玻璃卡片，顶边一条细光 */
#dock {
  background: linear-gradient(180deg, rgba(14, 18, 26, 0.80), var(--glass-strong));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--glass-line);
}

/* 按钮：轻微渐变和高光，按下有回弹 */
button {
  background: linear-gradient(180deg, #232c3e 0%, #1a2130 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 6px rgba(0, 0, 0, 0.3);
  color: #e6ecf7;
  letter-spacing: 0.01em;
}
button:hover { background: linear-gradient(180deg, #283248 0%, #1e2638 100%); }
button.on {
  background: linear-gradient(180deg, var(--warm-hi) 0%, var(--warm-lo) 100%);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 10px rgba(240, 180, 90, 0.35);
}
button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.edge { background: var(--glass-strong); border: 1px solid var(--glass-line); box-shadow: var(--shadow-soft); }

/* 城市网格（桌面）：卡片有轻微上浮和阴影 */
.card {
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  border-radius: 12px;
  overflow: hidden;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.card canvas { border-radius: 0; }

/* 细滚动条 */
#drawer, #grid, #tracks { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* 文字层级：次要信息更淡、更小 */
.dim, .grp-title { color: #8e9ab0; }

/* 城市标题：名字下面一句，像一张明信片的小字 */
#mood { font-size: 13px; color: var(--dim); margin-top: 2px; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); letter-spacing: 0.02em; }
/* 洲的标签 */
#regions { display: flex; gap: 6px; overflow-x: auto; padding: 10px 10px 0; scrollbar-width: none; }
#regions::-webkit-scrollbar { display: none; }
.region-btn { flex: none; border-radius: 999px; padding: 5px 12px; min-height: 30px; font-size: 12px; }
.region-btn.on { background: linear-gradient(180deg, var(--warm-hi) 0%, var(--warm-lo) 100%); color: var(--ink); border-color: #ffd89a; }

/* 左右切城的圆形按钮：宽高用同一个变量，永远是正圆，不随屏幕压扁 */
:root { --edge-size: clamp(30px, 7vmin, 46px); }
.edge {
  width: var(--edge-size);
  height: var(--edge-size);
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 0;
  font-size: calc(var(--edge-size) * 0.5);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== 城市列表：默认完整显示，按洲分组，小标题跟着滚动 ===== */
#grid { position: relative; display: block; }
.region-sec { margin-bottom: 14px; }
.region-title {
  position: sticky; top: 0; z-index: 2;
  margin: 0; padding: 8px 4px 6px;
  font-size: 12px; font-weight: normal; letter-spacing: 0.08em;
  color: var(--dim); background: rgba(12, 16, 22, 0.94);
}
.region-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
@media (max-width: 720px), (max-height: 500px) {
  .region-cards { display: flex; flex-direction: column; gap: 8px; }
}
/* 洲的标签栏不被压缩（之前在竖向布局里会被压成细条，文字看不见） */
#regions { flex: none; }

/* 页脚的小链接：关于与隐私政策 */
.legal-links { margin: 14px 0 0; font-size: 12px; text-align: center; opacity: .75; }
.legal-links a { color: inherit; }

/* 顶部广告条：只在桌面宽屏显示，居中一条，画面从它下面开始（不压住画面，也不做悬浮广告） */
#ad-top { position: fixed; top: 0; left: 0; right: 0; height: 100px; z-index: 2; display: flex; align-items: center; justify-content: center; background: #0c1016; }
#ad-top[hidden] { display: none; }
#ad-top ins { display: block; width: min(728px, 90vw); }
body.ad-top #stage { top: 100px; }

/* 手机版（App）底部 AdMob 横幅：底栏放在横幅上方（横幅由原生层绘制） */
body.native-ad #dock { bottom: 50px; }

/* 世界时钟：放在城市名下面，字号与城市名一致 */
#wclock { color: #f4eee2; font-variant-numeric: tabular-nums; }

/* 竖屏背景：模糊的画面补满屏幕 */
#bgfill { display: none; position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(10px) brightness(0.55); z-index: 0; pointer-events: none; }
body.portrait #bgfill { display: block; }

/* 收藏 */
#btn-fav.on { background: linear-gradient(180deg, var(--warm-hi) 0%, var(--warm-lo) 100%); color: var(--ink); }
.favs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line, var(--line)); }
.favs-title { font-size: 12px; color: var(--text, var(--text)); margin-right: 4px; }
.fav-chip { border-radius: 999px; padding: 4px 10px; font-size: 12px; min-height: 28px; }
.fav-chip.on { background: linear-gradient(180deg, var(--warm-hi) 0%, var(--warm-lo) 100%); color: var(--ink); }

/* 调色板 */
.palette-row { align-items: center; }
.palette { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.palette.disabled { opacity: 0.4; pointer-events: none; }
.swatch { width: 22px; height: 22px; min-height: 22px; padding: 0; border-radius: 4px; border: 2px solid var(--line); cursor: pointer; }
.swatch.on { outline: 2px solid var(--warm); outline-offset: 1px; }
.swatch.default { background: repeating-linear-gradient(45deg, #3a4456 0 4px, #222a38 4px 8px); font-size: 0; }

/* 邀请打分（手机版） */
.rate { position: fixed; inset: 0; background: rgba(4, 6, 10, 0.6); display: flex; align-items: center; justify-content: center; z-index: 30; padding: 20px; }
.rate[hidden] { display: none; }
.rate-box { background: var(--panel); border: 2px solid var(--line); color: var(--text); padding: 18px; max-width: 320px; width: 100%; box-sizing: border-box; }
.rate-box b { display: block; font-size: 17px; margin-bottom: 8px; }
.rate-box p { font-size: 14px; line-height: 1.5; margin: 0 0 14px; color: var(--dim); }
.rate-box .row { gap: 8px; }
.rate-box button.primary { background: linear-gradient(180deg, var(--warm-hi) 0%, var(--warm-lo) 100%); color: var(--ink); }

/* 右上角「详情」面板 */
.info-pop { position: fixed; top: 64px; right: 12px; width: min(340px, calc(100vw - 24px)); max-height: 60vh; overflow-y: auto; background: rgba(14, 18, 26, 0.95); border: 2px solid var(--line); color: var(--text); padding: 10px 12px 12px; z-index: 12; box-sizing: border-box; }
.info-pop[hidden] { display: none; }
.info-pop .sheet-bar { padding: 0 0 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.info-pop #mood { font-size: 13px; color: var(--dim); margin: 0 0 6px; }
.info-pop p { margin: 0 0 6px; font-size: 13px; line-height: 1.5; }
.info-pop #fcast { display: block; margin-top: 6px; background: none; border: none; padding: 0; color: var(--dim); font-size: 12px; }
.info-pop #fcast:empty { display: none; }
#btn-info.on { background: linear-gradient(180deg, var(--warm-hi) 0%, var(--warm-lo) 100%); color: var(--ink); }

/* 小动物与杯子面板 */
.pet-pop { width: min(360px, calc(100vw - 24px)); max-height: 70vh; }
.pet-pop .tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.pet-pop .tab { flex: 1; border-radius: 8px; padding: 6px 8px; min-height: 30px; font-size: 13px; }
.pet-pop .tab.on { background: linear-gradient(180deg, var(--warm-hi) 0%, var(--warm-lo) 100%); color: var(--ink); }
.pet-pop .sub-title { font-size: 12px; color: var(--dim); margin: 10px 0 4px; }
.pet-pop .row { margin-bottom: 8px; align-items: center; }
.pet-pop select { max-width: 100%; }
.pet-pop .seg button { font-size: 12px; }

/* 首次提示（条款和隐私政策） */
.consent { position: fixed; left: 12px; right: 12px; bottom: 90px; z-index: 40; display: flex; align-items: center; gap: 10px; background: rgba(14, 18, 26, 0.96); border: 2px solid var(--line); color: var(--text); padding: 10px 12px; font-size: 13px; line-height: 1.5; max-width: 560px; margin: 0 auto; box-sizing: border-box; }
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1; }
.consent a { color: var(--warm); }
.consent button { flex: none; }
/* 更多里的条款与隐私入口：和按钮一样的样式 */
a.linkbtn { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 5px 10px; border: 2px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-size: 12px; box-sizing: border-box; }

/* 配色：默认是琥珀色；其它配色只换界面的颜色（画面本身不变） */
:root[data-theme="night"] { --bg: #070b16; --panel: #121a2e; --line: #2a3a5c; --text: #e4eeff; --dim: #8fa6c8; --warm: #7cc4ff; --warm-hi: #a8d8ff; --warm-lo: #5aa8e8; --ink: #06101f; }
:root[data-theme="matcha"] { --bg: #0b130f; --panel: #14201a; --line: #2d4636; --text: #e8f2e4; --dim: #9bb3a0; --warm: #9fd08c; --warm-hi: #bfe6a8; --warm-lo: #7fb86a; --ink: #10190f; }
:root[data-theme="sakura"] { --bg: #160d12; --panel: #24161c; --line: #4a2c38; --text: #fbe9ef; --dim: #c9a2b0; --warm: #f2a7bd; --warm-hi: #ffc4d4; --warm-lo: #e0839e; --ink: #2a1219; }
:root[data-theme="mono"] { --bg: #0e0e0e; --panel: #181818; --line: #3a3a3a; --text: #f2f2f2; --dim: #9a9a9a; --warm: #d8d8d8; --warm-hi: #ffffff; --warm-lo: #b0b0b0; --ink: #111111; }

/* 番茄钟倒计时：屏幕上方居中，白色大号数字 */
.pomo-home { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 4; color: #ffffff; font-size: 48px; line-height: 1.1; font-variant-numeric: tabular-nums; text-shadow: 3px 3px 0 #070b12, 0 0 18px rgba(0, 0, 0, 0.35); white-space: nowrap; pointer-events: none; }
.pomo-home[hidden] { display: none; }
@media (max-width: 600px) { .pomo-home { font-size: 36px; top: 8px; } }
@media (max-height: 500px) { .pomo-home { font-size: 32px; top: 6px; } }
/* 祝贺 */
.congrats { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 46; background: rgba(14, 18, 26, 0.96); border: 2px solid var(--warm); color: #ffffff; padding: 18px 22px; text-align: center; max-width: min(360px, 88vw); box-sizing: border-box; cursor: pointer; }
.congrats[hidden] { display: none; }
.congrats b { display: block; font-size: 26px; color: var(--warm-hi); margin-bottom: 6px; }
.congrats p { margin: 0; font-size: 14px; line-height: 1.5; color: #e8eef8; }

/* 手机版（App）：面板顶部让出状态栏的高度，标题和关闭按钮不会被挡住 */
body.native .sheet, body.native .pop { padding-top: 34px; }
body.native .info-pop, body.native .pet-pop { top: 44px; }

/* 装饰品 gallery */
.deco-pop { width: min(380px, calc(100vw - 24px)); max-height: 72vh; }
.deco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; margin-top: 8px; }
.deco-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; min-height: 0; font-size: 10px; line-height: 1.2; }
.deco-card.on { border-color: var(--warm); background: var(--panel); outline: 2px solid var(--warm); outline-offset: -2px; }
.deco-thumb { image-rendering: pixelated; width: 100%; max-width: 64px; height: auto; }
.deco-card span { text-align: center; word-break: keep-all; }

/* 计时时，窄屏隐藏日期时间行，让出中间给倒计时 */
@media (max-width: 600px) { body.focusing #wclock { visibility: hidden; } }
