:root {
  --paper: #f5efe3;
  --paper-2: #fffaf0;
  --paper-3: #eadfcd;
  --ink: #281f2b;
  --ink-soft: #746b71;
  --accent: #e66e38;
  --accent-deep: #b94b25;
  --green: #7ca86a;
  --yellow: #dfb84e;
  --red: #d76555;
  --purple: #8e76b8;
  --shadow: 0 18px 55px rgba(30, 20, 25, 0.14);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--paper);
}

body {
  min-height: 100dvh;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

button,
[role="button"] {
  -webkit-user-select: none;
  user-select: none;
}

button:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid rgba(230, 110, 56, 0.45);
  outline-offset: 3px;
}

.game-root {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  background:
    radial-gradient(circle at 15% 0%, rgba(230, 110, 56, 0.1), transparent 35%),
    var(--paper);
}

.game-root * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.app-screen {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.loading-screen {
  display: grid;
  place-content: center;
  justify-items: center;
  height: 100%;
  padding: 24px;
  text-align: center;
  background:
    linear-gradient(rgba(29, 20, 18, 0.54), rgba(17, 12, 13, 0.82)),
    url("../assets/cover/home_cover_deduction.png") center 39% / cover;
  color: #fff8e9;
}

.loading-screen h1 {
  margin: 13px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 7vw, 62px);
  letter-spacing: 0.05em;
}

.loading-screen h1 .loader-name,
.loading-screen h1 .loader-subtitle {
  display: block;
}

.loading-screen h1 .loader-subtitle {
  margin-top: 6px;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.loading-screen p {
  margin: 0;
  opacity: 0.78;
  font-weight: 700;
}

.loader-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(255, 232, 184, 0.58);
  border-radius: 50%;
  color: #ffd98d;
  font-family: Georgia, serif;
  font-size: 32px;
  font-weight: 800;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.05);
}

.loader-line {
  width: 190px;
  height: 4px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}

.loader-line span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: loader 1.1s ease-in-out infinite alternate;
}

@keyframes loader {
  from { transform: translateX(-15%); }
  to { transform: translateX(140%); }
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: calc(10px + var(--safe-top)) clamp(14px, 3vw, 30px) 10px;
  background: rgba(245, 239, 227, 0.94);
  border-bottom: 1px solid rgba(40, 31, 43, 0.07);
  backdrop-filter: blur(18px);
}

.topbar-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.topbar h1,
.topbar h2 {
  margin: 0;
  overflow: hidden;
  font-size: clamp(20px, 2.8vw, 29px);
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-spacer {
  flex: 1;
}

.icon-button,
.language-button,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 42px;
  border: 1px solid rgba(40, 31, 43, 0.08);
  color: var(--ink);
  background: var(--paper-2);
  box-shadow: 0 5px 18px rgba(40, 31, 43, 0.08);
}

.icon-button {
  width: 42px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
}

.back-icon {
  display: block;
  width: 19px;
  height: 19px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover,
.language-button:hover,
.filter-chip:hover,
.case-card:hover,
.difficulty-card:hover {
  transform: translateY(-1px);
}

.icon-button:active,
.language-button:active,
.primary-button:active,
.tool-button:active,
.suspect-chip:active,
.cell:active {
  transform: scale(0.97);
}

.language-button {
  gap: 6px;
  padding: 0 13px;
  border-radius: 99px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.view-scroll {
  height: calc(100% - 72px - var(--safe-top));
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(16px, 3vw, 32px) clamp(14px, 4vw, 42px) calc(28px + var(--safe-bottom));
  scrollbar-width: thin;
  scrollbar-color: rgba(40, 31, 43, 0.2) transparent;
}

.content-shell {
  width: min(100%, 950px);
  margin: 0 auto;
}

.home-screen {
  position: relative;
  display: grid;
  min-height: 100%;
  overflow-y: auto;
  background:
    linear-gradient(90deg, rgba(13, 8, 8, 0.75) 0%, rgba(20, 12, 12, 0.36) 54%, rgba(16, 9, 9, 0.1) 100%),
    url("../assets/cover/home_cover_deduction.png") center 42% / cover no-repeat;
  color: #fff7e8;
}

.home-screen::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(0deg, rgba(10, 6, 7, 0.5), transparent 34%);
}

.home-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: start;
  padding: calc(14px + var(--safe-top)) clamp(16px, 4vw, 38px) 8px;
}

.home-header .language-button {
  color: #fff7e8;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(18, 10, 10, 0.5);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.home-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  width: min(650px, 100%);
  min-height: calc(100dvh - 110px);
  padding: 8vh clamp(22px, 7vw, 92px) calc(35px + var(--safe-bottom));
}

.home-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 15px;
  color: #f0ba69;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.home-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 10vw, 112px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-shadow: 0 7px 24px rgba(0, 0, 0, 0.48);
}

.home-subtitle {
  width: min(520px, 100%);
  margin: 22px 0 26px;
  color: rgba(255, 247, 232, 0.8);
  font-size: clamp(16px, 2vw, 21px);
  font-weight: 650;
  line-height: 1.5;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.home-campaigns {
  display: grid;
  gap: 10px;
  width: min(560px, 100%);
}

.home-campaign-button {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 118px 34px;
  align-items: center;
  column-gap: 13px;
  width: 100%;
  min-height: 96px;
  padding: 13px 16px;
  border-radius: 22px;
  text-align: left;
}

.primary-button.home-campaign-button.main-campaign-button {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 118px 34px;
  align-items: center;
  column-gap: 13px;
  width: 100%;
  min-height: 96px;
  padding: 13px 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 246, 225, 0.35);
  border-radius: 20px;
  color: #fff5de;
  background:
    radial-gradient(circle at 10% 50%, rgba(255, 223, 165, 0.2), transparent 29%),
    linear-gradient(120deg, #e87743, #b94b25);
  box-shadow: 0 10px 26px rgba(106, 39, 19, 0.32), inset 0 1px 0 rgba(255, 245, 220, 0.16);
  text-align: left;
}

.primary-button.home-campaign-button.main-campaign-button:hover {
  transform: translateY(-2px);
  background:
    radial-gradient(circle at 10% 50%, rgba(255, 230, 179, 0.28), transparent 31%),
    linear-gradient(120deg, #f0814b, #c4542a);
}

.home-campaign-button-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.home-campaign-button-copy strong {
  font-size: 16px;
  line-height: 1.1;
}

.home-campaign-button-copy small {
  color: rgba(255, 247, 232, 0.72);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.home-main-art {
  display: grid;
  flex: 0 0 64px;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 246, 225, 0.3);
  border-radius: 16px;
  color: #fff1ce;
  background: rgba(140, 54, 27, 0.18);
}

.home-main-art svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 3px 4px rgba(98, 37, 20, 0.32));
}

.main-campaign-button .home-campaign-button-copy {
  flex: 1;
}

.main-campaign-button .home-campaign-button-copy strong {
  color: #fff8e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
}

.main-campaign-button .home-campaign-button-copy small {
  color: rgba(255, 247, 232, 0.84);
}

.home-campaign-progress {
  display: grid;
  place-content: center;
  gap: 3px;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 245, 220, 0.25);
  border-radius: 13px;
  background: rgba(112, 41, 22, 0.2);
  text-align: center;
  white-space: nowrap;
}

.home-main-progress {
  grid-column: 3;
}

.home-main-progress strong {
  color: #fff8e8;
  font-size: 14px;
  line-height: 1;
}

.home-main-progress small {
  color: rgba(255, 247, 232, 0.85);
  font-size: 8px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.home-campaign-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #3d271a;
  background: #fff1ce;
  font-size: 19px;
  font-weight: 900;
  transition: transform 0.18s ease;
}

.home-main-arrow {
  grid-column: 4;
}

.main-campaign-button:hover .home-campaign-arrow,
.odyssey-campaign-button:hover .home-campaign-arrow {
  transform: translateX(2px);
}

.secondary-button.odyssey-campaign-button {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 118px 34px;
  align-items: center;
  column-gap: 13px;
  width: 100%;
  min-height: 96px;
  padding: 13px 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 220, 158, 0.42);
  border-radius: 20px;
  color: #fff5de;
  background:
    radial-gradient(circle at 10% 50%, rgba(224, 159, 74, 0.22), transparent 29%),
    linear-gradient(120deg, rgba(47, 28, 20, 0.96), rgba(84, 48, 27, 0.86));
  box-shadow: 0 10px 26px rgba(9, 5, 4, 0.26), inset 0 1px 0 rgba(255, 235, 193, 0.1);
  backdrop-filter: blur(12px);
}

.secondary-button.odyssey-campaign-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 220, 158, 0.62);
  background:
    radial-gradient(circle at 10% 50%, rgba(239, 177, 86, 0.3), transparent 31%),
    linear-gradient(120deg, rgba(55, 32, 21, 0.98), rgba(97, 55, 29, 0.92));
}

.home-odyssey-art {
  display: grid;
  flex: 0 0 64px;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 220, 158, 0.28);
  border-radius: 16px;
  background: radial-gradient(circle, rgba(239, 177, 86, 0.2), rgba(32, 19, 16, 0.2) 70%);
}

.home-odyssey-art img {
  display: block;
  width: 58px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.34));
}

.odyssey-campaign-button .home-campaign-button-copy {
  flex: 1;
}

.odyssey-campaign-button .home-campaign-button-copy strong {
  color: #fff4da;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
}

.odyssey-campaign-button .home-campaign-button-copy small {
  color: rgba(255, 244, 218, 0.74);
}

.home-odyssey-progress {
  grid-column: 3;
  border: 1px solid rgba(240, 186, 105, 0.26);
  color: #f6c979;
  background: rgba(20, 12, 11, 0.28);
  font-size: 10px;
  font-weight: 900;
}

.home-odyssey-arrow {
  grid-column: 4;
}

.home-odyssey-progress + .home-campaign-arrow {
  background: #f0ba69;
}

@media (max-width: 400px) {
  .primary-button.home-campaign-button.main-campaign-button,
  .secondary-button.home-campaign-button.odyssey-campaign-button {
    grid-template-columns: 52px minmax(0, 1fr) 92px 26px;
    column-gap: 8px;
    min-height: 92px;
    padding: 10px;
  }

  .home-main-art,
  .home-odyssey-art {
    width: 52px;
    height: 52px;
  }

  .home-main-art {
    flex-basis: 52px;
  }

  .home-odyssey-art {
    flex-basis: 52px;
  }

  .home-odyssey-art img {
    width: 48px;
    height: 42px;
  }

  .main-campaign-button .home-campaign-button-copy strong,
  .odyssey-campaign-button .home-campaign-button-copy strong {
    font-size: 17px;
  }

  .main-campaign-button .home-campaign-button-copy small,
  .odyssey-campaign-button .home-campaign-button-copy small {
    font-size: 10px;
    line-height: 1.15;
  }

  .home-campaign-arrow {
    width: 24px;
    height: 24px;
    font-size: 15px;
  }
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(145deg, #ef7e45, var(--accent-deep));
  box-shadow: 0 12px 26px rgba(151, 58, 25, 0.33);
  cursor: pointer;
  font-size: 17px;
  font-weight: 850;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.primary-button:hover {
  filter: brightness(1.06);
}

.primary-button:disabled {
  cursor: default;
  filter: none;
  box-shadow: none;
  color: rgba(40, 31, 43, 0.45);
  background: rgba(40, 31, 43, 0.1);
}

.home-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 17px;
  color: rgba(255, 247, 232, 0.82);
  background: rgba(17, 10, 10, 0.46);
  backdrop-filter: blur(10px);
}

.home-streak-progress {
  width: max-content;
  min-height: 48px;
  padding: 0 15px;
  border-radius: 99px;
}

.home-streak-progress > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.home-progress strong {
  display: block;
  color: #fff8ed;
  font-size: 18px;
}

.home-progress span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-sdk-status {
  margin-top: 22px;
  color: rgba(255, 247, 232, 0.56);
  font-size: 11px;
  font-weight: 700;
}

.section-intro {
  max-width: 640px;
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.5;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.difficulty-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 136px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(40, 31, 43, 0.07);
  border-radius: 24px;
  color: var(--ink);
  text-align: left;
  background: var(--paper-2);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.difficulty-card::after {
  position: absolute;
  right: -25px;
  bottom: -55px;
  width: 150px;
  height: 150px;
  content: "";
  border-radius: 50%;
  background: color-mix(in srgb, var(--difficulty-color) 17%, transparent);
}

.difficulty-card.coming-soon {
  cursor: default;
  filter: saturate(0.55);
  opacity: 0.62;
}

.difficulty-card.coming-soon:hover {
  transform: none;
}

.difficulty-card.coming-soon .difficulty-progress {
  padding: 5px 9px;
  border-radius: 99px;
  color: var(--ink-soft);
  background: rgba(40, 31, 43, 0.08);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.difficulty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: var(--difficulty-color);
  background: color-mix(in srgb, var(--difficulty-color) 17%, transparent);
  font-size: 25px;
}

.difficulty-copy {
  min-width: 0;
}

.difficulty-copy h3 {
  margin: 0 0 5px;
  font-size: 21px;
}

.difficulty-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.difficulty-progress {
  position: relative;
  z-index: 1;
  color: var(--difficulty-color);
  font-weight: 900;
}

.progress-bar {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--difficulty-color) 16%, transparent);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--difficulty-color);
}

.archive-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}

.archive-summary span {
  padding: 7px 11px;
  border: 1px solid rgba(40, 31, 43, 0.08);
  border-radius: 99px;
  color: var(--ink-soft);
  background: rgba(255, 250, 240, 0.82);
  font-size: 11px;
  font-weight: 800;
}

.case-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.odyssey-screen {
  background:
    radial-gradient(circle at 88% 0%, rgba(170, 112, 55, 0.12), transparent 34%),
    var(--paper);
}

.odyssey-intro {
  display: grid;
  gap: 3px;
}

.odyssey-description {
  max-width: 640px;
  margin: -10px 0 22px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.odyssey-size-groups {
  display: grid;
  gap: 24px;
}

.odyssey-size-group {
  display: grid;
  gap: 11px;
}

.odyssey-size-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.odyssey-size-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.1;
}

.odyssey-size-heading span {
  flex: none;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.odyssey-size-group .odyssey-case-list {
  margin: 0;
}

.odyssey-pill {
  padding-inline: 13px;
  border-radius: 99px;
  color: #9b6c3f;
  font-size: 11px;
  font-weight: 900;
}

.odyssey-case-card {
  position: relative;
}

.odyssey-case-card.odyssey-case-planned {
  border-style: dashed;
  cursor: pointer;
  filter: saturate(0.68);
  opacity: 0.72;
}

.odyssey-case-card.odyssey-case-planned:hover {
  filter: saturate(0.8);
  opacity: 0.88;
}

.odyssey-case-card.odyssey-case-planned .case-number {
  color: #9b6c3f;
  background: rgba(155, 108, 63, 0.12);
}

.odyssey-case-card.odyssey-case-available .case-status {
  color: #9b6c3f;
}

.odyssey-preview-placeholder {
  display: grid;
  place-items: center;
  border-color: rgba(155, 108, 63, 0.36);
  background:
    linear-gradient(135deg, rgba(155, 108, 63, 0.16), transparent 54%),
    repeating-linear-gradient(135deg, rgba(155, 108, 63, 0.09) 0 2px, transparent 2px 11px),
    #e9dbc3;
}

.odyssey-preview-placeholder span {
  color: rgba(111, 72, 38, 0.42);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 8vw, 74px);
  font-weight: 800;
}

.case-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 15px;
  min-height: 250px;
  padding: 16px;
  border: 1px solid rgba(40, 31, 43, 0.07);
  border-radius: 20px;
  color: var(--ink);
  text-align: left;
  background: var(--paper-2);
  box-shadow: 0 7px 24px rgba(40, 31, 43, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease;
}

.case-card-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 13px;
  min-width: 0;
}

.case-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid rgba(40, 31, 43, 0.55);
  border-radius: 14px;
  background: #d7c5aa;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.55);
}

.case-preview-grid {
  display: grid;
  width: 100%;
  height: 100%;
  background: #151215;
}

.case-preview-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  background-color: var(--room-color);
  background-image:
    linear-gradient(color-mix(in srgb, var(--room-color) 29%, transparent), color-mix(in srgb, var(--room-color) 29%, transparent)),
    var(--floor-image);
  background-position: center, var(--floor-image-position, center);
  background-size: cover, var(--floor-image-size, cover);
}

.case-preview-object {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: calc(100% * var(--object-cols));
  height: calc(100% * var(--object-rows));
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  transform: rotate(var(--object-rotation));
  transform-origin: center;
}

.case-preview-empty {
  background: rgba(40, 31, 43, 0.08);
}

.case-number {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--ink-soft);
  background: rgba(40, 31, 43, 0.08);
  font-size: 16px;
  font-weight: 900;
}

.case-card.solved .case-number {
  color: #fff;
  background: var(--green);
}

.case-card.solved {
  border-color: color-mix(in srgb, var(--green) 28%, transparent);
  background: color-mix(in srgb, var(--green) 5%, var(--paper-2));
}

.case-copy {
  min-width: 0;
}

.case-status {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.case-card.solved .case-status {
  color: var(--green);
}

.case-copy h3 {
  margin: 0;
  overflow: visible;
  font-size: 15px;
  line-height: 1.2;
  white-space: normal;
}

.case-copy p:last-child {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-arrow {
  color: rgba(40, 31, 43, 0.36);
  font-size: 20px;
  font-weight: 900;
}

.case-side,
.case-result {
  display: flex;
  align-items: center;
}

.case-side {
  gap: 9px;
  padding-top: 4px;
}

.case-result {
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  white-space: nowrap;
}

.case-stars {
  color: rgba(40, 31, 43, 0.22);
  font-size: 14px;
  letter-spacing: 0.06em;
  line-height: 1;
}

.case-stars .earned {
  color: #e2ae25;
  text-shadow: 0 1px 0 rgba(129, 82, 0, 0.24);
}

.case-time {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.archive-soon {
  margin-top: 30px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 750;
}

.empty-state span {
  display: block;
  margin-bottom: 8px;
  font-size: 42px;
}

.soon-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 5px;
  padding: 18px 20px;
  border: 1px dashed rgba(40, 31, 43, 0.22);
  border-radius: 20px;
  color: var(--ink-soft);
  background: rgba(255, 250, 240, 0.58);
}

.soon-card h3,
.soon-card p {
  margin: 0;
}

.soon-card h3 {
  color: var(--ink);
  font-size: 15px;
}

.soon-card p {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 650;
}

.soon-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #8c6500;
  background: #ffedac;
  font-size: 18px;
}

.game-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background:
    radial-gradient(circle at 0% 100%, rgba(230, 110, 56, 0.09), transparent 28%),
    var(--paper);
  /* The game is an interactive board, not a document: prevent accidental
     selection/callout while dragging or long-pressing on desktop and mobile. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.game-screen * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.game-header {
  min-height: 68px;
  padding-top: calc(8px + var(--safe-top));
  padding-bottom: 8px;
}

.game-header .case-meta {
  min-width: 0;
  text-align: center;
}

.game-header .case-meta h1 {
  font-size: clamp(17px, 2.3vw, 23px);
}

.victim-line {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 99px;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.timer-pill::before {
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: var(--accent);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(360px, 1fr) minmax(330px, 430px);
  gap: clamp(14px, 2.3vw, 28px);
  width: min(100%, 1560px);
  min-height: 0;
  margin: 0 auto;
  padding: clamp(12px, 2vw, 24px) clamp(14px, 3vw, 30px) calc(14px + var(--safe-bottom));
}

.case-brief {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 17px;
  border: 1px solid rgba(40, 31, 43, 0.09);
  border-radius: 22px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.62), transparent 40%),
    rgba(255, 250, 240, 0.92);
  box-shadow: 0 13px 34px rgba(40, 31, 43, 0.1);
  scrollbar-width: thin;
  scrollbar-color: rgba(40, 31, 43, 0.2) transparent;
}

.mobile-brief-block {
  display: none;
}

.desktop-brief-block {
  display: none;
}

.brief-kicker {
  margin: 0 0 6px;
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.case-brief > h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.05;
}

.brief-section {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid rgba(40, 31, 43, 0.1);
}

.brief-section h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brief-section p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 680;
  line-height: 1.42;
}

.brief-rules {
  padding: 13px;
  border: 0;
  border-radius: 14px;
  background: rgba(222, 202, 155, 0.2);
}

.brief-rules .brief-twist {
  margin-top: 8px;
  color: var(--ink);
  font-weight: 820;
}

.brief-objects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.brief-object {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 35px;
  padding: 3px 5px;
  border: 1px solid rgba(40, 31, 43, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  font-weight: 830;
  line-height: 1.1;
}

.brief-object img {
  width: 29px;
  height: 29px;
  object-fit: contain;
}

.brief-help {
  margin-top: 6px !important;
  font-size: 9px !important;
}

.brief-empty {
  font-style: italic;
}

.board-column {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 0;
}

.board-wrap {
  position: relative;
  width: min(100%, calc(100dvh - 135px));
  aspect-ratio: 1;
  margin: auto;
  overflow: hidden;
  border: 3px solid rgba(40, 31, 43, 0.68);
  border-radius: 9px;
  background: #d7c5aa;
  box-shadow: 0 17px 40px rgba(40, 31, 43, 0.18);
}

.board-grid {
  display: grid;
  width: 100%;
  height: 100%;
  background: #151215;
}

.cell {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: visible;
  border: 0 solid rgba(25, 20, 24, 0.34);
  background-color: var(--room-color);
  background-image:
    linear-gradient(color-mix(in srgb, var(--room-color) 29%, transparent), color-mix(in srgb, var(--room-color) 29%, transparent)),
    var(--floor-image);
  background-position: center, var(--floor-image-position, center);
  background-size: cover, var(--floor-image-size, cover);
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.12s ease;
}

.cell:hover:not(.blocked) {
  filter: brightness(1.08);
}

.cell.blocked {
  cursor: default;
}

/* The Wind Cliff texture now keeps a clean playable center; a slight inset
   crop also hides the remaining edge marks when the floor is tiled on small
   cells. */
.cell.floor-odyssey_wind_cliff {
  background-size: cover, 114%;
}

.cell.object-anchor {
  z-index: 2;
}

.cell.has-character {
  /* A character must stay above a hovered object, including a multi-cell
     rug whose image belongs to a neighbouring anchor cell. */
  z-index: 8;
}

/* The rug sits above the floor but every portrait placed on it stays above
   the rug artwork. */
.cell.object-footprint-rug {
  z-index: 3;
  overflow: visible;
}

/* The rug artwork is painted by its anchor cell and extends over the other
   three cells of the 2×2 footprint. Keep that anchor above the neighbouring
   floor cells; otherwise their backgrounds can cover the overflowing sprite
   as soon as a character is placed on the rug. Characters still use z-index
   8/9, so they remain visibly above the rug. */
.cell.object-footprint-rug.object-anchor {
  z-index: 4;
}

/* Large Odyssey props paint across their full footprint. Keep every cell in
   the footprint above neighbouring floors so the artwork remains seamless. */
.cell.object-footprint-odyssey_ship,
.cell.object-footprint-trojan_horse,
.cell.object-footprint-odyssey_whirlpool {
  z-index: 3;
  overflow: visible;
}

.cell.object-footprint-odyssey_ship.object-anchor,
.cell.object-footprint-trojan_horse.object-anchor,
.cell.object-footprint-odyssey_whirlpool.object-anchor {
  z-index: 4;
}

/* Paint one clipped quarter of the rug in every footprint cell. The clipping
   belongs to this wrapper, not to the cell itself, so a portrait can extend
   naturally beyond a cell edge without being cut off. */
.rug-segment-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.rug-segment-layer .object-rug.multi-cell-object.rug-segment {
  top: 4%;
  left: 4%;
  width: 184%;
  height: 184%;
  max-width: none;
  max-height: none;
  object-fit: fill;
  transform: none;
}

.cell.object-footprint-rug.rug-cell-0-1 .rug-segment-layer .object-rug.multi-cell-object.rug-segment,
.cell.object-footprint-rug.rug-cell-1-1 .rug-segment-layer .object-rug.multi-cell-object.rug-segment {
  left: -96%;
}

.cell.object-footprint-rug.rug-cell-1-0 .rug-segment-layer .object-rug.multi-cell-object.rug-segment,
.cell.object-footprint-rug.rug-cell-1-1 .rug-segment-layer .object-rug.multi-cell-object.rug-segment {
  top: -96%;
}

.cell.object-footprint-rug.has-character {
  z-index: 8;
}

.cell.validation-wrong::after {
  position: absolute;
  z-index: 9;
  inset: 4px;
  border: 5px solid;
  border-radius: 12px;
  content: "";
  pointer-events: none;
}

.cell.validation-wrong::after {
  border-color: #cf4f43;
  background: rgba(207, 79, 67, 0.18);
  box-shadow:
    inset 0 0 24px rgba(207, 79, 67, 0.34),
    0 0 0 4px rgba(207, 79, 67, 0.2),
    0 0 18px rgba(207, 79, 67, 0.5);
}

/* Ошибка остаётся заметной после завершения проверки, победная клетка — чистой. */
.cell.validation-wrong.validation-settled::after {
  inset: 5%;
  border-radius: 50%;
}

.cell.validation-wrong:not(.validation-settled)::after {
  animation: cell-verdict-wrong 0.5s ease both;
}

.cell.crossed::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background: rgba(31, 25, 32, 0.2);
  pointer-events: none;
}

.object-image {
  z-index: 2;
  grid-area: 1 / 1;
  width: 86%;
  height: 86%;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(25, 15, 15, 0.28));
  transform: rotate(var(--object-rotation, 0deg));
  transform-origin: center;
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s ease;
  will-change: transform;
}

.cell.object-anchor:hover .object-image {
  z-index: 5;
  filter: drop-shadow(0 7px 5px rgba(25, 15, 15, 0.34));
  transform: translateY(-7%) scale(1.08) rotate(var(--object-rotation, 0deg));
}

.cell.object-anchor:hover .object-image.multi-cell-object {
  transform: translateY(-3%) scale(1.04) rotate(var(--object-rotation, 0deg));
}

/* Ковёр остаётся плоско на полу при наведении. Подъём и увеличение
   предназначены для интерактивных предметов, но не должны сдвигать
   декоративный спрайт, растянутый на четыре клетки. */
.cell.object-footprint-rug .rug-segment-layer .object-rug.multi-cell-object.rug-segment,
.cell.object-footprint-rug.object-anchor:hover .rug-segment-layer .object-rug.multi-cell-object.rug-segment {
  z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(25, 15, 15, 0.28)) !important;
  transform: none !important;
  transition: none;
}

.object-image.multi-cell-object {
  position: absolute;
  top: 4%;
  left: 4%;
  width: calc(var(--object-cols, 1) * 92%);
  height: calc(var(--object-rows, 1) * 92%);
  max-width: none;
  max-height: none;
  object-fit: fill;
}

.object-clock {
  width: 96%;
  height: 96%;
}

.object-clock.multi-cell-object {
  top: 2%;
  left: 2%;
  width: 96%;
  height: calc(var(--object-rows, 2) * 96%);
  object-fit: contain;
}

.object-odyssey_ship.multi-cell-object {
  top: -12%;
  left: 0;
  width: calc(var(--object-cols, 1) * 96%);
  height: 126%;
  object-fit: contain;
}

.object-odyssey_whirlpool.multi-cell-object {
  top: 0;
  left: 0;
  width: calc(var(--object-cols, 1) * 100%);
  height: calc(var(--object-rows, 1) * 100%);
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(5, 23, 40, 0.42));
}

.object-bookshelf,
.object-shelf,
.object-armchair,
.object-dining_table,
.object-desk,
.object-television,
.object-counter,
.object-pew {
  width: 96%;
  height: 96%;
}

.object-counter.multi-cell-object,
.object-pew.multi-cell-object {
  object-fit: contain;
}

.object-rug {
  width: 98%;
  height: 98%;
}

.object-easel {
  width: 90%;
  height: 90%;
}

.object-coffin {
  width: 92%;
  height: 92%;
}

.placed-portrait {
  z-index: 3;
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  width: 84%;
  height: 84%;
  overflow: hidden;
  border: max(2px, 0.18vw) solid var(--accent);
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.85);
  box-shadow: 0 0 0 max(1px, 0.08vw) rgba(255, 250, 240, 0.78), 0 4px 10px rgba(40, 31, 43, 0.3);
  pointer-events: none;
}

/* Local admin reveal: show the canonical position without changing the
   player's own marks. The real placed portrait remains above this ghost. */
.admin-solution-mark {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 58%;
  height: 58%;
  overflow: visible;
  border: max(1px, 0.12vw) dashed #c9981f;
  border-radius: 50%;
  background: rgba(255, 239, 151, 0.52);
  box-shadow: 0 0 0 max(1px, 0.08vw) rgba(255, 250, 220, 0.65);
  opacity: 0.92;
  pointer-events: none;
}

.admin-solution-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transform: scale(1.1);
}

.admin-solution-mark span {
  position: absolute;
  right: -4px;
  bottom: -4px;
  max-width: 120%;
  overflow: hidden;
  padding: 1px 3px;
  border-radius: 4px;
  color: #4c3900;
  background: #ffe58b;
  font-size: clamp(5px, 0.55vw, 8px);
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell.has-character .admin-solution-mark {
  z-index: 2;
  opacity: 0.28;
}

.placed-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
}

.placed-portrait.on-object {
  z-index: 7;
  width: 62%;
  height: 62%;
  transform: translateY(-9%);
  border-width: max(2px, 0.14vw);
}

.placed-portrait.on-bed {
  transform: translateY(-15%);
}

.placed-portrait.on-chair {
  transform: translateY(-7%);
}

.placed-portrait.on-armchair {
  transform: translateY(-8%);
}

.placed-portrait.on-bench {
  transform: translateY(-7%);
}

.placed-portrait.on-rug {
  z-index: 9;
  /* Keep a little breathing room inside every rug cell on both desktop and
     mobile. The smaller circle also prevents the portrait border from
     touching the cell edge when the board is scaled down. */
  width: 60%;
  height: 60%;
  transform: none;
}

.placed-portrait.on-rug img {
  object-fit: cover;
  transform: scale(1.1);
}

.shareable-object .object-image:not(.multi-cell-object) {
  width: 92%;
  height: 92%;
}

.placed-portrait.victim {
  border-color: var(--red);
}

.cell.hinted .placed-portrait {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 244, 174, 0.72), 0 4px 9px rgba(40, 31, 43, 0.26);
}

.hint-spark {
  position: absolute;
  z-index: 4;
  top: 6%;
  right: 7%;
  display: grid;
  place-items: center;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #7a5600;
  background: #ffe47c;
  font-size: clamp(7px, 1vw, 12px);
  font-weight: 900;
  pointer-events: none;
}

.cell-cross {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

.cell-cross::before,
.cell-cross::after {
  position: absolute;
  top: 50%;
  left: 12%;
  width: 76%;
  height: clamp(5px, 11%, 12px);
  content: "";
  border-radius: 99px;
  background: rgba(28, 22, 29, 0.9);
  box-shadow: 0 1px 1px rgba(255, 255, 255, 0.18);
  transform-origin: center;
}

.cell-cross::before { transform: translateY(-50%) rotate(45deg); }
.cell-cross::after { transform: translateY(-50%) rotate(-45deg); }

.cell-dot {
  grid-area: 1 / 1;
  width: 9%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(40, 31, 43, 0.21);
  pointer-events: none;
}

.cell-notes {
  z-index: 3;
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 88%;
  gap: 1px;
  pointer-events: none;
}

.cell-notes.struck { opacity: 0.4; }

.cell-notes img {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  object-fit: cover;
}

.room-label {
  position: relative;
  z-index: 1;
  grid-row: var(--label-row);
  grid-column: var(--label-col) / span var(--label-span, 1);
  justify-self: end;
  align-self: end;
  margin: 0 4% 4% 0;
  max-width: 100%;
  overflow: hidden;
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.91);
  box-shadow: 0 2px 4px rgba(40, 31, 43, 0.2);
  font-size: clamp(6px, 0.95vw, 11px);
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.room-label-layer {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: grid;
  pointer-events: none;
}

.game-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding-top: 9px;
}

.tool-button {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 61px;
  padding: 5px 2px;
  border: 1px solid rgba(40, 31, 43, 0.06);
  border-radius: 16px;
  color: var(--ink);
  background: var(--paper-2);
  box-shadow: 0 6px 18px rgba(40, 31, 43, 0.08);
  cursor: pointer;
}

.tool-button.active {
  color: var(--paper-2);
  background: var(--ink);
}

.tool-button.rewarded {
  color: #7a4200;
  border-color: rgba(223, 184, 78, 0.45);
  background: #fff3c4;
}

.tool-icon {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.tool-label {
  max-width: 100%;
  overflow: hidden;
  font-size: 9px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 5px;
  border: 2px solid var(--paper);
  border-radius: 99px;
  color: #fff;
  background: var(--accent);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: 0.05em;
}

.hint-count {
  position: relative;
  display: grid;
  place-items: center;
}

.tool-button .hint-count {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 21px;
  height: 21px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  color: #fff;
  background: #c95a2e;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
}

.suspects-section {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px 4px 7px;
  scrollbar-width: thin;
  scrollbar-color: rgba(40, 31, 43, 0.2) transparent;
}

.suspects-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 9px;
}

.suspects-heading h2 {
  margin: 0;
  font-size: 14px;
}

.suspects-heading p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 72px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid rgba(40, 31, 43, 0.12);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper-2);
  box-shadow: 0 3px 8px rgba(40, 31, 43, 0.08);
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
}

.sound-toggle:hover {
  border-color: rgba(40, 31, 43, 0.25);
  transform: translateY(-1px);
}

.sound-toggle.muted {
  color: var(--ink-soft);
  background: rgba(40, 31, 43, 0.06);
}

.sound-toggle-icon {
  font-size: 13px;
  line-height: 1;
}

.suspects-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.desktop-brief-inline-toggle {
  display: none;
}

.suspects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
  align-content: start;
  grid-auto-rows: max-content;
}

.suspect-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 158px;
  overflow: visible;
  padding: 9px 7px 10px;
  border: 2px solid rgba(40, 31, 43, 0.14);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 3px 4px 0 rgba(40, 31, 43, 0.13);
  cursor: pointer;
  text-align: center;
}

.suspect-card.selected {
  border-color: var(--accent);
  background: #fff8e9;
  box-shadow: 0 0 0 2px rgba(230, 110, 56, 0.14), 3px 4px 0 rgba(40, 31, 43, 0.15);
}

.suspect-card.validation-correct {
  border-color: #e0b52f;
  background: #fff8e9;
  box-shadow: 0 0 0 2px rgba(255, 244, 174, 0.72), 3px 4px 0 rgba(40, 31, 43, 0.13);
}

.suspect-card.validation-wrong {
  border-color: #c84d42;
  background: linear-gradient(145deg, #fff8f3, #ffd9d1);
  box-shadow: 0 0 0 3px rgba(200, 77, 66, 0.16), 3px 4px 0 rgba(117, 34, 29, 0.16);
}

.suspect-card.validation-correct:not(.validation-settled) {
  animation: verdict-correct 0.58s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.suspect-card.validation-wrong:not(.validation-settled) {
  animation: verdict-wrong 0.5s ease both;
}

.suspect-card.validation-correct .suspect-portrait,
.placed-portrait.validation-correct {
  border-color: #e0b52f;
  box-shadow: 0 0 0 3px rgba(255, 244, 174, 0.72), 0 4px 9px rgba(40, 31, 43, 0.26);
}

.placed-portrait.validation-correct:not(.validation-settled) {
  animation: portrait-verdict-correct 0.58s ease both;
}

.suspect-card.validation-wrong .suspect-portrait,
.placed-portrait.validation-wrong {
  border-color: #c84d42;
  box-shadow: 0 0 0 4px rgba(200, 77, 66, 0.18), 0 5px 14px rgba(117, 34, 29, 0.24);
}

.suspect-card.validation-correct .suspect-check {
  background: #c59a23;
}

.suspect-card.validation-wrong .suspect-check {
  color: transparent;
  background: #c84d42;
}

.suspect-card.validation-wrong .suspect-check::after {
  position: absolute;
  color: #fff;
  content: "×";
  font-size: 14px;
}

@keyframes verdict-correct {
  0% { transform: perspective(500px) rotateY(0) scale(1); }
  42% {
    border-color: #4ca25d;
    box-shadow: 0 0 0 7px rgba(76, 162, 93, 0.2), 0 10px 24px rgba(40, 93, 50, 0.18);
    transform: perspective(500px) rotateY(8deg) scale(1.045);
  }
  72% { transform: perspective(500px) rotateY(-3deg) scale(1.025); }
  100% { transform: perspective(500px) rotateY(0) scale(1); }
}

@keyframes verdict-wrong {
  0%, 100% { transform: translateX(0) scale(1); }
  25% { transform: translateX(-5px) rotate(-1deg) scale(1.02); }
  50% { transform: translateX(5px) rotate(1deg) scale(1.02); }
  75% { transform: translateX(-3px) rotate(-0.5deg) scale(1.01); }
}

@keyframes cell-verdict-correct {
  0% { opacity: 0; transform: scale(0.72); }
  48% { opacity: 1; transform: scale(1.08); }
  72% { transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes portrait-verdict-correct {
  0% { box-shadow: 0 0 0 0 rgba(255, 244, 174, 0); }
  48% { box-shadow: 0 0 0 5px rgba(255, 244, 174, 0.82), 0 5px 14px rgba(40, 31, 43, 0.26); }
  100% { box-shadow: 0 0 0 3px rgba(255, 244, 174, 0.72), 0 4px 9px rgba(40, 31, 43, 0.26); }
}

@keyframes cell-verdict-wrong {
  0% { opacity: 0; transform: translateX(0) scale(0.82); }
  35% { opacity: 1; transform: translateX(-5px) scale(1.04); }
  58% { transform: translateX(5px) scale(1.04); }
  78% { transform: translateX(-3px) scale(1.01); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .suspect-card.validation-correct:not(.validation-settled),
  .suspect-card.validation-wrong:not(.validation-settled),
  .cell.validation-wrong:not(.validation-settled)::after,
  .placed-portrait.validation-correct:not(.validation-settled) {
    animation: none;
  }
}

.suspect-profile,
.suspect-portrait-wrap {
  display: grid;
  place-items: center;
}

.suspect-portrait-wrap {
  position: relative;
  width: 64px;
  height: 64px;
}

.suspect-portrait {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 2px solid rgba(40, 31, 43, 0.14);
  border-radius: 50%;
  background: var(--paper-2);
  box-shadow: 0 3px 9px rgba(40, 31, 43, 0.12);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.suspect-portrait img {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  transform: scale(1.1);
}

.suspect-chip.selected .suspect-portrait {
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 110, 56, 0.16), 0 4px 11px rgba(40, 31, 43, 0.17);
}

.suspect-chip.victim .suspect-portrait {
  border: 3px solid var(--accent);
}

.suspect-name {
  width: 100%;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suspect-chip.victim .suspect-name {
  color: var(--accent-deep);
}

.suspect-testimony,
.suspect-hints {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-wrap: anywhere;
  word-break: normal;
  font-size: 10px;
  font-weight: 680;
  line-height: 1.22;
  text-align: center;
}

.suspect-testimony {
  color: var(--ink);
}

.suspect-testimony > span,
.suspect-hints > span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.suspect-card:has(.rule-term:hover) {
  z-index: 20;
}

.rule-term {
  position: relative;
  z-index: 5;
  font-weight: 950;
  text-decoration: underline dotted rgba(40, 31, 43, 0.62);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: help;
}

.rule-term::after {
  display: none;
}

.rule-tooltip-popup {
  position: fixed;
  z-index: 10000;
  width: min(260px, calc(100vw - 20px));
  padding: 9px 11px;
  border: 1px solid rgba(40, 31, 43, 0.16);
  border-radius: 11px;
  color: #fffdf7;
  background: rgba(40, 31, 43, 0.97);
  box-shadow: 0 8px 24px rgba(40, 31, 43, 0.28);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.38;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.rule-tooltip-popup[hidden] {
  display: none;
}

.rule-term::after {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 50%;
  width: min(190px, 58vw);
  padding: 7px 8px;
  border: 1px solid rgba(40, 31, 43, 0.16);
  border-radius: 9px;
  color: #fffdf7;
  background: rgba(40, 31, 43, 0.96);
  box-shadow: 0 7px 18px rgba(40, 31, 43, 0.24);
  content: attr(data-tooltip);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.28;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  text-decoration: none;
  transform: translate(-50%, -2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.rule-term:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.suspect-card:nth-child(3n + 1) .rule-term::after {
  right: auto;
  left: 0;
  transform: translate(0, -2px);
}

.suspect-card:nth-child(3n + 1) .rule-term:hover::after {
  transform: translate(0, 0);
}

.suspect-card:nth-child(3n) .rule-term::after {
  right: 0;
  left: auto;
  transform: translate(0, -2px);
}

.suspect-card:nth-child(3n) .rule-term:hover::after {
  transform: translate(0, 0);
}

.suspect-hints {
  margin-top: 2px;
  padding: 5px;
  border-radius: 8px;
  color: #6c4600;
  background: #fff0b6;
  font-size: 8px;
}

.suspect-check {
  position: absolute;
  z-index: 3;
  right: -7px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  box-shadow: 0 2px 5px rgba(40, 31, 43, 0.16);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.victim-badge {
  position: absolute;
  top: -7px;
  right: -8px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 28px;
  height: 20px;
  border: 3px solid var(--paper);
  border-radius: 99px;
  color: #fff;
  background: var(--red);
  box-shadow: 0 2px 5px rgba(40, 31, 43, 0.16);
  font-size: 9px;
  line-height: 1;
}

.clue-card {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 15px;
  border: 1px solid rgba(40, 31, 43, 0.09);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.85);
  box-shadow: 0 6px 18px rgba(40, 31, 43, 0.06);
}

.clue-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  font-size: 12px;
}

.clue-card h3::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: var(--accent);
}

.rule-reminder {
  margin: -2px 0 10px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.045em;
  line-height: 1.3;
  text-transform: uppercase;
}

.clue-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.clue-card li {
  position: relative;
  padding-left: 15px;
  color: var(--ink);
  font-size: clamp(12px, 1.3vw, 14px);
  font-weight: 680;
  line-height: 1.35;
}

.clue-card li::before {
  position: absolute;
  left: 0;
  content: "—";
  color: var(--ink-soft);
}

.game-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
}

.mismatch-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid rgba(183, 72, 53, 0.2);
  border-radius: 11px;
  color: #9e3f30;
  background: rgba(215, 101, 85, 0.11);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
}

.secondary-button {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(40, 31, 43, 0.09);
  border-radius: 17px;
  color: var(--ink);
  background: var(--paper-2);
  box-shadow: 0 6px 18px rgba(40, 31, 43, 0.08);
  cursor: pointer;
  font-weight: 850;
}

.secondary-button:disabled {
  cursor: default;
  opacity: 0.42;
  box-shadow: none;
}

.undo-button {
  width: 52px;
  padding: 0;
  line-height: 1;
}

.undo-button svg {
  width: 26px;
  height: 26px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.submit-button {
  min-height: 52px;
}

.tutorial-button {
  grid-column: 1 / -1;
  min-height: 40px;
  color: var(--ink-soft);
  font-size: 12px;
}

.admin-solution-button {
  grid-column: 1 / -1;
  min-height: 40px;
  color: #806116;
  border-color: rgba(201, 152, 31, 0.28);
  background: rgba(255, 239, 151, 0.36);
  font-size: 12px;
}

.board-wrap.shake {
  animation: shake 0.36s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(20px, var(--safe-top)) 20px max(20px, var(--safe-bottom));
  background: rgba(28, 20, 26, 0.7);
  backdrop-filter: blur(5px);
  animation: fade-in 0.2s ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.modal-card {
  width: min(100%, 480px);
  max-height: 90dvh;
  overflow-y: auto;
  padding: clamp(21px, 4vw, 32px);
  border: 1px solid rgba(40, 31, 43, 0.08);
  border-radius: 28px;
  text-align: center;
  background: var(--paper-2);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.28);
  animation: modal-in 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.2) both;
}

.tutorial-modal {
  padding: clamp(16px, 3vw, 24px);
}

.tutorial-modal .modal-art {
  width: 62px;
  height: 62px;
  margin-bottom: 8px;
  border-radius: 19px;
  font-size: 33px;
}

.tutorial-modal h2 {
  font-size: clamp(23px, 4.5vw, 30px);
}

.tutorial-modal p {
  margin: 8px 0 13px;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-line;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
}

.modal-art {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin: 0 auto 14px;
  border-radius: 24px;
  background: #f5dfae;
  font-size: 42px;
}

.modal-card h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(25px, 5vw, 32px);
}

.modal-card p {
  margin: 12px 0 21px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.modal-card .primary-button {
  width: 100%;
}

.tutorial-board-example {
  width: min(100%, 350px);
  margin: -2px auto 6px;
  padding: 8px 9px 8px;
  border: 1px solid rgba(40, 31, 43, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.tutorial-example-layout,
.tutorial-neighbor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, .72fr);
  align-items: center;
  gap: 14px;
}

.tutorial-grid-focus {
  box-shadow: 0 0 0 3px rgba(230, 172, 54, 0.16), 0 8px 22px rgba(40, 31, 43, 0.1);
  animation: tutorial-focus-pulse 2.4s ease-in-out infinite;
}

@keyframes tutorial-focus-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(230, 172, 54, 0.13), 0 8px 22px rgba(40, 31, 43, 0.1); }
  50% { box-shadow: 0 0 0 5px rgba(230, 172, 54, 0.28), 0 10px 26px rgba(40, 31, 43, 0.14); }
}

.tutorial-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid rgba(40, 31, 43, 0.54);
  background: rgba(255, 250, 240, 0.76);
}

.tutorial-mini-grid span {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid rgba(40, 31, 43, 0.24);
  border-bottom: 1px solid rgba(40, 31, 43, 0.24);
  color: var(--ink);
  font-size: clamp(15px, 4vw, 22px);
  font-weight: 900;
}

.tutorial-mini-grid span:nth-child(3n) {
  border-right: 0;
}

.tutorial-mini-grid span:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.tutorial-mini-portrait {
  width: 74%;
  height: 74%;
  object-fit: contain;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #fffaf0;
  box-shadow: 0 2px 5px rgba(40, 31, 43, 0.22);
}

.tutorial-mini-grid span.highlight-row {
  background: rgba(230, 110, 56, 0.23);
}

.tutorial-mini-grid span.highlight-column {
  background: rgba(79, 145, 183, 0.23);
}

.tutorial-mini-grid span.highlight-intersection {
  background: #f1d780;
  box-shadow: inset 0 0 0 2px rgba(161, 113, 20, 0.45);
}

.tutorial-axis-labels {
  display: grid;
  gap: 12px;
  margin-top: 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 850;
}

.tutorial-axis-labels span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-align: left;
}

.tutorial-axis-labels strong,
.tutorial-neighbor-legend strong {
  font-weight: 900;
}

.tutorial-axis-labels i {
  display: inline-block;
  flex: 0 0 auto;
  width: 13px;
  height: 8px;
  border-radius: 3px;
  background: rgba(230, 110, 56, 0.45);
}

.tutorial-axis-column i {
  width: 8px;
  height: 13px;
  background: rgba(79, 145, 183, 0.5);
}

.tutorial-neighbor-example {
  width: min(100%, 350px);
  margin: -2px auto 6px;
  padding: 8px 9px 9px;
  border: 1px solid rgba(40, 31, 43, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.tutorial-neighbor-board {
  min-width: 0;
}

.tutorial-room-labels {
  display: grid;
  grid-template-columns: 2fr 1fr;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tutorial-room-labels span:first-child {
  color: #4f91b7;
}

.tutorial-room-labels span:last-child {
  color: #c85b4c;
  text-align: right;
}

.tutorial-neighbor-grid {
  border-color: rgba(40, 31, 43, 0.56);
}

.tutorial-neighbor-grid span:nth-child(3n) {
  border-left: 4px solid rgba(40, 31, 43, 0.72);
  border-right: 0;
}

.tutorial-neighbor-valid {
  background: rgba(79, 165, 89, 0.22);
}

.tutorial-neighbor-center {
  background: #f1d780;
  color: var(--ink);
  font-size: clamp(16px, 4vw, 23px);
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(161, 113, 20, 0.45);
}

.tutorial-neighbor-blocked {
  background: rgba(207, 79, 67, 0.17);
  color: #bd574d;
  font-size: 16px;
  font-weight: 900;
}

.tutorial-neighbor-legend {
  display: grid;
  gap: 4px;
  margin-top: 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.tutorial-neighbor-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tutorial-neighbor-legend i {
  display: inline-block;
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 3px;
}

.tutorial-legend-valid {
  background: rgba(79, 165, 89, 0.44);
}

.tutorial-legend-wall {
  background: rgba(207, 79, 67, 0.34);
  box-shadow: inset 3px 0 0 rgba(40, 31, 43, 0.74);
}

@media (max-height: 700px) {
  .tutorial-modal {
    padding: 14px;
  }

  .tutorial-modal .modal-art {
    width: 50px;
    height: 50px;
    margin-bottom: 5px;
    font-size: 28px;
  }

  .tutorial-modal p {
    margin: 6px 0 9px;
    font-size: 12px;
  }

  .tutorial-board-example,
  .tutorial-neighbor-example {
    width: min(100%, 330px);
  }
}

.win-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 21px;
}

.win-stat {
  padding: 12px 5px;
  border-radius: 15px;
  background: var(--paper);
}

.win-stat strong,
.win-stat span {
  display: block;
}

.win-stat strong {
  font-size: 17px;
}

.win-stat span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tutorial-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 17px 0;
}

.tutorial-progress span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(40, 31, 43, 0.16);
}

.tutorial-progress span.active {
  width: 24px;
  border-radius: 99px;
  background: var(--accent);
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 11px 16px;
  border-radius: 13px;
  color: #fff;
  text-align: center;
  background: rgba(40, 31, 43, 0.95);
  box-shadow: 0 10px 30px rgba(40, 31, 43, 0.26);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 13px;
  font-weight: 750;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1180px) {
  .game-layout {
    grid-template-columns: minmax(340px, 1fr) minmax(320px, 410px);
  }

  .case-brief {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(170px, 0.8fr) repeat(4, minmax(0, 1fr));
    align-items: start;
    gap: 11px;
    overflow: visible;
    padding: 13px 15px;
  }

  .brief-kicker {
    grid-column: 1;
    margin-bottom: 2px;
  }

  .case-brief > h2 {
    grid-column: 1;
    font-size: 20px;
  }

  .case-brief .brief-section {
    grid-row: 1 / span 2;
    margin: 0;
    padding: 3px 0 0 11px;
    border-top: 0;
    border-left: 1px solid rgba(40, 31, 43, 0.1);
  }

  .case-brief .brief-rules {
    padding: 9px 10px;
    border-left: 0;
  }

  .brief-objects {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .difficulty-grid {
    grid-template-columns: 1fr;
  }

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

  .game-layout {
    grid-template-columns: minmax(0, 1fr) minmax(270px, 0.72fr);
    gap: 12px;
    padding-inline: 11px;
  }
}

@media (max-width: 680px) {
  html,
  body {
    overflow: hidden;
  }

  .topbar {
    min-height: 64px;
    padding-inline: 12px;
  }

  .view-scroll {
    height: calc(100% - 64px - var(--safe-top));
  }

  .topbar .language-button {
    padding-inline: 10px;
  }

  .home-screen {
    background-position: 54% 45%;
  }

  .home-screen::before {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(0deg, rgba(12, 7, 8, 0.82), rgba(15, 8, 8, 0.12) 70%);
  }

  .home-copy {
    align-content: end;
    min-height: calc(100dvh - 78px);
    padding: 10vh 20px calc(28px + var(--safe-bottom));
  }

  .home-title {
    font-size: clamp(53px, 18vw, 78px);
  }

  .home-subtitle {
    margin: 15px 0 21px;
    font-size: 15px;
    line-height: 1.4;
  }

  .home-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .home-progress {
    width: 100%;
  }

  .home-streak-progress {
    justify-self: start;
    width: max-content;
  }

  .difficulty-card {
    min-height: 116px;
    padding: 17px;
    border-radius: 21px;
  }

  .case-list {
    gap: 9px;
  }

  .case-card {
    min-height: 0;
    padding: 9px;
    gap: 8px;
    border-radius: 16px;
  }

  .case-card-footer {
    gap: 7px;
  }

  .case-number {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 12px;
  }

  .case-status {
    margin-bottom: 2px;
    font-size: 7px;
  }

  .case-copy h3 {
    font-size: 12px;
  }

  .case-copy p:last-child {
    margin-top: 3px;
    font-size: 9px;
  }

  .case-side {
    gap: 4px;
  }

  .case-stars {
    font-size: 10px;
  }

  .case-time {
    font-size: 8px;
  }

  .case-arrow {
    font-size: 16px;
  }

  .difficulty-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .game-screen {
    display: block;
    overflow-y: auto;
  }

  .game-header {
    position: sticky;
    top: 0;
    min-height: 60px;
    padding-top: calc(6px + var(--safe-top));
    padding-bottom: 6px;
  }

  .game-header .language-button {
    display: none;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
    gap: 11px;
    min-height: auto;
    padding: 9px 9px calc(13px + var(--safe-bottom));
  }

  .board-column {
    display: block;
    order: 0;
  }

  .mobile-brief-block {
    display: block;
  }

  .desktop-brief-block {
    display: none;
  }

  .board-wrap {
    width: min(100%, calc(100dvh - 315px));
    min-width: min(100%, 310px);
  }

  .game-panel {
    display: contents;
  }

  .case-brief {
    order: 1;
    display: block;
    overflow: visible;
    padding: 16px;
  }

  .case-brief .brief-section {
    margin-top: 13px;
    padding: 12px 0 0;
    border-top: 1px solid rgba(40, 31, 43, 0.1);
    border-left: 0;
  }

  .case-brief .brief-rules {
    padding: 12px;
    border-top: 0;
  }

  .brief-objects {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-grid {
    order: 2;
    position: relative;
    z-index: 12;
    padding: 11px 6px 6px;
    border: 1px solid rgba(40, 31, 43, 0.06);
    border-radius: 19px;
    background: rgba(245, 239, 227, 0.94);
    box-shadow: 0 -7px 26px rgba(40, 31, 43, 0.09);
    backdrop-filter: blur(14px);
  }

  .tool-button {
    min-height: 54px;
    border-radius: 13px;
  }

  .suspects-section {
    order: 3;
    overflow: visible;
    padding-inline: 1px;
  }

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

  .suspect-card {
    min-height: 150px;
    padding-inline: 5px;
  }

  .suspect-portrait-wrap,
  .suspect-portrait {
    width: 58px;
    height: 58px;
  }

  .suspects-heading .rule-reminder {
    max-width: 120px;
  }

  .game-actions {
    order: 4;
  }

  .room-label {
    font-size: clamp(6px, 2vw, 10px);
  }
}

@media (max-height: 680px) and (min-width: 681px) {
  .game-layout {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .tool-button {
    min-height: 52px;
  }

  .suspects-grid {
    gap: 6px;
  }

  .suspect-card {
    min-height: 138px;
  }

  .suspect-portrait-wrap,
  .suspect-portrait {
    width: 54px;
    height: 54px;
  }
}

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

  .suspect-card .rule-term::after,
  .suspect-card .rule-term:hover::after {
    right: auto;
    left: 50%;
    transform: translate(-50%, 0);
  }

  .suspect-card:nth-child(odd) .rule-term::after {
    right: auto;
    left: 0;
    transform: translate(0, -2px);
  }

  .suspect-card:nth-child(odd) .rule-term:hover::after {
    transform: translate(0, 0);
  }

  .suspect-card:nth-child(even) .rule-term::after {
    right: 0;
    left: auto;
    transform: translate(0, -2px);
  }

  .suspect-card:nth-child(even) .rule-term:hover::after {
    transform: translate(0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Compact case layout: the board and suspect roster get the working area. */
@media (min-width: 681px) {
  .game-screen {
    position: relative;
    display: block;
    min-height: 100dvh;
    overflow: hidden;
  }

  .game-header {
    position: absolute;
    z-index: 30;
    inset: 0 0 auto;
    display: block;
    min-height: 0;
    padding: 9px 14px;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
  }

  .game-header > * {
    pointer-events: auto;
  }

  .game-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
  }

  .game-quick-actions > * {
    pointer-events: auto;
  }

  .game-header .case-meta,
  .game-header .topbar-spacer,
  .game-header .timer-pill,
  .game-header .language-button {
    display: none;
  }

  .game-header .icon-button {
    width: 38px;
    min-height: 38px;
    background: rgba(255, 250, 240, 0.9);
  }

  .brief-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(40, 31, 43, 0.1);
    border-radius: 99px;
    color: var(--ink);
    background: rgba(255, 250, 240, 0.9);
    box-shadow: 0 5px 16px rgba(40, 31, 43, 0.1);
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
  }

  .brief-toggle-label {
    white-space: nowrap;
  }

  .game-header .desktop-brief-toggle {
    position: fixed;
    z-index: 31;
    top: 50%;
    left: 0;
    flex-direction: column;
    gap: 8px;
    min-width: 36px;
    min-height: 126px;
    padding: 12px 7px;
    border-radius: 0 14px 14px 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: translateY(-50%);
  }

  .game-header .desktop-brief-toggle .brief-toggle-arrow {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    font-size: 20px;
    line-height: 1;
    transform: none;
  }

  .mobile-brief-toggle {
    display: none;
  }

  .game-layout {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 520px);
    gap: clamp(12px, 1.4vw, 22px);
    width: min(100%, 1720px);
    height: 100dvh;
    padding: 6px clamp(10px, 1.5vw, 18px) calc(6px + var(--safe-bottom));
  }

  .game-layout.brief-open {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 520px);
  }

  .board-column {
    display: grid;
    grid-template-rows: auto;
    align-content: start;
    gap: 9px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(40, 31, 43, 0.2) transparent;
  }

  .board-wrap,
  .board-brief-toggle,
  .game-layout .case-brief {
    width: min(100%, calc(100dvh - 82px));
    margin-inline: auto;
  }

  .board-wrap {
    margin-top: 0;
    margin-bottom: 0;
  }

  .board-brief-toggle {
    display: flex;
    min-height: 34px;
    padding-inline: 12px;
  }

  .board-brief-toggle .brief-toggle-arrow {
    margin-left: auto;
    font-size: 20px;
    line-height: 1;
  }

  .game-layout .case-brief {
    display: block;
    max-height: calc(100dvh - 170px);
    overflow-y: auto;
    padding: 13px 15px;
  }

  .game-layout .case-brief .brief-section {
    grid-row: auto;
    margin-top: 15px;
    padding: 13px 0 0;
    border-top: 1px solid rgba(40, 31, 43, 0.1);
    border-left: 0;
  }

  .game-layout .brief-objects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 6px;
  }

  .desktop-brief-block {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    display: flex;
    align-items: center;
    pointer-events: none;
  }

  .panel-brief-toggle {
    width: 42px;
    min-height: 142px;
    padding: 12px 7px;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 0 14px 14px 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    pointer-events: auto;
  }

  .panel-brief-toggle .brief-toggle-arrow {
    margin: 0;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    font-size: 20px;
    line-height: 1;
  }

  .desktop-brief-block .case-brief {
    position: absolute;
    top: 12px;
    left: 52px;
    width: min(620px, 44vw, calc(100vw - 76px));
    max-height: min(680px, calc(100dvh - 32px));
    margin: 0;
    padding: 17px 18px;
    background:
      linear-gradient(150deg, rgba(255, 255, 255, 0.7), transparent 42%),
      rgba(255, 250, 240, 0.98);
    box-shadow: 0 16px 40px rgba(40, 31, 43, 0.22);
    pointer-events: auto;
  }

  .game-panel .tool-grid {
    padding-top: 0;
  }

  .game-panel .suspects-heading {
    margin-bottom: 3px;
  }

  .game-panel .suspects-section {
    padding-bottom: 2px;
  }

  .desktop-brief-inline-toggle {
    display: inline-flex;
    min-width: 88px;
    min-height: 30px;
    padding: 4px 8px;
    gap: 4px;
    border-radius: 10px;
    font-size: 9px;
  }

  .desktop-brief-inline-toggle .brief-toggle-arrow {
    margin-left: 2px;
    font-size: 16px;
    line-height: 1;
  }

  .game-panel .suspect-card {
    min-height: 132px;
    padding: 7px 5px 8px;
  }

  .game-panel .suspect-portrait-wrap,
  .game-panel .suspect-portrait {
    width: 54px;
    height: 54px;
  }

  .game-panel .suspect-name {
    font-size: 10px;
  }

  .game-panel .suspect-testimony {
    font-size: 9px;
    line-height: 1.16;
  }

  .difficulty-legendary .game-panel {
    gap: 6px;
  }

  .difficulty-legendary .game-panel .suspects-section {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    padding: 0 2px 4px;
  }

  .difficulty-legendary .game-panel .suspects-heading {
    margin-bottom: 4px;
  }

  .difficulty-legendary .game-panel .suspects-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 5px;
    height: 100%;
    min-height: 0;
  }

  .difficulty-legendary .game-panel .suspect-card {
    height: 100%;
    min-height: 0;
    padding: 8px 5px 9px;
    border-radius: 10px;
    gap: 2px;
    align-content: center;
  }

  .difficulty-legendary .game-panel .suspect-portrait-wrap,
  .difficulty-legendary .game-panel .suspect-portrait {
    width: 50px;
    height: 50px;
  }

  .difficulty-legendary .game-panel .suspect-name {
    font-size: 9px;
  }

  .difficulty-legendary .game-panel .suspect-testimony {
    gap: 2px;
    font-size: 8px;
    line-height: 1.1;
  }

  .submit-button {
    justify-content: space-between;
    padding-inline: 17px;
  }

  .submit-timer {
    flex: none;
    padding-left: 9px;
    opacity: 0.82;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
  }

  .difficulty-easy .game-panel .suspect-card {
    height: 100%;
    min-height: 0;
    padding: 8px 5px 9px;
    border-radius: 10px;
    gap: 2px;
    align-content: center;
  }

  .difficulty-easy .game-panel .suspects-section {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    padding: 0 2px 4px;
  }

  .difficulty-easy .game-panel .suspects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 5px;
    height: 100%;
    min-height: 0;
  }

  .difficulty-easy .game-panel .suspect-portrait-wrap,
  .difficulty-easy .game-panel .suspect-portrait {
    width: 54px;
    height: 54px;
  }

  .difficulty-easy .game-panel .suspect-name {
    font-size: 10px;
  }

  .difficulty-easy .game-panel .suspect-testimony {
    font-size: 9px;
    line-height: 1.16;
  }
}

@media (min-width: 900px) {
  .difficulty-medium .game-panel .suspects-section,
  .difficulty-hard .game-panel .suspects-section,
  .difficulty-extreme .game-panel .suspects-section {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    padding: 0 2px 4px;
  }

  .difficulty-medium .game-panel .suspects-grid,
  .difficulty-hard .game-panel .suspects-grid,
  .difficulty-extreme .game-panel .suspects-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: max-content;
    gap: 5px;
    height: auto;
    min-height: 0;
    align-content: start;
  }

  .difficulty-extreme .game-panel .suspects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    height: 100%;
    grid-auto-rows: unset;
  }

  .difficulty-medium .game-panel .suspect-card,
  .difficulty-hard .game-panel .suspect-card,
  .difficulty-extreme .game-panel .suspect-card {
    height: auto;
    min-height: clamp(148px, 18dvh, 220px);
    padding: clamp(6px, 0.6vw, 10px) clamp(4px, 0.45vw, 8px) clamp(7px, 0.7vw, 11px);
    border-radius: 10px;
    gap: 2px;
    align-content: center;
  }

  .difficulty-medium .game-panel .suspect-portrait-wrap,
  .difficulty-medium .game-panel .suspect-portrait,
  .difficulty-hard .game-panel .suspect-portrait-wrap,
  .difficulty-hard .game-panel .suspect-portrait,
  .difficulty-extreme .game-panel .suspect-portrait-wrap,
  .difficulty-extreme .game-panel .suspect-portrait {
    width: clamp(48px, 4.2vw, 72px);
    height: clamp(48px, 4.2vw, 72px);
  }

  .difficulty-extreme .game-panel .suspect-card {
    height: 100%;
    min-height: 0;
    padding: 8px 5px 9px;
    border-radius: 10px;
    gap: 2px;
    align-content: center;
  }

  .difficulty-extreme .game-panel .suspect-portrait-wrap,
  .difficulty-extreme .game-panel .suspect-portrait {
    width: 50px;
    height: 50px;
  }

  .difficulty-extreme .game-panel .suspect-name {
    font-size: 9px;
  }

  .difficulty-extreme .game-panel .suspect-testimony {
    gap: 2px;
    font-size: 8px;
    line-height: 1.1;
  }

}

@media (max-width: 680px) {
  .rule-tooltip-popup {
    width: min(360px, calc(100vw - 20px));
    padding: 8px 10px;
    font-size: 11px;
  }

  .game-screen {
    position: relative;
  }

  .game-header {
    position: fixed;
    z-index: 30;
    inset: 0 0 auto;
    min-height: 0;
    padding: 7px 9px;
    border: 0;
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none;
  }

  .game-header .game-quick-actions {
    pointer-events: auto;
  }

  .game-header .case-meta,
  .game-header .topbar-spacer,
  .game-header .timer-pill,
  .game-header .language-button {
    display: none;
  }

  .game-header .desktop-brief-toggle {
    display: none;
  }

  .brief-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(40, 31, 43, 0.1);
    border-radius: 99px;
    color: var(--ink);
    background: rgba(255, 250, 240, 0.94);
    box-shadow: 0 4px 12px rgba(40, 31, 43, 0.1);
    font-size: 10px;
    font-weight: 850;
  }

  .brief-toggle-label {
    white-space: nowrap;
  }

  .desktop-brief-inline-toggle {
    display: none;
  }

  .board-brief-toggle {
    display: flex;
    order: 1;
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 13px;
    background: rgba(255, 250, 240, 0.97);
  }

  .board-brief-toggle .brief-toggle-arrow {
    margin-left: auto;
    font-size: 20px;
    line-height: 1;
  }

  .mobile-brief-toggle {
    display: flex;
    order: 1;
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 13px;
    background: rgba(255, 250, 240, 0.97);
  }

  .mobile-brief-toggle .brief-toggle-arrow {
    position: relative;
    display: grid;
    place-items: center;
    margin-left: auto;
    width: 24px;
    height: 24px;
    font-size: 0;
    line-height: 1;
  }

  .mobile-brief-toggle .brief-toggle-arrow::before {
    position: relative;
    display: block;
    width: 12px;
    height: 12px;
    border-top: 4px solid currentColor;
    border-left: 4px solid currentColor;
    border-radius: 2px 0 0;
    content: "";
    transform: rotate(225deg);
  }

  .mobile-brief-toggle[aria-expanded="true"] .brief-toggle-arrow::before {
    top: 3px;
    transform: rotate(45deg);
  }

  .game-layout {
    padding-top: calc(50px + var(--safe-top));
  }

  .game-layout .case-brief {
    order: 2;
  }

  .game-layout.brief-collapsed .case-brief {
    display: none;
  }

  .game-layout.brief-open .case-brief {
    padding-top: 16px;
  }

  .game-layout .tool-grid {
    order: 3;
  }

  .game-layout .suspects-section {
    order: 4;
  }

  .game-layout .game-actions {
    order: 5;
  }

  .tool-button.rewarded .ad-badge {
    top: auto;
    right: auto;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .tool-button.rewarded {
    padding-bottom: 17px;
  }

  .tool-button.rewarded .tool-label {
    transform: translateY(-6px);
  }

  .tool-button.rewarded .hint-count {
    top: 3px;
    left: 3px;
  }

  .submit-button {
    justify-content: space-between;
  }

  .submit-timer {
    flex: none;
    padding-left: 7px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
  }
}

.game-screen.campaign-odyssey .game-panel .suspect-card {
  border: 1px solid rgba(94, 68, 48, 0.2);
  border-radius: 14px;
  background: linear-gradient(155deg, #fffdf8, #f5eddf);
  box-shadow: 0 3px 10px rgba(56, 39, 29, 0.1);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.game-screen.campaign-odyssey .game-panel .suspect-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(56, 39, 29, 0.14);
}

.game-screen.campaign-odyssey .game-panel .suspect-card.selected {
  border-color: var(--accent);
  background: linear-gradient(155deg, #fffaf0, #f8ead4);
  box-shadow: 0 0 0 2px rgba(230, 110, 56, 0.14), 0 5px 13px rgba(56, 39, 29, 0.12);
}

.game-screen.campaign-odyssey .game-panel .suspect-card.validation-correct {
  border-color: #e0b52f;
  background: #fff8e9;
}

.game-screen.campaign-odyssey .game-panel .suspect-card.validation-wrong {
  border-color: #c84d42;
  background: linear-gradient(145deg, #fff8f3, #ffd9d1);
}

.game-screen.campaign-odyssey .game-panel .suspect-portrait {
  border-color: rgba(112, 80, 50, 0.3);
  background: radial-gradient(circle at 36% 28%, #fffefb, #e9ddc9 76%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.68), 0 4px 11px rgba(56, 39, 29, 0.15);
}

.game-screen.campaign-odyssey .game-panel .suspect-card.selected .suspect-portrait {
  border-color: var(--accent);
}

.game-screen.campaign-odyssey .game-panel .suspect-chip.victim .suspect-portrait {
  border-color: var(--red);
}

/* Mobile play view: keep the board, controls, and a swipeable suspect rail
   above Yandex's persistent bottom ad slot. */
.mobile-case-button,
.mobile-header-actions {
  display: none;
}

@media (max-width: 680px) {
  .game-screen {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .game-screen.platform-yandex {
    --mobile-ad-space: max(90px, min(236px, 18dvh));
  }

  .game-header {
    position: absolute;
    z-index: 60;
    inset: 0 0 auto;
    min-height: 0;
    padding: calc(5px + var(--safe-top)) 9px 5px;
    pointer-events: none;
  }

  .game-header .game-quick-actions {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
  }

  .game-header .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .game-header .mobile-sound-toggle {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 15px;
  }

  .game-header .mobile-sound-toggle .sound-toggle-icon {
    font-size: 15px;
  }

  .mobile-case-button {
    display: inline-flex;
    font-size: 21px;
    line-height: 1;
  }

  .game-layout {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: calc(50px + var(--safe-top)) 9px calc(var(--mobile-ad-space, 0px) + 6px + var(--safe-bottom));
  }

  .game-panel {
    display: contents;
  }

  .game-layout .tool-grid {
    order: 0;
    flex: 0 0 auto;
    gap: 5px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .game-layout .tool-button {
    min-height: 54px;
    padding: 4px 2px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(40, 31, 43, 0.07);
  }

  .game-layout .tool-icon {
    font-size: 16px;
  }

  .game-layout .tool-label {
    font-size: 8px;
  }

  .game-layout .tool-button.rewarded {
    padding-bottom: 14px;
  }

  .game-layout .tool-button.rewarded .tool-label {
    transform: translateY(-4px);
  }

  .game-layout .tool-button.rewarded .ad-badge {
    bottom: 3px;
    font-size: 6px;
  }

  .game-layout .tool-button.rewarded .hint-count {
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    font-size: 8px;
  }

  .game-layout .game-actions {
    order: 1;
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px;
    margin: 0;
  }

  .game-layout .undo-button,
  .game-layout .submit-button {
    min-height: 42px;
    border-radius: 12px;
  }

  .game-layout .undo-button {
    width: 42px;
  }

  .game-layout .submit-button {
    padding-inline: 12px;
    font-size: 12px;
  }

  .game-layout .board-column {
    position: static;
    order: 2;
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    overflow: visible;
    padding: 0;
  }

  .game-layout .board-wrap {
    flex: 0 1 auto;
    width: min(100%, calc(100dvh - var(--mobile-ad-space, 0px) - 350px));
    min-width: 0;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1;
    margin: auto;
  }

  .game-layout .mobile-brief-block {
    display: none;
  }

  .game-layout.brief-open .mobile-brief-block {
    position: fixed;
    z-index: 50;
    inset: calc(50px + var(--safe-top)) 9px calc(var(--mobile-ad-space, 0px) + 8px + var(--safe-bottom));
    display: block;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(40, 31, 43, 0.24);
    box-shadow: 0 12px 36px rgba(40, 31, 43, 0.2);
  }

  .game-layout.brief-open .mobile-brief-block .case-brief {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    overflow: auto;
    padding: 16px;
  }

  .game-layout .suspects-section {
    order: 3;
    display: grid;
    flex: 0 0 clamp(150px, 18dvh, 174px);
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0 1px 2px;
  }

  .game-layout .suspects-heading {
    margin: 0 2px 5px;
  }

  .game-layout .suspects-heading p {
    display: none;
  }

  .game-layout .suspects-heading-actions {
    display: none;
  }

  .game-layout .suspects-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 4px 7px;
    align-items: stretch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
  }

  .game-layout .suspects-grid::-webkit-scrollbar {
    display: none;
  }

  .game-layout .suspect-card {
    flex: 0 0 clamp(132px, 28vw, 174px);
    width: auto;
    height: 100%;
    min-height: 0;
    padding: 5px 6px;
    border-radius: 12px;
    gap: 2px;
    grid-template-rows: auto auto minmax(0, 1fr);
    align-content: start;
    scroll-snap-align: start;
  }

  .game-layout .suspect-portrait-wrap,
  .game-layout .suspect-portrait {
    width: 42px;
    height: 42px;
  }

  .game-layout .suspect-name {
    font-size: 9px;
  }

  .game-layout .suspect-testimony,
  .game-layout .suspect-hints {
    gap: 2px;
    overflow-y: auto;
    font-size: 11px;
    line-height: 1.24;
    scrollbar-width: none;
  }

  .game-layout .suspect-testimony::-webkit-scrollbar,
  .game-layout .suspect-hints::-webkit-scrollbar {
    display: none;
  }

  .game-layout .case-brief {
    order: 4;
  }

  .game-layout .desktop-brief-block {
    display: none;
  }
}

@media (max-width: 680px) and (max-height: 760px) {
  .game-screen.platform-yandex {
    --mobile-ad-space: max(90px, min(236px, 18dvh));
  }

  .game-layout {
    gap: 4px;
    padding-top: calc(44px + var(--safe-top));
    padding-bottom: calc(var(--mobile-ad-space, 0px) + 5px + var(--safe-bottom));
  }

  .game-header {
    padding-top: calc(4px + var(--safe-top));
  }

  .game-header .icon-button {
    width: 36px;
    min-height: 36px;
  }

  .game-layout .tool-button {
    min-height: 44px;
  }

  .game-layout .tool-icon {
    font-size: 14px;
  }

  .game-layout .tool-label {
    font-size: 7px;
  }

  .game-layout .undo-button,
  .game-layout .submit-button {
    min-height: 38px;
  }

  .game-layout .board-wrap {
    width: min(100%, calc(100dvh - var(--mobile-ad-space, 0px) - 300px));
  }

  .game-layout .suspects-section {
    flex-basis: clamp(150px, 23dvh, 170px);
  }

  .game-layout .suspect-portrait-wrap,
  .game-layout .suspect-portrait {
    width: 32px;
    height: 32px;
  }

  .game-layout .suspect-testimony,
  .game-layout .suspect-hints {
    font-size: 10px;
    line-height: 1.2;
  }

  .game-layout.brief-open .mobile-brief-block {
    top: calc(44px + var(--safe-top));
  }
}

@media (max-width: 680px) and (max-width: 359px) {
  .game-layout .suspect-card {
    flex-basis: 128px;
  }
}

.game-screen.campaign-odyssey .game-panel .suspect-portrait img,
.game-screen.campaign-odyssey .placed-portrait img {
  object-fit: contain;
  transform: scale(1.02);
}

.game-screen.campaign-odyssey .game-panel .suspect-name {
  color: #46362d;
  font-weight: 900;
}
