:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #66727c;
  --line: #dce2e6;
  --panel: #ffffff;
  --paper: #f5f7f8;
  --accent: #0d7c66;
  --accent-dark: #095f50;
  --warn: #b45309;
  --good: #107044;
  --danger: #b42318;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f7f2e8 0%, #eef6f2 45%, #f5f7f8 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

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

.app-logo {
  width: clamp(62px, 8vw, 86px);
  height: clamp(62px, 8vw, 86px);
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(23, 32, 38, 0.16);
}

.initial-loader{position:fixed;inset:0;z-index:9995;display:grid;align-content:center;gap:14px;width:min(560px,100%);margin:auto;padding:28px;background:var(--paper,#f7f3e8);color:#5a665e}
.loader-logo-skeleton,.loader-line,.loader-card-grid i{display:block;border-radius:14px;background:linear-gradient(100deg,#e4e7e0 20%,#f6f7f3 38%,#e4e7e0 58%);background-size:200% 100%;animation:guess-skeleton 1.1s linear infinite}
.loader-logo-skeleton{width:72px;height:72px;border-radius:22px}.loader-line{width:62%;height:18px}.loader-line.wide{width:86%;height:30px}.loader-card-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.loader-card-grid i{height:92px}.initial-loader strong{text-align:center;margin-top:6px}
body:not(.app-loading) .initial-loader{display:none}
@keyframes guess-skeleton{to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.loader-logo-skeleton,.loader-line,.loader-card-grid i{animation:none}}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.98;
}

h2 {
  font-size: 18px;
}

.subtle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.main-nav {
  display: inline-grid;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.main-nav {
  grid-template-columns: repeat(3, 82px);
}

.main-nav button {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.nav-svg {
  display: none;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main-nav button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 8px rgba(23, 32, 38, 0.08);
}

.view-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
}

.game-view {
  display: grid;
  gap: 18px;
}

.game,
.side-section,
.library-main,
.library-editor {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(220, 226, 230, 0.95);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(23, 32, 38, 0.08);
}

.game {
  min-height: calc(100vh - 132px);
  padding: 24px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.game-stage {
  display: grid;
  gap: 18px;
}

#gamePlayPanel {
  grid-template-rows: auto auto auto auto auto 1fr;
}

.stage-heading {
  display: grid;
  gap: 6px;
}

.stage-heading .eyebrow {
  font-size: 22px;
}

.mode-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.quick-random-mode {
  width: 100%;
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 5px;
  margin-bottom: 14px;
  padding: 17px 20px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #196c5c, #194b61);
  text-align: left;
  box-shadow: 0 12px 28px rgba(21, 93, 79, .2);
  cursor: pointer;
}

.quick-random-mode:hover,
.quick-random-mode:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(21, 93, 79, .26);
}

.quick-random-mode strong {
  font-size: 22px;
}

.quick-random-mode span {
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  font-weight: 800;
}

.mode-choice-card {
  position: relative;
  min-height: 128px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}

.mode-choice-icon {
  width: 58px;
  height: 58px;
  padding: 10px;
  border-radius: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-choice-icon-bank {
  color: var(--accent-dark);
  background: linear-gradient(145deg, #e7f5f2, #fff8eb);
  border: 1px solid #b7dfd6;
}

.mode-choice-icon-daily {
  color: #9a5a08;
  background: linear-gradient(145deg, #fff5df, #edf7f5);
  border: 1px solid #f0ca84;
}

.mode-choice-icon-auto {
  color: #305c9a;
  background: linear-gradient(145deg, #eaf2ff, #fff8eb);
  border: 1px solid #bdd0f1;
}

.mode-choice-copy {
  display: grid;
  gap: 6px;
  color: var(--ink);
  min-width: 0;
}

.mode-choice-copy > span {
  color: #38444d;
  line-height: 1.55;
  font-weight: 700;
}

.mode-choice-card:hover,
.mode-choice-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(13, 124, 102, 0.1);
  outline: none;
}

.mode-choice-card strong {
  font-size: 20px;
  color: #111a20;
}

.mode-choice-card span {
  color: #38444d;
  line-height: 1.55;
}

.mode-choice-card.disabled {
  opacity: 0.72;
}

@media (max-width: 1120px) {
  .mode-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stage-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
}

#startSelectedGameBtn {
  font-size: 18px;
  font-weight: 900;
}

.stage-actions button {
  width: 100%;
}

#startSelectedGameBtn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 900;
}

.topbar,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.play-toolbar {
  justify-content: flex-end;
}

.category-panel-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.quick-start-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  font-size: 24px;
}

.play-status-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
}

.play-status-row .icon-button {
  align-self: stretch;
  width: 54px;
  height: auto;
  min-height: 56px;
  border: 1px solid #b7dfd6;
  background: #edf7f5;
  color: var(--accent-dark);
  font-size: 22px;
}

.play-status-row .icon-button:hover {
  border-color: var(--accent);
  background: #e5f3ef;
}

.play-action-stack {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.play-action-stack button {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
}

.play-sidebar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.play-main-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.play-toolbox {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.tool-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.tool-card h2 {
  font-size: 18px;
}

.toolbox-mobile-head,
.mobile-tool-toggle,
.mobile-final-guess-toggle,
.mobile-play-fab-group,
.mobile-tool-scrim {
  display: none;
}

#clueBtn {
  display: grid;
  gap: 8px;
  align-items: center;
  justify-items: stretch;
  padding: 12px 18px;
  border-color: #f0bf6a;
  background: #fff7e8;
  color: #7f430a;
  text-align: center;
}

#clueBtn.has-clue {
  gap: 10px;
  padding: 14px 26px;
  text-align: left;
}

.clue-button-action {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

#clueBtn.has-clue .clue-button-action {
  padding-top: 10px;
  border-top: 1px solid rgba(127, 67, 10, 0.18);
  text-align: center;
  font-size: 16px;
  font-weight: 900;
}

.clue-board-title {
  color: #8a4b0f;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.clue-button-items {
  display: grid;
  gap: 8px;
  justify-self: stretch;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(127, 67, 10, 0.18);
}

.clue-button-items strong {
  color: #7f430a;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: left;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.status-strip div {
  display: grid;
  align-content: center;
  min-height: 56px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.status-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.status-strip strong {
  display: block;
  min-height: 20px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.hint-banner,
.win-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 8px;
}

.hint-banner {
  background: #edf7f5;
  border: 1px solid #b7dfd6;
  color: var(--accent-dark);
}

.win-banner {
  justify-content: flex-start;
  background: #e8f8ef;
  border: 1px solid #bde8cd;
  color: var(--good);
}

.win-banner.revealed {
  background: #fff1f0;
  border-color: #ffccc7;
  color: var(--danger);
}

.win-banner > div {
  min-width: 0;
  display: grid;
  gap: 8px;
  justify-items: start;
  text-align: left;
}

.win-banner span {
  font-weight: 900;
}

.favorite-button,
.locate-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.favorite-button:hover,
.favorite-button.active {
  border-color: #f3cf9a;
  background: #fff1ba;
  color: #9d6b00;
}

.favorite-button.compact,
.locate-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  font-size: 18px;
}

.locate-button:hover {
  border-color: #b7dfd6;
  background: #edf7f5;
  color: var(--accent-dark);
}

.revealed-favorite {
  flex: 0 0 auto;
}

.hint-banner strong,
.win-banner strong {
  font-size: 28px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.win-banner small {
  color: currentColor;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.78;
}

.revealed-image {
  width: min(220px, 42vw);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #bde8cd;
  background: white;
}

.hint-banner strong {
  display: grid;
  gap: 4px;
}

.hidden {
  display: none !important;
}

.controls {
  display: grid;
  gap: 12px;
}

.play-form,
.inline-form,
.entry-form {
  display: grid;
  gap: 10px;
}

.play-form {
  grid-template-columns: minmax(0, 1fr) 112px;
}

.auto-ask-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #bdd0f1;
  border-radius: 8px;
  background: #f2f6ff;
}

.auto-ask-panel > div {
  display: grid;
  gap: 6px;
}

.auto-ask-panel span {
  color: #536274;
  font-size: 13px;
  font-weight: 800;
}

.auto-ask-panel strong {
  color: #17253a;
  font-size: 17px;
  line-height: 1.45;
}

.auto-ask-panel button {
  width: 100%;
  background: #3768a6;
}

.prompt-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
}

.prompt-input-wrap textarea {
  grid-column: 1;
  grid-row: 1;
  padding-right: 42px;
  min-height: 64px;
  max-height: 112px;
  resize: none;
  font-size: 18px;
  line-height: 1.35;
}

.prompt-tool-button {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid #b7dfd6;
  background: #edf7f5;
  color: var(--accent-dark);
  font-size: 20px;
  font-weight: 900;
}

.prompt-tool-button:hover {
  border-color: var(--accent);
  background: #e5f3ef;
}

.prompt-tool-button.danger-lite {
  border-color: #ffccc7;
  background: #fff7f5;
  color: var(--danger);
}

.prompt-tool-button.danger-lite:hover {
  background: #fff1f0;
}

#clearInputBtn {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  width: 26px;
  min-height: 26px;
  height: 26px;
  margin-right: 10px;
  padding: 0;
  border-radius: 999px;
  font-size: 16px;
  line-height: 1;
  z-index: 1;
}

.final-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.final-guess-button,
.final-action-row .danger-button {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #ffccc7;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
}

.final-guess-button {
  background: #fff7f5;
}

.inline-form {
  grid-template-columns: minmax(180px, 260px) 110px;
}

.entry-form {
  grid-template-columns: minmax(180px, 1fr) 112px;
  align-items: center;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.share-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: center;
  gap: 10px;
}

.share-row .text-button,
.share-row .secondary-button {
  width: 100%;
  min-height: 40px;
}

.share-row .unavailable {
  border-color: #d8e0df;
  background: #eef3f2;
  color: #8a9693;
  cursor: not-allowed;
  box-shadow: none;
}

.share-row .unavailable:hover {
  border-color: #d8e0df;
  background: #eef3f2;
  color: #8a9693;
  transform: none;
}

#favoriteCurrentBtn.active {
  border-color: #f3cf9a;
  background: #fff1ba;
  color: #9d6b00;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
}

input {
  min-height: 46px;
  padding: 0 14px;
}

textarea {
  min-height: 78px;
  padding: 12px 14px;
  line-height: 1.45;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.16);
}

input:disabled,
textarea:disabled {
  background: #f3f5f5;
  color: var(--muted);
  cursor: not-allowed;
}

.play-form button,
.inline-form button,
.modal-actions button[type="submit"] {
  min-height: 46px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.play-form .prompt-tool-button {
  padding: 0;
  border: 1px solid #b7dfd6;
  background: #edf7f5;
  color: var(--accent-dark);
  font-size: 20px;
  font-weight: 900;
}

.play-form .prompt-tool-button.danger-lite {
  border-color: #ffccc7;
  background: #fff7f5;
  color: var(--danger);
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.secondary-button,
.text-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
}

.secondary-button {
  background: #fff6e8;
  color: #8a4b0f;
  border: 1px solid #f3cf9a;
}

.danger-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #ffccc7;
  font-weight: 800;
}

.danger-button.compact {
  min-height: 46px;
}

.text-button {
  color: var(--accent-dark);
  background: var(--paper);
  border: 1px solid var(--line);
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.message:empty {
  display: none;
}

.message.error {
  color: var(--danger);
}

.toast-region {
  position: fixed;
  left: 50%;
  top: 22px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #a7d8ce;
  background: #edf7f5;
  color: var(--accent-dark);
  box-shadow: 0 14px 40px rgba(23, 32, 38, 0.16);
  font-weight: 900;
  text-align: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.error {
  border-color: #ffccc7;
  background: #fff1f0;
  color: var(--danger);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(-8px);
}

.history-panel {
  min-height: 280px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.history-panel.empty-state {
  min-height: auto;
  grid-template-rows: auto auto;
  gap: 6px;
}

.history-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
  overflow: auto;
}

.history-item,
.category-row,
.entry-row {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.history-item {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.history-text {
  flex: 1 1 160px;
  margin: 0;
  line-height: 1.55;
}

.history-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.answer {
  width: fit-content;
  max-width: 100%;
  flex: 0 1 auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: white;
  background: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.answer.wrong {
  background: var(--warn);
}

.answer.correct {
  background: var(--good);
}

.answer.reveal {
  background: var(--ink);
}

.answer.hint {
  border: 1px solid #f3cf9a;
  background: #fff6e8;
  color: #8a4b0f;
}

.answer.unclear {
  border: 1px solid #decfb9;
  background: #fffdf8;
  color: #6d6257;
}

.empty {
  color: var(--muted);
  margin: 0;
}

.side {
  display: grid;
  align-content: start;
  gap: 18px;
}

.side-section,
.library-main,
.library-editor {
  padding: 18px;
}

.category-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.category-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.category-row:hover,
.category-row:focus-visible {
  border-color: var(--accent);
  background: #f0f8f5;
  outline: none;
}

.category-row span {
  font-weight: 800;
}

.category-row small {
  color: var(--muted);
}

.category-row.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, #e8f4f1 0%, #fffaf0 100%);
  box-shadow: inset 4px 0 0 var(--accent), 0 10px 24px rgba(13, 124, 102, 0.1);
}

.category-row.selected span {
  color: var(--accent-dark);
}

.profile-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.profile-action-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}

.profile-action-card:hover,
.profile-action-card:focus-visible {
  border-color: var(--accent);
  background: #f0f8f5;
  outline: none;
}

.profile-action-icon {
  width: 42px;
  height: 42px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #b7dfd6;
  background: #edf7f5;
  color: var(--accent-dark);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-action-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-action-card strong {
  font-size: 18px;
}

.profile-action-copy > span {
  color: var(--muted);
  line-height: 1.5;
}

.library-view,
.history-view {
  display: grid;
  gap: 18px;
}

.library-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.library-view-mode {
  width: fit-content;
  display: none;
  grid-template-columns: repeat(2, 92px);
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.library-view-mode button {
  min-height: 34px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.library-view-mode button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 8px rgba(23, 32, 38, 0.08);
}

.library-card {
  position: relative;
  min-height: 230px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  display: grid;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, min-height 0.18s ease;
}

.library-card:hover,
.library-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(13, 124, 102, 0.1);
  outline: none;
}

.library-card-edit {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(214, 223, 226, 0.48);
  background: rgba(255, 255, 255, 0.42);
  color: rgba(13, 124, 102, 0.62);
  font-size: 14px;
  font-weight: 900;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.library-card-edit:hover,
.library-card-edit:focus-visible {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-dark);
  opacity: 1;
  outline: none;
}

.library-card strong {
  font-size: 20px;
}

.library-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: white;
  border-bottom: 1px solid var(--line);
  transition: width 0.18s ease, aspect-ratio 0.18s ease, border 0.18s ease;
}

.library-card-body {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  min-width: 0;
}

.library-card span,
.library-card small {
  color: var(--muted);
  line-height: 1.45;
}

.library-cards.compact-mode {
  grid-template-columns: 1fr;
  gap: 10px;
}

.library-cards.compact-mode .library-card {
  min-height: 0;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: stretch;
}

.library-cards.compact-mode .library-card-cover {
  width: 104px;
  height: 100%;
  min-height: 96px;
  aspect-ratio: auto;
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.library-cards.compact-mode .library-card-body {
  gap: 5px;
  padding: 14px 42px 14px 14px;
  align-content: center;
}

.library-cards.compact-mode .library-card strong {
  font-size: 18px;
}

.library-cards.compact-mode .library-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-cards.compact-mode .library-card-edit {
  top: 10px;
  right: 10px;
}

.library-editor {
  display: grid;
  gap: 16px;
}

.editor-heading {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.back-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.back-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.editor-add-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px 0 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--accent-dark);
  font-weight: 900;
}

.editor-add-button:hover {
  border-color: var(--accent);
}

.add-entry-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.entry-list {
  display: grid;
  gap: 10px;
}

.entry-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 4px 0 0;
}

.entry-page-size,
.entry-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entry-page-size {
  justify-self: start;
}

.entry-page-actions {
  justify-self: center;
}

.entry-page-size span,
.entry-page-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.entry-page-size select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 800;
}

.entry-row {
  position: relative;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px 138px 16px 16px;
}

.entry-row.located-entry {
  border-color: #f3cf9a;
  box-shadow: 0 0 0 3px rgba(243, 207, 154, 0.28);
}

.entry-delete-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #ffccc7;
  background: #fff7f6;
  color: var(--danger);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.entry-delete-button:hover {
  border-color: var(--danger);
  background: #fff1f0;
}

.entry-edit-button {
  position: absolute;
  top: 12px;
  right: 54px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.entry-edit-button:hover,
.entry-edit-button.active {
  border-color: #b7dfd6;
  background: #edf7f5;
  color: var(--accent-dark);
}

.entry-row > .favorite-button {
  position: absolute;
  top: 12px;
  right: 96px;
}

.entry-summary {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 12px;
}

.entry-summary-title {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 900;
}

.entry-summary-clues {
  display: grid;
  gap: 6px;
}

.entry-summary-clues span {
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #f3cf9a;
  background: #fff6e8;
  color: #8a4b0f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.entry-summary-clues .empty-clue {
  border-color: var(--line);
  background: white;
  color: var(--muted);
}

.entry-image-panel {
  display: grid;
  align-content: start;
  gap: 8px;
}

.entry-image-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.entry-image-tools {
  display: grid;
  gap: 8px;
}

.field-block {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.word-field {
  max-width: 340px;
}

.word-field input {
  font-weight: 900;
}

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

.file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-picker-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #fac276;
  background: #fff7e8;
  color: #7b4500;
  font-weight: 900;
  cursor: pointer;
}

.file-picker:hover .file-picker-button,
.file-picker:focus-within .file-picker-button {
  border-color: #f0a83e;
  background: #fff2d6;
}

.file-picker-name {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.game-history-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.history-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 6px;
  border: 1px solid rgba(19, 86, 73, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}

.history-mode-tabs button {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: #63716b;
  font-weight: 900;
  cursor: pointer;
}

.history-mode-tabs button.active {
  background: #155f50;
  color: #fff;
  box-shadow: 0 10px 24px rgba(21, 95, 80, .18);
}

.daily-mode-status {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: #6f4e00;
  background: #fff0b8;
  border: 1px solid rgba(186, 137, 19, .24);
}

.daily-mode-status.done {
  color: #155f50;
  background: #dff4ec;
  border-color: rgba(21, 95, 80, .2);
}

.daily-mode-status.pending {
  color: #6f4e00;
}

.history-group {
  display: grid;
  gap: 10px;
}

.history-group-title {
  margin: 2px 2px -2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.game-history-card,
.share-panel,
.share-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.game-history-card {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 16px 94px 16px 16px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.card-corner-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-history-card:hover,
.game-history-card:focus-visible {
  transform: translateY(-1px);
  border-color: #b7dfd6;
  box-shadow: 0 16px 36px rgba(23, 32, 38, 0.08);
  outline: none;
}

.game-history-card.highlighted-history-card {
  border-color: #f3cf9a;
  box-shadow: 0 0 0 3px rgba(243, 207, 154, 0.32), 0 16px 36px rgba(23, 32, 38, 0.08);
}

.history-record-thumb {
  width: 76px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
}

.history-record-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.history-card-title,
.history-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.history-card-title span {
  color: var(--muted);
  font-size: 13px;
}

.history-summary-line {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-load-more {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.detail-summary-line {
  white-space: normal;
}

.case-file-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.case-file-stats span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.case-file-stats small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.case-file-stats strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.case-file-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.case-file-footer strong,
.favorite-card-footer strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.case-outcome {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  color: white;
  background: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

.case-outcome.won {
  background: var(--good);
}

.case-outcome.revealed {
  background: var(--warn);
}

.case-detail {
  display: grid;
  gap: 14px;
  margin: 0;
}

.case-detail-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.case-detail-topbar .eyebrow {
  color: var(--ink);
}

.case-detail-topbar h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.case-result-title.won {
  color: var(--good);
}

.case-result-title.revealed {
  color: var(--danger);
}

.case-answer-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 16px 58px 16px 16px;
  border-radius: 8px;
  border: 1px solid #bde8cd;
  background: #e8f8ef;
  color: var(--good);
}

.case-answer-panel > .favorite-button {
  position: absolute;
  top: 12px;
  right: 12px;
}

.case-answer-panel.revealed {
  border-color: #ffccc7;
  background: #fff1f0;
  color: var(--danger);
}

.case-answer-panel span {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.case-answer-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.case-answer-panel small {
  display: block;
  margin-top: 8px;
  color: currentColor;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.78;
}

.case-answer-panel img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(23, 32, 38, 0.12);
  background: white;
}

.history-ended-at {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.detail-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.case-timeline {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.share-view {
  display: grid;
  place-items: start center;
}

.share-panel {
  width: min(720px, 100%);
  padding: 24px;
  display: grid;
  gap: 16px;
  box-shadow: 0 18px 60px rgba(23, 32, 38, 0.08);
}

.share-steps {
  display: grid;
  gap: 10px;
}

.share-step {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
}

.share-step p {
  margin: 0;
  line-height: 1.5;
}

.share-step-label {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #e8f4f1;
  color: var(--accent-dark);
  font-weight: 900;
}

.entry-main {
  display: grid;
  grid-template-columns: minmax(180px, 340px) minmax(220px, max-content);
  gap: 8px;
  align-items: end;
}

.ai-clue-button {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #b7dfd6;
  background: #edf7f5;
  color: var(--accent-dark);
  font-weight: 900;
}

.ai-clue-button:hover {
  border-color: var(--accent);
  background: #e5f3ef;
}

.ai-clue-button.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.entry-clues {
  display: grid;
  gap: 8px;
}

.clue-list {
  display: grid;
  gap: 8px;
}

.add-clue-button {
  justify-self: start;
}

.clue-toolbar,
.modal-clue-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.clue-limit-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 32, 38, 0.34);
  backdrop-filter: blur(6px);
}

.entry-modal {
  width: min(560px, 100%);
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(23, 32, 38, 0.24);
}

.confirm-modal {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(23, 32, 38, 0.24);
}

.final-guess-modal {
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(23, 32, 38, 0.24);
}

.final-guess-modal.judging {
  animation: modalPulse 0.9s ease-in-out infinite;
}

.guess-result {
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  text-align: center;
  font-weight: 900;
}

.guess-result.judging {
  color: var(--accent-dark);
}

.guess-result.judging::before {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px solid #cce8df;
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.guess-result span {
  color: var(--muted);
  font-size: 14px;
}

.guess-result strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
}

.guess-result.correct {
  border-color: #bde8cd;
  background: #e8f8ef;
  color: var(--good);
  animation: verdictPop 0.42s ease-out;
}

.guess-result.wrong {
  border-color: #ffccc7;
  background: #fff1f0;
  color: var(--danger);
  animation: verdictShake 0.42s ease-out;
}

.final-guess-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.final-guess-actions button {
  width: 100%;
  min-height: 46px;
}

.final-guess-modal.result-correct .final-guess-actions {
  grid-template-columns: 1fr;
}

.final-guess-modal.result-correct .final-guess-actions button[type="submit"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes modalPulse {
  50% {
    transform: translateY(-2px);
  }
}

@keyframes verdictPop {
  0% {
    transform: scale(0.94);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes verdictShake {
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

.confirm-modal h2 {
  margin-bottom: 8px;
}

.modal-title,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.modal-check input {
  width: 18px;
  min-height: 18px;
}

.modal-actions {
  justify-content: flex-end;
}

.modal-clue-panel {
  display: grid;
  gap: 8px;
}

.modal-clue-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-clue-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.split-actions {
  justify-content: space-between;
}

.split-actions > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.clue-chip {
  display: grid;
  grid-template-columns: 34px 28px minmax(0, 1fr) 34px 34px;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.clue-chip.dragging {
  opacity: 0.55;
}

.clue-chip.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.14);
}

.clue-chip.editing {
  grid-template-columns: minmax(0, 1fr) 34px 34px;
}

.modal-clue-chip {
  grid-template-columns: 34px 28px minmax(0, 1fr) 34px;
}

.drag-handle,
.icon-tool {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-weight: 900;
  display: inline-grid;
  place-items: center;
}

.drag-handle {
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.icon-tool:hover,
.drag-handle:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.icon-tool.danger {
  color: var(--danger);
  background: #fff7f6;
}

.clue-number {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e8f4f1;
  color: var(--accent-dark);
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
}

.clue-text {
  overflow-wrap: anywhere;
  line-height: 1.45;
  font-weight: 700;
}

.clue-edit-input {
  min-height: 36px;
}

.add-clue-button {
  justify-self: start;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--accent-dark);
  background: #edf7f5;
  border: 1px dashed #9fd0c6;
  font-weight: 800;
}

@media (max-width: 920px) {
  body {
    padding-bottom: max(68px, calc(52px + env(safe-area-inset-bottom)));
  }

  .shell {
    width: min(100vw - 20px, 720px);
    padding: 12px 0 0;
  }

  .app-header {
    align-items: center;
    margin-bottom: 12px;
  }

  .panel-title {
    align-items: stretch;
    flex-direction: column;
  }

  #libraryMain > .panel-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }

  #libraryMain > .panel-title .editor-add-button {
    justify-self: end;
    min-height: 40px;
  }

  #libraryMain > .panel-title .add-entry-icon {
    width: 40px;
    height: 40px;
  }

  .main-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    width: 100%;
    min-height: 68px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 4px 10px max(10px, env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255, 250, 240, 0.96);
    box-shadow: 0 -14px 42px rgba(23, 32, 38, 0.12);
    backdrop-filter: blur(12px);
  }

  .main-nav button {
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 8px;
    font-size: 12px;
  }

  .main-nav button.active {
    background: transparent;
    color: var(--accent-dark);
    box-shadow: none;
  }

  .nav-svg {
    width: 24px;
    height: 24px;
    display: block;
  }

  .category-panel-title {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .category-panel-title .panel-actions {
    align-self: start;
  }

  .brand-lockup {
    align-items: center;
  }

  .view-layout {
    grid-template-columns: 1fr;
  }

  .game {
    min-height: auto;
    padding: 18px;
  }

  .mode-choice-grid,
  .play-form,
  .inline-form,
  .entry-pager,
  .entry-main,
  .modal-actions,
  .share-step {
    grid-template-columns: 1fr;
  }

  .entry-row {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 126px 14px 14px;
  }

  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .play-status-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 7px;
  }

  .play-status-row .icon-button {
    width: 44px;
    min-height: 48px;
    font-size: 20px;
  }

  .play-action-stack button {
    width: 100%;
  }

  .win-banner {
    align-items: center;
  }

  .win-banner strong {
    font-size: 34px;
    line-height: 1.15;
  }

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

  #rerollCurrentBtn {
    grid-column: 1 / -1;
  }

  .final-guess-button {
    justify-self: stretch;
    width: 100%;
    font-size: 15px;
  }

  .status-strip div {
    min-height: 48px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .status-strip div:last-child {
    border-right: 1px solid var(--line);
  }

  .status-strip span {
    font-size: 10px;
  }

  .status-strip strong {
    min-height: 18px;
    font-size: 18px;
    overflow-wrap: anywhere;
  }

  .prompt-input-wrap textarea {
    min-height: 62px;
    font-size: 16px;
    line-height: 1.35;
  }

  .play-sidebar-layout {
    grid-template-columns: 1fr;
  }

  .play-toolbox {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 56;
    width: min(340px, 88vw);
    align-content: start;
    padding: 16px;
    overflow-y: auto;
    border-left: 1px solid #decfb9;
    background: #fffaf2;
    box-shadow: -18px 0 48px rgba(23, 32, 38, 0.18);
    transform: translateX(105%);
    transition: transform 0.24s ease;
  }

  .play-toolbox.open {
    transform: translateX(0);
  }

  .mobile-play-fab-group {
    position: fixed;
    right: 10px;
    top: 42%;
    z-index: 54;
    display: grid;
    gap: 10px;
  }

  .mobile-tool-toggle,
  .mobile-final-guess-toggle {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border: 1px solid #f1c66f;
    border-radius: 999px;
    background: #fff1ba;
    color: #8a5200;
    box-shadow: -8px 10px 24px rgba(23, 32, 38, 0.16);
  }

  .mobile-final-guess-toggle {
    border-color: #ffb8b0;
    background: #b92720;
    color: white;
  }

  .mobile-tool-toggle svg,
  .mobile-final-guess-toggle svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-tool-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(23, 32, 38, 0.32);
  }

  .mobile-tool-scrim.show {
    display: block;
  }

  .toolbox-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0 2px;
    font-weight: 1000;
  }

  .toolbox-mobile-head button {
    width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 999px;
    background: #edf7f5;
    color: var(--accent-dark);
    font-size: 24px;
    font-weight: 900;
  }

  .case-file-stats,
  .detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-answer-panel {
    grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
  }

  .case-answer-panel img {
    max-width: none;
  }

  .game-history-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 76px 12px 12px;
  }

  .history-record-thumb {
    width: 64px;
  }

  .history-card-title {
    align-items: flex-start;
    gap: 4px;
  }

  .history-summary-line {
    font-size: 13px;
  }

  .entry-image-preview {
    width: 100%;
    min-height: 104px;
  }

  .entry-image-tools .secondary-button {
    min-height: 36px;
    padding: 0 8px;
    font-size: 13px;
  }

  .modal-title,
  .modal-actions {
    flex-wrap: wrap;
  }

  .clue-list,
  .add-clue-button {
    grid-column: 1;
  }

  .entry-content,
  .entry-clues {
    min-width: 0;
  }

  .entry-main {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .word-field {
    max-width: none;
  }

  .ai-clue-button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
    text-align: left;
  }

  .entry-clues .clue-list {
    gap: 6px;
  }

  .entry-clues .clue-chip {
    grid-template-columns: 26px 22px minmax(0, 1fr) 28px 28px;
    gap: 5px;
    min-height: 34px;
    padding: 5px 6px;
    align-items: center;
  }

  .entry-clues .drag-handle,
  .entry-clues .icon-tool {
    width: 28px;
    height: 28px;
    min-height: 28px;
    border-radius: 7px;
    font-size: 13px;
  }

  .entry-clues .drag-handle {
    width: 26px;
  }

  .entry-clues .clue-number {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }

  .entry-clues .clue-text {
    font-size: 13px;
    line-height: 1.32;
    font-weight: 800;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .entry-clues .clue-chip.editing {
    grid-template-columns: minmax(0, 1fr) 28px 28px;
  }

  .entry-clues .clue-edit-input {
    min-height: 30px;
    padding: 0 8px;
    font-size: 13px;
  }

  .editor-heading {
    align-items: center;
    flex-direction: row;
  }

  .editor-add-button {
    padding-right: 10px;
  }

  .library-editor {
    min-height: calc(100dvh - 112px);
    grid-template-rows: auto auto minmax(0, auto) auto;
  }

  .entry-list {
    align-content: start;
  }

  .entry-pager {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
  }

  .entry-page-size {
    justify-self: start;
    gap: 6px;
    white-space: nowrap;
  }

  .entry-page-actions {
    justify-self: end;
    gap: 6px;
    white-space: nowrap;
  }

  .entry-page-size select {
    min-height: 34px;
    padding: 0 8px;
  }

  .entry-page-size span,
  .entry-page-actions span {
    font-size: 12px;
  }

  .entry-page-actions .text-button {
    min-height: 34px;
    padding: 0 9px;
  }

  .library-view-mode {
    display: inline-grid;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .library-cards {
    gap: 10px;
    margin-top: 12px;
  }

  .library-cards.compact-mode .library-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .library-cards.compact-mode .library-card-cover {
    width: 92px;
    min-height: 88px;
  }

  .library-cards.compact-mode .library-card-body {
    padding: 12px 40px 12px 12px;
  }

}
