/* Word Search Daily — 游戏自有像素阅读室皮肤。
 *
 * 几何来自 /assets/css/tokens.css 的 --pixel-* 令牌；Shell 的 pixel.css
 * 不进入 iframe。这里所有颜色、边框、阴影与动画均为游戏本地样式：
 * 硬边框、0 圆角、硬偏移阴影，无渐变、模糊、发光或玻璃半透明。
 */

:root {
  color-scheme: light;

  --ws-grid: var(--pixel-grid-size);
  --ws-border: var(--pixel-border-width);
  --ws-border-thin: var(--pixel-border-thin);
  --ws-shadow-offset: var(--pixel-shadow-offset);
  --ws-shadow-lg: var(--pixel-shadow-offset-lg);
  --ws-font: var(--pixel-ui-font);

  --ws-bg: #f2ecdd;
  --ws-bg-2: #e8dfcb;
  --ws-surface: #fffdf7;
  --ws-surface-2: #f6f0e2;
  --ws-surface-3: #ede4d1;
  --ws-ink: #1e2b30;
  --ws-ink-soft: #5b6a6c;
  --ws-line: #cfc4ae;
  --ws-line-strong: #1e2b30;
  --ws-accent: #1f5f5b;
  --ws-accent-strong: #174844;
  --ws-accent-soft: #d9ece6;
  --ws-on-accent: #fffdf7;
  --ws-warm: #b17a33;
  --ws-warm-soft: #f5e5c9;
  --ws-found: #1d7a5f;
  --ws-found-soft: #cfece0;
  --ws-cell-found-bg: #c8e9dc;
  --ws-cell-found-ink: #0e3f34;
  --ws-wrong: #b23a34;
  --ws-wrong-soft: #f7ddd9;
  --ws-cell-bg: #fffdf7;
  --ws-cell-border: #cfc4ae;
  --ws-shadow: #1e2b30;
  --ws-scrim: rgba(16, 28, 28, 0.78);
  --ws-scene-opacity: 0.22;

  --ws-fast: 90ms;
  --ws-med: 180ms;
  --ws-ease: steps(2, end);

  --ws-sprite-size: 400% 200%;
  --ws-sprite-pos: 0% 0%;
}

[data-theme="dark"] {
  color-scheme: dark;

  --ws-bg: #0d1717;
  --ws-bg-2: #091111;
  --ws-surface: #162121;
  --ws-surface-2: #1b2928;
  --ws-surface-3: #223332;
  --ws-ink: #edf5f0;
  --ws-ink-soft: #a2b4ad;
  --ws-line: #2f4440;
  --ws-line-strong: #edf5f0;
  --ws-accent: #74d6c2;
  --ws-accent-strong: #a6e9da;
  --ws-accent-soft: #173b36;
  --ws-on-accent: #07231f;
  --ws-warm: #e8b26a;
  --ws-warm-soft: #382b18;
  --ws-found: #7fe0b4;
  --ws-found-soft: #143d2e;
  --ws-cell-found-bg: #1b4a3a;
  --ws-cell-found-ink: #cdf8e4;
  --ws-wrong: #ff8a80;
  --ws-wrong-soft: #3d1d1a;
  --ws-cell-bg: #172322;
  --ws-cell-border: #2f4440;
  --ws-shadow: #07050f;
  --ws-scrim: rgba(3, 9, 9, 0.86);
  --ws-scene-opacity: 0.34;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ws-ink);
  background: var(--ws-bg);
  font-family: var(--ws-font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: none;
  text-rendering: optimizeSpeed;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button,
select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

button:focus-visible,
select:focus-visible {
  outline: var(--ws-border) solid var(--color-focus);
  outline-offset: 2px;
}

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

/* 精灵回退位置；game.js 加载 JSON 后会覆盖。 */
[data-sprite="hero"] { --ws-sprite-pos: 0% 0%; }
[data-sprite="coin"] { --ws-sprite-pos: 33.333% 0%; }
[data-sprite="hazard"] { --ws-sprite-pos: 66.667% 0%; }
[data-sprite="effect"] { --ws-sprite-pos: 100% 0%; }
[data-sprite="tile"] { --ws-sprite-pos: 0% 100%; }
[data-sprite="card"] { --ws-sprite-pos: 33.333% 100%; }
[data-sprite="star"] { --ws-sprite-pos: 66.667% 100%; }
[data-sprite="spark"] { --ws-sprite-pos: 100% 100%; }

/* 应用框架 -------------------------------------------------------------- */

.ws-app {
  --board-size: 320px;
  --cell-size: 32px;

  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 4px max(4px, min(env(safe-area-inset-right, 0px), 6px))
    max(6px, min(env(safe-area-inset-bottom, 0px), 10px))
    max(4px, min(env(safe-area-inset-left, 0px), 6px));
}

/* 背景场景 -------------------------------------------------------------- */

.ws-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-color: var(--ws-bg);
  background-image: url("./assets/word-search-daily-light.png");
  background-position: center;
  background-size: cover;
  image-rendering: pixelated;
  opacity: var(--ws-scene-opacity);
  pointer-events: none;
}

[data-theme="dark"] .ws-scene {
  background-image: url("./assets/word-search-daily-dark.png");
}

/* 页头 ------------------------------------------------------------------ */

.ws-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
  padding: 4px;
  border: var(--ws-border) solid var(--ws-line-strong);
  background: var(--ws-surface);
  box-shadow: var(--ws-shadow-offset) var(--ws-shadow-offset) 0 var(--ws-shadow);
}

.ws-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ws-brand__mark {
  width: 34px;
  height: 34px;
  flex: none;
  border: var(--ws-border-thin) solid var(--ws-line-strong);
  background-color: var(--ws-accent-soft);
  background-image: url("./assets/pixel/word-search-daily-sprites.png");
  background-repeat: no-repeat;
  background-size: var(--ws-sprite-size);
  background-position: var(--ws-sprite-pos);
  image-rendering: pixelated;
}

.ws-brand__copy {
  min-width: 0;
}

.ws-brand__copy h1 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ws-brand__copy h1 span {
  color: var(--ws-accent-strong);
}

.ws-brand__copy p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--ws-ink-soft);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ws-header__right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.ws-hud {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.ws-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 46px;
  padding: 2px 4px;
  border: var(--ws-border-thin) solid var(--ws-line-strong);
  background: var(--ws-surface-2);
  line-height: 1;
  text-align: right;
}

.ws-stat__label {
  color: var(--ws-ink-soft);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}

.ws-stat strong {
  color: var(--ws-ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}

.ws-stat--found {
  min-width: 58px;
}

.ws-theme {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: var(--touch-target-min);
  padding-left: 6px;
  border: var(--ws-border-thin) solid var(--ws-line-strong);
  background: var(--ws-surface);
  box-shadow: 2px 2px 0 var(--ws-shadow);
}

.ws-theme::after {
  content: "v";
  position: absolute;
  top: 50%;
  right: 6px;
  color: var(--ws-ink-soft);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.ws-theme__label {
  color: var(--ws-ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ws-theme select {
  min-height: var(--touch-target-min);
  padding: 0 18px 0 4px;
  border: 0;
  background: transparent;
  color: var(--ws-ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

/* 主布局 ---------------------------------------------------------------- */

.ws-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 1020px;
  min-height: 0;
  margin: 0 auto;
}

.ws-board-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.ws-board-wrap {
  position: relative;
  flex: none;
  width: 320px;
  height: 320px;
  max-width: 100%;
  overflow: hidden;
  border: var(--ws-border) solid var(--ws-line-strong);
  background: var(--ws-surface);
  box-shadow: var(--ws-shadow-offset) var(--ws-shadow-offset) 0 var(--ws-shadow);
}

.ws-board {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: repeat(10, minmax(0, 1fr));
  width: 100%;
  height: 100%;
}

.ws-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  min-height: 0;
}

.ws-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--ws-cell-border);
  border-bottom: 1px solid var(--ws-cell-border);
  background: var(--ws-cell-bg);
  color: var(--ws-ink);
  font-family: var(--ws-font);
  font-size: calc(var(--cell-size, 32px) * 0.48);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background-color var(--ws-fast) var(--ws-ease),
    color var(--ws-fast) var(--ws-ease);
}

.ws-row:last-child .ws-cell {
  border-bottom: 0;
}

.ws-cell:last-child {
  border-right: 0;
}

.ws-cell.is-preview {
  background: var(--ws-accent-soft);
  color: var(--ws-accent-strong);
}

.ws-cell.is-anchor {
  background: var(--ws-warm-soft);
  color: var(--ws-ink);
  box-shadow: inset 0 0 0 var(--ws-border-thin) var(--ws-warm);
}

.ws-cell.is-found {
  background: var(--ws-cell-found-bg);
  color: var(--ws-cell-found-ink);
  box-shadow: inset 0 0 0 1px var(--ws-found);
  font-weight: 700;
}

.ws-cell.is-found.is-preview {
  background: var(--ws-found-soft);
}

.ws-cell.is-wrong {
  background: var(--ws-wrong-soft);
  color: var(--ws-wrong);
}

.ws-cell.is-pulse {
  animation: ws-cell-pulse 360ms steps(3, end);
}

.ws-cell.is-shake {
  animation: ws-shake 220ms steps(2, end);
}

.ws-cell:focus-visible {
  z-index: 2;
  outline: var(--ws-border) solid var(--color-focus);
  outline-offset: -3px;
}

@keyframes ws-cell-pulse {
  0% { transform: scale(1); }
  38% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes ws-shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-2px); }
  65% { transform: translateX(2px); }
}

.ws-touch {
  position: absolute;
  inset: 0;
  z-index: 3;
  touch-action: none;
  cursor: crosshair;
}

/* 状态 ------------------------------------------------------------------ */

.ws-status {
  min-height: 18px;
  margin: 0;
  padding: 0;
  color: var(--ws-ink-soft);
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  text-wrap: pretty;
}

.ws-status[data-tone="good"] {
  color: var(--ws-found);
  font-weight: 700;
}

.ws-status[data-tone="warn"] {
  color: var(--ws-wrong);
  font-weight: 700;
}

/* 词表面板 -------------------------------------------------------------- */

.ws-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 460px;
  min-height: 0;
  margin: 0 auto;
  padding: 6px;
  border: var(--ws-border) solid var(--ws-line-strong);
  background: var(--ws-surface);
  box-shadow: var(--ws-shadow-offset) var(--ws-shadow-offset) 0 var(--ws-shadow);
}

.ws-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ws-panel__head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ws-panel__head p {
  margin: 2px 0 0;
  color: var(--ws-ink-soft);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
}

.ws-best {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0;
  line-height: 1.1;
}

.ws-best span {
  color: var(--ws-ink-soft);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ws-best strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ws-words {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  flex: 1 1 auto;
  gap: 3px 4px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.ws-word {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 34px;
  padding: 3px 4px;
  border: var(--ws-border-thin) solid var(--ws-line);
  background: var(--ws-surface-2);
  color: var(--ws-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: normal;
  transition:
    background-color var(--ws-fast) var(--ws-ease),
    border-color var(--ws-fast) var(--ws-ease),
    color var(--ws-fast) var(--ws-ease);
}

.ws-word__mark {
  position: relative;
  flex: none;
  width: 12px;
  height: 12px;
  border: var(--ws-border-thin) solid var(--ws-line-strong);
  background: var(--ws-surface);
}

.ws-word__len {
  color: var(--ws-ink-soft);
  font-size: 9px;
  font-weight: 700;
  margin-left: auto;
}

.ws-word__text {
  min-width: 0;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.ws-word.is-found {
  border-color: var(--ws-found);
  background: var(--ws-found-soft);
  color: var(--ws-cell-found-ink);
}

.ws-word.is-found .ws-word__mark {
  border-color: var(--ws-found);
  background: var(--ws-found);
}

.ws-word.is-found .ws-word__mark::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 2px;
  width: 3px;
  height: 6px;
  border-right: 2px solid var(--ws-surface);
  border-bottom: 2px solid var(--ws-surface);
  transform: rotate(42deg);
}

.ws-word.is-found .ws-word__text {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.ws-word.is-found .ws-word__len {
  color: var(--ws-found);
}

.ws-word.is-pop {
  animation: ws-word-pop 420ms steps(3, end);
}

@keyframes ws-word-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.ws-keys {
  display: none;
  margin: 0;
  color: var(--ws-ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.ws-keys kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 4px;
  border: 1px solid var(--ws-line);
  background: var(--ws-surface-2);
  color: var(--ws-ink-soft);
  font-family: var(--ws-font);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.ws-tip {
  margin: auto 0 0;
  padding-top: 4px;
  border-top: var(--ws-border-thin) solid var(--ws-line);
  color: var(--ws-ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.ws-app[data-orientation="landscape"] .ws-tip {
  display: none;
}

@media (max-height: 560px) {
  .ws-tip {
    display: none;
  }
}

/* 独立胜利面板 ---------------------------------------------------------- */

.ws-win {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding:
    max(12px, env(safe-area-inset-top, 0px))
    max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
  background: var(--ws-scrim);
}

.ws-win[hidden] {
  display: none;
}

.ws-win__card {
  width: min(400px, calc(100% - 16px));
  max-height: 80dvh;
  overflow-y: auto;
  padding: 16px;
  border: var(--ws-border) solid var(--ws-line-strong);
  background: var(--ws-surface);
  box-shadow: var(--ws-shadow-lg) var(--ws-shadow-lg) 0 var(--ws-shadow);
  text-align: center;
}

.ws-win__badge {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
  border: var(--ws-border-thin) solid var(--ws-line-strong);
  background-color: var(--ws-accent-soft);
  background-image: url("./assets/pixel/word-search-daily-sprites.png");
  background-repeat: no-repeat;
  background-size: var(--ws-sprite-size);
  background-position: var(--ws-sprite-pos);
  image-rendering: pixelated;
}

.ws-win__eyebrow {
  margin: 0;
  color: var(--ws-accent-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ws-win__title {
  margin: 4px 0 8px;
  font-size: 20px;
  line-height: 1.2;
  text-transform: uppercase;
}

.ws-win__time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 8px;
}

.ws-win__time strong {
  color: var(--ws-accent-strong);
  font-size: 32px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.ws-win__time span {
  color: var(--ws-ink-soft);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ws-win__meta,
.ws-win__record {
  margin: 0 0 8px;
  color: var(--ws-ink-soft);
  font-size: 14px;
}

.ws-win__record {
  padding: 6px;
  border: var(--ws-border-thin) solid var(--ws-found);
  background: var(--ws-found-soft);
  color: var(--ws-cell-found-ink);
  font-weight: 700;
}

.ws-win__button {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border: var(--ws-border) solid var(--ws-line-strong);
  background: var(--ws-accent);
  color: var(--ws-on-accent);
  box-shadow: 3px 3px 0 var(--ws-shadow);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  transition:
    transform 80ms steps(2, end),
    box-shadow 80ms steps(2, end);
}

.ws-win__button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ws-shadow);
}

.ws-app.is-complete .ws-board-wrap {
  animation: ws-board-glow 900ms steps(2, end);
}

@keyframes ws-board-glow {
  0%, 100% { box-shadow: var(--ws-shadow-offset) var(--ws-shadow-offset) 0 var(--ws-shadow); }
  45% {
    box-shadow:
      0 0 0 4px var(--ws-found),
      var(--ws-shadow-offset) var(--ws-shadow-offset) 0 var(--ws-shadow);
  }
}

/* 方向与窄屏 ------------------------------------------------------------ */

.ws-app[data-orientation="portrait"] .ws-main {
  align-items: center;
}

.ws-app[data-orientation="portrait"] .ws-panel {
  flex: 1 1 auto;
  min-height: 0;
}

.ws-app[data-orientation="portrait"] .ws-words {
  flex: 1 1 auto;
  max-height: none;
  align-content: space-evenly;
}

.ws-app[data-orientation="landscape"] .ws-main {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}

.ws-app[data-orientation="landscape"] .ws-board-col {
  flex: 0 0 auto;
}

.ws-app[data-orientation="landscape"] .ws-panel {
  flex: 1 1 0;
  align-self: stretch;
  max-width: none;
  min-width: 0;
  max-height: calc(100dvh - 74px);
  margin: 0;
  overflow: hidden;
}

.ws-app[data-orientation="landscape"].is-equal-columns .ws-main {
  justify-content: center;
}

.ws-app[data-orientation="landscape"].is-equal-columns .ws-panel {
  flex: 0 0 var(--board-size);
  width: var(--board-size);
  height: var(--board-size);
  max-height: none;
  align-self: auto;
}

.ws-app[data-orientation="landscape"].is-equal-columns .ws-words {
  align-content: space-evenly;
}

.ws-app[data-orientation="landscape"] .ws-words {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.ws-app[data-orientation="landscape"] .ws-word {
  width: 100%;
  justify-content: flex-start;
}

.ws-app[data-orientation="landscape"] .ws-word__len {
  margin-left: auto;
}

.ws-app[data-orientation="landscape"] .ws-keys {
  display: block;
}

@media (max-width: 640px) {
  .ws-stat--found {
    display: none;
  }

  .ws-stat {
    flex-direction: row;
    align-items: baseline;
    gap: 3px;
    min-width: 0;
    padding: 1px 3px;
  }

  .ws-theme {
    padding-left: 0;
  }

  .ws-theme__label {
    display: none;
  }

  .ws-theme select {
    padding-left: 6px;
  }

  .ws-header {
    gap: 4px;
  }

  .ws-brand__copy h1 {
    font-size: 14px;
  }

  .ws-brand__copy p {
    max-width: 12rem;
  }

  .ws-main {
    gap: 2px;
  }

  .ws-app[data-orientation="portrait"] .ws-panel,
  .ws-panel {
    flex: 0 0 auto;
    gap: 2px;
    padding: 4px;
    overflow: hidden;
  }

  .ws-panel__head {
    display: none;
  }

  .ws-status {
    min-height: 16px;
    font-size: 12px;
    line-height: 1.2;
  }

  .ws-app[data-orientation="portrait"] .ws-words,
  .ws-words {
    display: flex;
    flex: 0 0 38px;
    flex-direction: row;
    gap: 4px;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 1px 0 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }

  .ws-word {
    flex: 0 0 auto;
    min-width: 92px;
    height: 34px;
    min-height: 34px;
  }

  .ws-tip,
  .ws-keys {
    display: none;
  }
}

@media (max-width: 380px) {
  .ws-brand__mark {
    display: none;
  }

  .ws-brand__copy h1 {
    font-size: 13px;
  }

  .ws-brand__copy p {
    max-width: 10rem;
  }

  .ws-theme select {
    width: 92px;
    padding-right: 16px;
  }
}

@media (max-width: 350px) {
  .ws-brand__copy h1 span {
    display: none;
  }

  .ws-header {
    gap: 3px;
  }
}

@media (max-width: 340px) {
  .ws-app {
    padding-left: max(4px, min(env(safe-area-inset-left, 0px), 6px));
    padding-right: max(4px, min(env(safe-area-inset-right, 0px), 6px));
  }
}

@media (min-width: 768px) {
  .ws-panel {
    max-width: 620px;
  }

  .ws-brand__copy h1 {
    font-size: 17px;
  }

  .ws-status {
    font-size: 15px;
  }

  .ws-app[data-orientation="landscape"] .ws-words {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 6px;
  }
}

/* 减少动态与高对比 ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .ws-cell,
  .ws-word,
  .ws-word__mark,
  .ws-win__button {
    transition-duration: 1ms;
  }

  .ws-cell.is-pulse,
  .ws-cell.is-shake,
  .ws-word.is-pop,
  .ws-app.is-complete .ws-board-wrap {
    animation: none;
  }
}

@media (forced-colors: active) {
  .ws-cell,
  .ws-word,
  .ws-panel,
  .ws-theme,
  .ws-brand__mark {
    border: 1px solid CanvasText;
  }

  .ws-cell.is-found {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}
