@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/Nunito-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/Nunito-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/Nunito-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/Nunito-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Mochiy Pop One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/MochiyPopOne-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  background: #eef3f7;
  --active-shell-width: 100%;
  --desktop-explore-stage-width: 9999px;
  --header-content-gap: 18px;
  --brand-mark-height: clamp(52px, 7vw, 74px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --joystick-size: clamp(64px, 15vw, 82px);
  --joystick-thumb-size: clamp(24px, 5.5vw, 32px);
  --joystick-shadow: 0 6px 12px rgba(15, 23, 34, 0.1);
  --shadow: 0 24px 52px rgba(30, 58, 92, 0.16);
  --shadow-soft: 0 14px 30px rgba(30, 58, 92, 0.1);
  --brand-red: #ef6257;
  --brand-red-deep: #cf4d43;
  --brand-blue: #41a7d8;
  --brand-blue-deep: #2b7eae;
  --brand-gold: #f0c65c;
  --brand-green: #63b790;
  --surface-1: rgba(255, 252, 245, 0.96);
  --surface-2: rgba(236, 244, 250, 0.96);
  --surface-3: rgba(244, 248, 252, 0.96);
  --surface-strong: rgba(227, 238, 246, 0.96);
  --panel-border: rgba(40, 72, 103, 0.14);
  --panel-border-strong: rgba(40, 72, 103, 0.24);
  --text-muted: rgba(33, 50, 74, 0.7);
  --text-faint: rgba(33, 50, 74, 0.58);
  --focus-ring: rgba(65, 167, 216, 0.28);
  --success-bg: rgba(223, 245, 233, 0.98);
  --success-border: rgba(99, 183, 144, 0.4);
  --warning-bg: rgba(255, 245, 213, 0.98);
  --warning-border: rgba(240, 198, 92, 0.45);
  --danger-bg: rgba(255, 232, 228, 0.98);
  --danger-border: rgba(239, 98, 87, 0.38);
  --ink: #21324a;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html,
body {
  touch-action: pan-x pan-y;
}

button,
a[href],
input,
textarea,
select,
summary,
[role="button"],
[role="link"] {
  touch-action: pan-x pan-y;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 252, 0.98) 36%, rgba(223, 234, 243, 0.98) 100%),
    linear-gradient(140deg, rgba(240, 198, 92, 0.12), rgba(65, 167, 216, 0.1) 52%, rgba(239, 98, 87, 0.08));
  color: var(--ink);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.42) 0 2px, transparent 3px),
    linear-gradient(rgba(63, 95, 127, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 95, 127, 0.05) 1px, transparent 1px);
  background-size: 110px 110px, 36px 36px, 36px 36px;
  background-position: 0 0, 0 0, 0 0;
  opacity: 0.48;
  pointer-events: none;
  z-index: 0;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 28px 48px;
  position: relative;
  z-index: 1;
}

header {
  padding: 0 2px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 0;
}

body:not(.game-hidden):not(.alibi-visible):not(.verdict-visible):not(.gameover-visible) {
  --active-shell-width: 980px;
}

body.alibi-visible {
  --active-shell-width: 760px;
}

body.verdict-visible {
  --active-shell-width: 860px;
}

body.gameover-visible {
  --active-shell-width: 760px;
}

.header-actions {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

body.alibi-visible .header-actions,
body.verdict-visible .header-actions,
body.gameover-visible .header-actions,
body:not(.game-hidden):not(.alibi-visible):not(.verdict-visible):not(.gameover-visible) .header-actions {
  display: flex;
}

.brand-mark {
  display: block;
  width: auto;
  height: var(--brand-mark-height);
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 8px 18px rgba(30, 58, 92, 0.12));
  margin: 0;
  flex: 0 0 auto;
}

.lobby,
main,
.alibi,
.verdict,
.gameover {
  margin-top: var(--header-content-gap);
}

.lobby-card {
  background: linear-gradient(155deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border-radius: 30px;
  padding: 30px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 22px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  position: relative;
  overflow: hidden;
}

.lobby-card::after {
  content: "";
  position: absolute;
  inset: -60% auto auto -20%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.72), rgba(65, 167, 216, 0.14), transparent 72%);
  opacity: 0.8;
  pointer-events: none;
}

.lobby-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.lobby-grid {
  --lobby-control-border-gap: 16px;
  --lobby-panel-padding-block: 18px;
  --lobby-panel-padding-inline: 18px;
  --lobby-panel-row-gap: var(--lobby-control-border-gap);
  --lobby-joined-panel-row-gap: 10px;
  --lobby-player-list-align-offset: calc(var(--lobby-panel-row-gap) - var(--lobby-joined-panel-row-gap));
  --lobby-player-row-block-size: 64px;
  --lobby-room-actions-margin-block: calc(var(--lobby-control-border-gap) - var(--lobby-joined-panel-row-gap));
  --lobby-copy-invite-inline-size: min(100%, 260px);
  --lobby-copy-invite-margin-block-start: calc(var(--lobby-control-border-gap) - var(--lobby-panel-row-gap));
  --lobby-copy-invite-padding-block: 8px;
  --lobby-copy-invite-padding-inline: 18px;
  --lobby-copy-invite-font-size: 0.82rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.lobby-grid.lobby-grid-in-room {
  grid-template-columns: minmax(240px, 0.82fr) minmax(320px, 1.18fr);
  align-items: start;
}

.lobby-panel {
  padding: var(--lobby-panel-padding-block) var(--lobby-panel-padding-inline);
  border-radius: 22px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(241, 247, 251, 0.94));
  backdrop-filter: blur(10px);
  display: grid;
  align-content: start;
  gap: var(--lobby-panel-row-gap);
  box-shadow: var(--shadow-soft);
}

#createRoomPanel,
#joinRoomPanel {
  align-self: start;
}

#playersPanel {
  min-width: 0;
}

.lobby-grid.lobby-grid-in-room #playersPanel {
  display: grid;
  grid-template-rows: auto auto auto minmax(min-content, 1fr);
  row-gap: var(--lobby-joined-panel-row-gap);
  align-content: start;
}

.lobby-grid.lobby-grid-in-room #playersPanel .player-list {
  align-content: start;
  margin-block-start: var(--lobby-player-list-align-offset);
}

.lobby-panel h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}

.players-panel-header {
  position: relative;
  min-width: 0;
  padding-inline-end: 104px;
  font-size: 0;
}

.players-panel-header h3 {
  min-width: 0;
}

.lobby-label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.lobby-panel input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--panel-border-strong);
  font-size: 1rem;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.96);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lobby-panel input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.room-code-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(239, 98, 87, 0.16), rgba(240, 198, 92, 0.18) 45%, rgba(65, 167, 216, 0.18));
  border: 1px solid rgba(40, 72, 103, 0.2);
  display: grid;
  gap: 6px;
  text-align: center;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.6);
}

.room-code-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  font-weight: 800;
}

.room-code-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.room-code-value {
  font-size: 2rem;
  letter-spacing: 0.18em;
  font-weight: 800;
  color: #21415d;
  text-shadow: 0 3px 12px rgba(65, 167, 216, 0.18);
  line-height: 1;
}

.copy-room-code {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 1px solid var(--panel-border-strong);
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(255, 254, 250, 0.98), rgba(228, 239, 247, 0.96));
  color: #21415d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(30, 58, 92, 0.12);
  transition:
    transform 0.12s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.copy-room-code svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.copy-room-code:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.9),
    0 0 0 6px rgba(65, 167, 216, 0.42);
}

.room-code-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.secondary.copy-invite-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  column-gap: 9px;
  justify-self: center;
  inline-size: var(--lobby-copy-invite-inline-size);
  margin-block-start: var(--lobby-copy-invite-margin-block-start);
  padding-block: var(--lobby-copy-invite-padding-block);
  padding-inline: var(--lobby-copy-invite-padding-inline);
  font-size: var(--lobby-copy-invite-font-size);
  line-height: 1;
  white-space: nowrap;
  transform: translate3d(0, 0, 0) scale(1);
  backface-visibility: hidden;
  will-change: transform;
}

.secondary.copy-invite-link.hidden {
  display: none;
}

.copy-invite-link-icon {
  inline-size: 24px;
  block-size: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.lobby-hint {
  margin: 0;
  min-height: 20px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.lobby-panel > .lobby-hint {
  display: grid;
  place-items: center;
  align-self: stretch;
  text-align: center;
  transform: translateY(calc((var(--lobby-panel-padding-block) - var(--lobby-control-border-gap)) / 2));
}

.lobby-hint:empty {
  display: none;
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.player-list li {
  min-inline-size: 0;
  max-inline-size: 100%;
  padding: 8px 12px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 253, 249, 0.96), rgba(240, 246, 250, 0.95));
  border: 1px solid var(--panel-border);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 18px rgba(30, 58, 92, 0.08);
}

.player-list-item {
  inline-size: 100%;
  block-size: var(--lobby-player-row-block-size);
  min-block-size: var(--lobby-player-row-block-size);
  box-sizing: border-box;
}

.player-list-identity,
.player-list-meta {
  display: flex;
  align-items: center;
}

.player-list-identity {
  gap: 12px;
  min-width: 0;
  flex: 1;
  overflow: visible;
}

.player-list-name-row {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 0;
  inline-size: 100%;
  overflow: hidden;
}

.player-list-avatar-frame {
  --player-avatar-accent: var(--brand-blue);
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.92), rgba(65, 167, 216, 0.14) 60%, rgba(36, 81, 113, 0.12));
  border: 1px solid rgba(65, 167, 216, 0.18);
  box-shadow: inset 0 0 0 rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(
      circle at 34% 26%,
      rgba(255, 255, 255, 0.96) 0 34%,
      color-mix(in srgb, var(--player-avatar-accent) 10%, rgba(255, 255, 255, 0.94)) 58%,
      color-mix(in srgb, var(--player-avatar-accent) 18%, rgba(236, 244, 250, 0.9)) 100%
    );
  border-color: color-mix(in srgb, var(--player-avatar-accent) 34%, rgba(255, 255, 255, 0.76));
  overflow: visible;
}

.player-list-avatar {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.player-list-name {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--ink);
}

.player-list-ready-indicator {
  position: absolute;
  z-index: 1;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid var(--surface-1);
  box-shadow: 0 0 0 1px rgba(40, 72, 103, 0.14);
  pointer-events: none;
}

.player-list-ready-indicator-ready {
  background: var(--brand-green);
}

.player-list-ready-indicator-loading {
  background: var(--brand-gold);
}

.player-list-ready-indicator-reconnecting {
  background: var(--brand-red);
}

.player-list-meta {
  gap: 8px;
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.player-list-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #245171;
  background: rgba(65, 167, 216, 0.12);
  border: 1px solid rgba(65, 167, 216, 0.18);
}

.player-list-badge-host {
  color: #8f4c02;
  background: rgba(240, 198, 92, 0.2);
  border-color: rgba(240, 198, 92, 0.34);
}

.player-list-badge-reconnecting {
  color: #9d332d;
  background: rgba(239, 98, 87, 0.14);
  border-color: rgba(239, 98, 87, 0.24);
}

.player-list-item-bot {
  background:
    linear-gradient(145deg, rgba(255, 253, 249, 0.97), rgba(237, 247, 244, 0.96)),
    radial-gradient(circle at 18% 18%, rgba(240, 198, 92, 0.2), transparent 44%);
  border-color: rgba(99, 183, 144, 0.28);
}

.player-list-badge-bot {
  color: #2f6f56;
  background: rgba(99, 183, 144, 0.16);
  border-color: rgba(99, 183, 144, 0.28);
}

.player-list-action-button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(239, 98, 87, 0.28);
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(255, 252, 248, 0.98), rgba(255, 236, 231, 0.96));
  color: #b7443b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(176, 66, 56, 0.1);
  transition:
    transform 0.14s ease,
    filter 0.2s ease,
    box-shadow 0.2s ease;
}

.player-list-action-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.player-list-action-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 11px 20px rgba(176, 66, 56, 0.14);
}

.player-list-action-button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.92),
    0 0 0 6px rgba(239, 98, 87, 0.28);
}

.player-list-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.bot-control {
  display: flex;
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 0;
  justify-content: flex-end;
  transform: translateY(-50%);
  margin-block: 0;
}

.bot-control .bot-control-button {
  inline-size: auto;
  min-inline-size: 88px;
  min-block-size: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(65, 167, 216, 0.2);
  background:
    linear-gradient(160deg, rgba(255, 253, 249, 0.98) 0%, rgba(236, 244, 250, 0.98) 100%);
  color: #245171;
  font-size: 0.73rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 4px 8px rgba(43, 126, 174, 0.08);
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.lobby-room-actions {
  display: grid;
  grid-template-columns: minmax(108px, 0.72fr) minmax(172px, 1.35fr);
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.lobby-grid.lobby-grid-in-room .lobby-room-actions {
  margin-block: var(--lobby-room-actions-margin-block);
}

.lobby-room-actions .secondary {
  grid-column: 1;
  justify-self: start;
  inline-size: 100%;
  min-block-size: 44px;
  padding-inline: 16px;
  font-size: 0.78rem;
  touch-action: none;
}

.lobby-room-actions .primary {
  grid-column: 2;
  justify-self: end;
  inline-size: 100%;
  min-block-size: 58px;
  padding-inline: 22px;
  font-size: clamp(1rem, 2vw, 1.18rem);
  box-shadow: 0 18px 32px rgba(207, 77, 67, 0.28);
  touch-action: none;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 12px 20px;
  border-radius: 999px;
  min-block-size: 46px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: center;
  font-family: "Mochiy Pop One", "Nunito", sans-serif;
  transition:
    transform 0.15s ease,
    filter 0.2s ease;
  overflow: hidden;
}

.primary {
  background: linear-gradient(160deg, var(--brand-red) 0%, #f58b53 56%, var(--brand-gold) 100%);
  color: #fffdf8;
  box-shadow: 0 16px 28px rgba(207, 77, 67, 0.24);
}

.secondary {
  background: linear-gradient(160deg, rgba(255, 253, 249, 0.98) 0%, rgba(236, 244, 250, 0.98) 100%);
  color: #245171;
  box-shadow: 0 12px 24px rgba(43, 126, 174, 0.12);
  border: 1px solid rgba(65, 167, 216, 0.2);
}

.primary:focus-visible,
.secondary:focus-visible {
  outline: 4px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
}

.primary:disabled,
.secondary:disabled,
.copy-room-code:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

.primary:disabled,
.secondary:disabled {
  transform: none;
}

.copy-room-code:disabled {
  transform: translateY(-50%);
}

@media (hover: hover) and (pointer: fine) {
  .copy-room-code:hover:not(:disabled) {
    transform: translateY(calc(-50% - 1px));
    filter: saturate(1.08);
    box-shadow: 0 10px 20px rgba(30, 58, 92, 0.18);
  }

  .primary:hover:not(:disabled),
  .secondary:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.03);
    filter: saturate(1.1);
  }

  .secondary.copy-invite-link:hover:not(:disabled) {
    transform: translate3d(0, -3px, 0) scale(1.03);
  }
}

.copy-room-code:active:not(:disabled) {
  transform: translateY(calc(-50% + 1px)) scale(0.985);
  box-shadow: 0 6px 14px rgba(30, 58, 92, 0.12);
}

.primary:active:not(:disabled),
.secondary:active:not(:disabled) {
  transform: translateY(2px) scale(0.98);
}

.secondary.copy-invite-link:active:not(:disabled) {
  transform: translate3d(0, 2px, 0) scale(0.98);
}

main {
  display: block;
  position: relative;
}

#alibiTimer.danger {
  color: #b91c1c;
}

.arena {
  position: relative;
  width: min(100%, 980px);
  margin: 0 auto;
  transform-origin: center;
  will-change: transform;
  min-height: 0;
}

.arena.arena-rumble {
  animation: arena-rumble 0.9s cubic-bezier(0.32, 0.02, 0.3, 1) both;
}

@keyframes arena-rumble {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  12% {
    transform: translate3d(-6px, 4px, 0) rotate(-1.2deg) scale(1.01);
  }
  24% {
    transform: translate3d(6px, -5px, 0) rotate(1.4deg) scale(1.02);
  }
  36% {
    transform: translate3d(-8px, 6px, 0) rotate(-1.6deg) scale(1.01);
  }
  48% {
    transform: translate3d(7px, 3px, 0) rotate(1.2deg) scale(1.02);
  }
  60% {
    transform: translate3d(-5px, -4px, 0) rotate(-1deg) scale(1.01);
  }
  72% {
    transform: translate3d(4px, 5px, 0) rotate(0.8deg) scale(1.01);
  }
  84% {
    transform: translate3d(-3px, -3px, 0) rotate(-0.6deg) scale(1);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

canvas#game {
  display: block;
  width: 100%;
  height: auto;
  margin-inline: auto;
  aspect-ratio: 900 / 560;
  border-radius: 34px;
  box-shadow:
    0 34px 60px rgba(30, 58, 92, 0.18),
    0 10px 24px rgba(30, 58, 92, 0.12);
  border: 3px solid rgba(255, 251, 243, 0.96);
  background: linear-gradient(180deg, rgba(252, 249, 243, 0.98), rgba(226, 236, 244, 0.98));
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(29, 47, 67, 0.62);
  border-radius: 28px;
  backdrop-filter: blur(6px);
}

.overlay-card {
  background: linear-gradient(160deg, rgba(255, 252, 246, 0.98), rgba(240, 246, 250, 0.97));
  padding: 24px 30px;
  border-radius: 18px;
  text-align: center;
  border: 1px solid var(--panel-border);
  box-shadow: 0 16px 30px rgba(30, 58, 92, 0.18);
}

.touch-controls {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  isolation: isolate;
}

.touch-controls.is-enabled {
  opacity: 1;
  pointer-events: auto;
  touch-action: none;
}

.touch-controls-surface {
  position: absolute;
  inset: 0;
  z-index: 1;
  touch-action: none;
}

.virtual-joystick {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}

.virtual-joystick-base {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: var(--joystick-size);
  height: var(--joystick-size);
  margin-left: calc(var(--joystick-size) * -0.5);
  margin-top: calc(var(--joystick-size) * -0.5);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 50% 50%, rgba(60, 66, 76, 0.06) 0 43%, transparent 44%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.024) 0 57%, transparent 58%),
    linear-gradient(180deg, rgba(93, 100, 110, 0.084), rgba(55, 61, 70, 0.064));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.06),
    inset 0 -1px 2px rgba(36, 41, 49, 0.06),
    inset 0 0 0 6px rgba(255, 255, 255, 0.012),
    var(--joystick-shadow);
  backdrop-filter: blur(3px) saturate(0.88);
  opacity: 0;
  transform: scale(0.84);
  transition:
    opacity 110ms ease,
    transform 140ms ease;
}

.virtual-joystick-base::before,
.virtual-joystick-base::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.virtual-joystick-base::before {
  inset: 10%;
  border: 1px solid rgba(255, 255, 255, 0.045);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.045),
    inset 0 -1px 1px rgba(41, 46, 54, 0.05);
}

.virtual-joystick-base::after {
  inset: 28%;
  background: radial-gradient(circle, rgba(47, 52, 60, 0.12), rgba(47, 52, 60, 0.026) 66%, transparent 72%);
}

.virtual-joystick.is-visible .virtual-joystick-base {
  opacity: 0.26;
  transform: scale(1);
}

.virtual-joystick.is-engaged .virtual-joystick-base {
  opacity: 0.31;
}

.virtual-joystick-thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--joystick-thumb-size);
  height: var(--joystick-thumb-size);
  margin-left: calc(var(--joystick-thumb-size) * -0.5);
  margin-top: calc(var(--joystick-thumb-size) * -0.5);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(89, 96, 106, 0.86), rgba(53, 59, 68, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 2px 5px rgba(15, 23, 34, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.03),
    inset 0 -1px 2px rgba(0, 0, 0, 0.14);
  opacity: 0.64;
  transform: translate3d(0, 0, 0);
  transition: opacity 110ms ease;
}

.virtual-joystick-thumb::before {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 56%, rgba(46, 51, 59, 0.36) 0 22%, rgba(46, 51, 59, 0.22) 38%, transparent 62%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.025),
    inset 0 -2px 2px rgba(0, 0, 0, 0.12);
}

.virtual-joystick-thumb::after {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 0.6;
}

.virtual-joystick.is-visible .virtual-joystick-thumb {
  opacity: 0.74;
}

.virtual-joystick.is-engaged .virtual-joystick-thumb {
  opacity: 0.8;
}

.alibi-card {
  --alibi-shell: #f4eddd;
  --alibi-shell-border: rgba(111, 130, 148, 0.18);
  --alibi-panel: #fbf6ec;
  --alibi-panel-border: rgba(111, 130, 148, 0.13);
  --alibi-panel-alt: #eef3ef;
  --alibi-panel-alt-border: rgba(111, 130, 148, 0.14);
  --alibi-field: #fffdf8;
  --alibi-field-border: rgba(111, 130, 148, 0.2);
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 32px);
  border-radius: 30px;
  background: var(--alibi-shell);
  display: grid;
  gap: 20px;
  border: 2px solid var(--alibi-shell-border);
}

.alibi-hero,
.alibi-response-section,
.alibi-progress-section {
  display: grid;
  gap: 12px;
}

.alibi-hero {
  gap: 14px;
}

.alibi-copy,
.verdict-copy {
  display: grid;
  gap: 7px;
}

.alibi-header,
.verdict-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.alibi-header h2 {
  display: inline-flex;
  align-items: center;
  gap: 0.34em;
  white-space: nowrap;
}

.alibi-glance-hud,
.verdict-glance-hud {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.alibi-glance-hud {
  padding: 0;
}

.alibi-glance-stat,
.verdict-glance-stat {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 18px;
}

.alibi-glance-stat {
  background: var(--alibi-panel);
  border: 2px solid var(--alibi-panel-border);
}

.alibi-glance-stat span,
.verdict-glance-stat span {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: rgba(33, 50, 74, 0.62);
  line-height: 1;
}

.alibi-glance-stat strong,
.verdict-glance-stat strong {
  font-size: clamp(0.98rem, 2.65vw, 1.18rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: #235274;
  white-space: nowrap;
  line-height: 1.05;
}

.alibi-glance-stat:first-child strong {
  color: #2a648f;
}

.alibi-glance-stat strong#alibiTimer {
  line-height: 1;
}

.alibi-card h2,
.verdict-title h2 {
  margin: 0;
  font-size: clamp(1.56rem, 4.45vw, 2.02rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 800;
  color: #243754;
  max-width: none;
}

.screen-section-title {
  margin: 0;
  display: block;
  font-size: clamp(0.95rem, 2vw, 1rem);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: #253854;
}

.verdict-loading-card h3 {
  margin: 0;
  line-height: 1.16;
  letter-spacing: -0.015em;
}

.alibi-title-emoji {
  font-size: 0.62em;
  line-height: 1;
  transform: translateY(0.04em);
}

.alibi-subtitle {
  margin: 0;
  color: rgba(33, 50, 74, 0.74);
  font-size: 0.95rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 500;
  max-width: none;
}

.alibi-case-details {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--alibi-panel-alt);
  border: 2px solid var(--alibi-panel-alt-border);
}

.alibi-collected-items {
  margin: 0;
  color: rgba(33, 50, 74, 0.84);
  font-size: 0.95rem;
  line-height: 1.32;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.alibi-label {
  display: grid;
  gap: 8px;
}

.alibi-label textarea {
  resize: none;
  min-height: 150px;
  border-radius: 20px;
  border: 2px solid var(--alibi-field-border);
  padding: 16px 18px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.38;
  letter-spacing: -0.005em;
  font-weight: 500;
  background: var(--alibi-field);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.alibi-label textarea::placeholder {
  color: rgba(33, 50, 74, 0.48);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.alibi-label textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.alibi-status {
  min-height: 0;
  font-size: 0.92rem;
  line-height: 1.34;
  letter-spacing: -0.005em;
  font-weight: 500;
  color: rgba(33, 50, 74, 0.72);
}

.alibi-progress-section {
  padding-top: 2px;
}

.alibi-progress-list {
  gap: 8px;
}

.alibi-progress-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--alibi-panel);
  border: 2px solid var(--alibi-panel-border);
  font-size: 0.96rem;
  line-height: 1.28;
}

.alibi-progress-list li span:first-child {
  min-width: 0;
}

.alibi-progress-list li span:last-child {
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.1;
}

.alibi-visible main {
  display: none;
}

.verdict-card {
  --verdict-shell: #f4eddd;
  --verdict-shell-border: rgba(111, 130, 148, 0.18);
  --verdict-panel: #fbf6ec;
  --verdict-panel-border: rgba(111, 130, 148, 0.13);
  --verdict-panel-alt: #eef3ef;
  --verdict-panel-alt-border: rgba(111, 130, 148, 0.14);
  --verdict-highlight-good: #edf5ee;
  --verdict-highlight-good-border: rgba(99, 183, 144, 0.28);
  --verdict-highlight-bad: #f8ece8;
  --verdict-highlight-bad-border: rgba(239, 98, 87, 0.24);
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 32px);
  border-radius: 30px;
  background: var(--verdict-shell);
  display: grid;
  gap: 18px;
  border: 2px solid var(--verdict-shell-border);
  box-shadow: none;
}

.verdict-hero {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.verdict-title h2 {
  margin: 0;
}

.verdict-round {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.verdict-glance-stat {
  background: var(--verdict-panel);
  border: 2px solid var(--verdict-panel-border);
}

.verdict-glance-stat strong.danger {
  color: #b91c1c;
}

.verdict-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-faint);
}

.verdict-tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.verdict-badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: radial-gradient(circle at top, rgba(255, 253, 247, 0.98), rgba(240, 198, 92, 0.88));
  box-shadow: 0 12px 24px rgba(240, 198, 92, 0.24);
  border: 1px solid rgba(215, 163, 49, 0.34);
}

.verdict-loading-active .verdict-hero {
  gap: 10px;
}

.verdict-loading-active .verdict-glance-hud {
  display: none;
}

.verdict-loading-active .verdict-list {
  gap: 0;
}

.verdict-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.verdict-section {
  display: grid;
  gap: 10px;
}

.screen-section-title {
  margin: 0;
  color: #253854;
}

.verdict-highlight {
  display: grid;
  align-content: center;
  gap: 4px;
  border: 2px solid var(--verdict-panel-border);
  border-radius: 18px;
  padding: 12px 14px;
  background: var(--verdict-panel);
  box-shadow: none;
}

.verdict-highlight h3 {
  margin: 0;
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  line-height: 1.08;
  font-weight: 600;
  color: rgba(33, 50, 74, 0.62);
}

.verdict-highlight p {
  margin: 0;
}

.verdict-highlight-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.verdict-highlight-reason {
  color: rgba(33, 50, 74, 0.76);
  font-size: 0.87rem;
  line-height: 1.32;
  letter-spacing: -0.005em;
  font-weight: 500;
}

.verdict-highlight.least-suspicious {
  border-color: var(--verdict-highlight-good-border);
  background: var(--verdict-highlight-good);
}

.verdict-highlight.most-suspicious {
  border-color: var(--verdict-highlight-bad-border);
  background: var(--verdict-highlight-bad);
}

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

.verdict-list li,
.verdict-entry {
  border: 2px solid var(--verdict-panel-border);
  border-radius: 18px;
  padding: 12px 14px;
  background: var(--verdict-panel);
  box-shadow: none;
}

.verdict-entry {
  display: grid;
  align-content: center;
  gap: 6px;
}

.verdict-entry-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.verdict-rank,
.gameover-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(111, 130, 148, 0.18);
  background: rgba(246, 250, 252, 0.96);
  color: rgba(33, 50, 74, 0.76);
  box-sizing: border-box;
}

.verdict-name {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.verdict-suspicion-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(111, 130, 148, 0.16);
  background: rgba(255, 252, 245, 0.92);
  color: rgba(33, 50, 74, 0.82);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  box-sizing: border-box;
}

.verdict-total-score {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(111, 130, 148, 0.16);
  background: rgba(255, 252, 245, 0.9);
  color: rgba(33, 50, 74, 0.82);
  box-sizing: border-box;
  white-space: nowrap;
}

.verdict-total-score-value {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: rgba(33, 50, 74, 0.88);
}

.verdict-total-score-value::after {
  content: " pts";
  font-size: 0.68em;
  font-weight: 800;
  color: rgba(33, 50, 74, 0.6);
}

.verdict-entry.is-gold {
  border-color: rgba(240, 198, 92, 0.28);
  background: #faf3df;
}

.verdict-entry.is-silver {
  border-color: rgba(140, 154, 168, 0.24);
  background: #f3f5f1;
}

.verdict-entry.is-bronze {
  border-color: rgba(217, 137, 89, 0.24);
  background: #f8eee5;
}

.verdict-entry.is-gold .verdict-rank,
.gameover-entry.is-winner .gameover-rank {
  border-color: rgba(215, 163, 49, 0.24);
  background: rgba(255, 248, 229, 0.96);
  color: #8f4c02;
}

.verdict-entry.is-silver .verdict-rank {
  border-color: rgba(140, 154, 168, 0.2);
  background: rgba(250, 252, 249, 0.96);
  color: #516579;
}

.verdict-entry.is-bronze .verdict-rank {
  border-color: rgba(217, 137, 89, 0.2);
  background: rgba(255, 247, 241, 0.96);
  color: #9a5b33;
}

.verdict-entry.is-gold .verdict-total-score {
  border-color: rgba(215, 163, 49, 0.24);
  background: rgba(255, 248, 229, 0.92);
}

.verdict-entry.is-silver .verdict-total-score {
  border-color: rgba(140, 154, 168, 0.2);
  background: rgba(250, 252, 249, 0.92);
}

.verdict-entry.is-bronze .verdict-total-score {
  border-color: rgba(217, 137, 89, 0.2);
  background: rgba(255, 247, 241, 0.92);
}

.verdict-meter {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: rgba(240, 198, 92, 0.24);
  overflow: hidden;
  margin: 0;
}

.verdict-meter span {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(243, 207, 104, 0.96), rgba(231, 151, 58, 0.96));
  border-radius: inherit;
  transition: width 0.4s ease;
}

.verdict-list h3 {
  margin: 0;
  font-size: 1rem;
}

.verdict-list p {
  margin: 0;
  color: rgba(33, 50, 74, 0.85);
  white-space: pre-wrap;
  line-height: 1.32;
  letter-spacing: -0.005em;
}

.verdict-entry.suspicion-low .verdict-meter {
  background: rgba(99, 183, 144, 0.22);
}

.verdict-entry.suspicion-low .verdict-meter span {
  background: linear-gradient(90deg, rgba(129, 207, 165, 0.96), rgba(67, 163, 111, 0.96));
}

.verdict-entry.suspicion-low .verdict-suspicion-badge {
  border-color: rgba(99, 183, 144, 0.28);
  background: rgba(237, 245, 238, 0.94);
  color: #2f7854;
}

.verdict-entry.suspicion-medium .verdict-meter {
  background: rgba(240, 198, 92, 0.24);
}

.verdict-entry.suspicion-medium .verdict-meter span {
  background: linear-gradient(90deg, rgba(243, 207, 104, 0.96), rgba(231, 151, 58, 0.96));
}

.verdict-entry.suspicion-medium .verdict-suspicion-badge {
  border-color: rgba(240, 198, 92, 0.32);
  background: rgba(255, 248, 229, 0.94);
  color: #8f4c02;
}

.verdict-entry.suspicion-high .verdict-meter {
  background: rgba(239, 98, 87, 0.18);
}

.verdict-entry.suspicion-high .verdict-meter span {
  background: linear-gradient(90deg, rgba(244, 128, 111, 0.96), rgba(207, 77, 67, 0.96));
}

.verdict-entry.suspicion-high .verdict-suspicion-badge {
  border-color: rgba(239, 98, 87, 0.28);
  background: rgba(248, 236, 232, 0.94);
  color: #a64239;
}

.verdict-list .verdict-reason {
  color: rgba(33, 50, 74, 0.8);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.34;
}

.verdict-list .verdict-loading {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.verdict-loading-card {
  padding: clamp(22px, 5vw, 30px);
  border-radius: 26px;
  background: var(--verdict-panel-alt);
  border: 2px solid var(--verdict-panel-alt-border);
  box-shadow: none;
  display: grid;
  gap: 12px;
  text-align: center;
}

.verdict-loading-sparks {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: clamp(1.22rem, 4.2vw, 1.6rem);
  line-height: 1;
  flex-wrap: wrap;
}

.verdict-loading-spark {
  display: inline-block;
  animation: verdict-spark-pop 1.8s ease-in-out infinite;
  animation-delay: var(--spark-delay, 0ms);
}

.verdict-loading-card h3 {
  margin: 0;
  font-size: clamp(1.28rem, 4.2vw, 1.72rem);
  letter-spacing: -0.02em;
  color: #21415d;
}

.verdict-loading-card p {
  margin: 0;
  color: rgba(33, 50, 74, 0.76);
  font-size: clamp(0.98rem, 3.35vw, 1.1rem);
  line-height: 1.32;
  letter-spacing: -0.01em;
  font-weight: 500;
  max-width: 28ch;
  justify-self: center;
}

.verdict-loading-meter {
  height: 12px;
  border-radius: 999px;
  background: rgba(65, 167, 216, 0.1);
  overflow: hidden;
  position: relative;
  width: min(100%, 520px);
  justify-self: center;
}

.verdict-loading-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(65, 167, 216, 0.92), rgba(95, 183, 144, 0.95), rgba(240, 198, 92, 0.92));
  border-radius: 999px;
  transition: width 120ms linear;
}

.verdict-loading-progress {
  font-weight: 600;
  color: #245171;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.79rem;
}

.gameover-card {
  --gameover-shell: #f4eddd;
  --gameover-shell-border: rgba(111, 130, 148, 0.18);
  --gameover-panel: #fbf6ec;
  --gameover-panel-border: rgba(111, 130, 148, 0.13);
  --gameover-panel-alt: #eef3ef;
  --gameover-panel-alt-border: rgba(111, 130, 148, 0.14);
  --gameover-winner-panel: #faf3df;
  --gameover-winner-panel-border: rgba(240, 198, 92, 0.28);
  --gameover-card-gap: 18px;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 32px);
  padding-block-end: var(--gameover-card-gap);
  border-radius: 30px;
  background: var(--gameover-shell);
  display: grid;
  gap: var(--gameover-card-gap);
  border: 2px solid var(--gameover-shell-border);
  box-shadow: none;
}

.gameover-hero {
  display: grid;
  gap: 14px;
}

.gameover-hero > div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.gameover-card h2,
.gameover-card h3 {
  margin: 0;
}

.gameover-hero h2 {
  margin-bottom: 0;
  font-size: clamp(1.56rem, 4.45vw, 2.02rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 800;
  color: #243754;
}

.gameover-subtitle {
  margin: 0;
  color: rgba(33, 50, 74, 0.74);
  font-size: 0.95rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.gameover-winner {
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--gameover-winner-panel);
  border: 2px solid var(--gameover-winner-panel-border);
  font-weight: 700;
  color: #9d6808;
  font-size: 0.96rem;
  line-height: 1.32;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.gameover-actions {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.gameover-actions .primary {
  width: min(100%, 260px);
}

.gameover-actions .secondary {
  width: min(100%, 180px);
  padding-inline: 16px;
  font-size: 0.82rem;
}

.gameover-leave-actions {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 260px);
}

.gameover-section {
  display: grid;
  gap: 10px;
}

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

.gameover-list li {
  border: 2px solid var(--gameover-panel-border);
  border-radius: 18px;
  padding: 12px 14px;
  background: var(--gameover-panel);
  box-shadow: none;
  color: rgba(33, 50, 74, 0.85);
}

.gameover-entry {
  display: grid;
  grid-template-columns: min-content minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  gap: 4px 10px;
}

.gameover-entry.is-winner {
  border-color: var(--gameover-winner-panel-border);
  background: var(--gameover-winner-panel);
}

.gameover-entry.is-silver {
  border-color: rgba(140, 154, 168, 0.24);
  background: #f3f5f1;
}

.gameover-entry.is-bronze {
  border-color: rgba(217, 137, 89, 0.24);
  background: #f8eee5;
}

.gameover-player-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.gameover-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
  display: block;
}

.gameover-player-name {
  min-width: 0;
  line-height: 1.12;
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.gameover-player-left-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(111, 130, 148, 0.22);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(238, 243, 239, 0.72);
  color: rgba(63, 78, 96, 0.74);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.gameover-entry.has-left-room .gameover-player-identity {
  flex-wrap: wrap;
  row-gap: 4px;
}

.gameover-rank {
  justify-self: start;
}

.gameover-score {
  justify-self: end;
  font-weight: 700;
  color: rgba(33, 50, 74, 0.82);
  font-size: 0.9rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gameover-entry.is-winner .gameover-score {
  color: #9d6808;
}

.gameover-entry.is-winner .gameover-player-name {
  color: #8c5a0b;
}

.lobby-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px 18px;
}

.lobby-copy {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.lobby-hero-actions {
  display: flex;
  justify-self: end;
  align-self: start;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.tutorial-trigger {
  inline-size: 46px;
  block-size: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-family: "Mochiy Pop One", "Nunito", sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 10px 18px rgba(43, 126, 174, 0.12);
}

.audio-toggle {
  position: relative;
  overflow: visible;
}

.audio-toggle-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #245171;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.audio-toggle-icon::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(99, 183, 144, 0.2), rgba(99, 183, 144, 0.06) 68%, transparent 72%);
  transform: scale(1);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.audio-toggle-icon svg {
  position: relative;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.audio-toggle-wave {
  transform-origin: 50% 50%;
  opacity: 1;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.audio-toggle-wave-inner {
  transition-delay: 0.02s;
}

.audio-toggle-wave-outer {
  transition-delay: 0.04s;
}

.audio-toggle[aria-pressed="false"] .audio-toggle-icon {
  transform: scale(0.96);
}

.audio-toggle[aria-pressed="false"] .audio-toggle-wave {
  opacity: 0;
  transform: scale(0.72);
}

.audio-toggle[aria-pressed="false"] .audio-toggle-icon::before {
  background: radial-gradient(circle, rgba(239, 98, 87, 0.16), rgba(239, 98, 87, 0.04) 68%, transparent 72%);
  transform: scale(0.9);
}

.audio-toggle:focus-visible {
  outline-offset: 4px;
}

.tutorial-trigger-mobile {
  display: none;
}

.audio-toggle-mobile,
.audio-toggle-lobby {
  display: none;
}

body.alibi-visible .audio-toggle-mobile,
body.verdict-visible .audio-toggle-mobile,
body.gameover-visible .audio-toggle-mobile,
body:not(.game-hidden):not(.alibi-visible):not(.verdict-visible):not(.gameover-visible) .audio-toggle-mobile {
  display: inline-flex;
}

.lobby-copy h2 {
  margin: 0;
  font-size: clamp(0.9rem, 1.6vw, 1rem);
  line-height: 1.18;
}

.lobby-card,
.card {
  background: linear-gradient(160deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.lobby-panel,
.room-code-card {
  background: linear-gradient(145deg, rgba(255, 253, 249, 0.97), rgba(240, 246, 250, 0.95));
  border-color: var(--panel-border);
  box-shadow: var(--shadow-soft);
}

.primary {
  background: linear-gradient(160deg, var(--brand-red) 0%, #f58b53 56%, var(--brand-gold) 100%);
  color: #fffdf8;
}

.secondary {
  background: linear-gradient(160deg, rgba(255, 253, 249, 0.98) 0%, rgba(236, 244, 250, 0.98) 100%);
  color: #245171;
}

.primary:focus-visible,
.secondary:focus-visible {
  outline-color: rgba(255, 255, 255, 0.92);
}

.alibi-card {
  background: var(--alibi-shell);
  border: 2px solid var(--alibi-shell-border);
  box-shadow: none;
}

.alibi-glance-stat,
.alibi-case-details,
.alibi-progress-list li {
  box-shadow: none;
}

.alibi-progress-list li {
  background: var(--alibi-panel);
  border: 2px solid var(--alibi-panel-border);
}

.verdict-card {
  background: var(--verdict-shell);
  border: 2px solid var(--verdict-shell-border);
  box-shadow: none;
}

.verdict-glance-stat,
.verdict-highlight,
.verdict-entry,
.verdict-loading-card {
  box-shadow: none;
}

.verdict-glance-stat,
.verdict-entry,
.verdict-list li {
  background: var(--verdict-panel);
  border: 2px solid var(--verdict-panel-border);
}

.verdict-loading-card {
  background: var(--verdict-panel-alt);
  border: 2px solid var(--verdict-panel-alt-border);
}

canvas#game {
  border: 3px solid rgba(255, 251, 243, 0.94);
  background: linear-gradient(180deg, rgba(252, 249, 243, 0.98), rgba(226, 236, 244, 0.98));
}

.overlay {
  background: rgba(29, 47, 67, 0.62);
}

.overlay-card {
  background: linear-gradient(160deg, rgba(255, 252, 246, 0.98), rgba(240, 246, 250, 0.97));
  border-color: var(--panel-border);
  box-shadow: 0 18px 40px rgba(30, 58, 92, 0.18);
}

.verdict-badge {
  background: #faf3df;
  border-color: rgba(240, 198, 92, 0.28);
  box-shadow: none;
}

.gameover-score,
.alibi-glance-stat strong,
.verdict-glance-stat strong,
.gameover-winner {
  color: #245171;
}

@keyframes verdict-spark-pop {
  0%,
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 0.92;
  }
  35% {
    transform: translateY(-7px) scale(1.08) rotate(-4deg);
    opacity: 1;
  }
  65% {
    transform: translateY(-2px) scale(0.98) rotate(3deg);
    opacity: 0.95;
  }
}

.verdict-visible main,
.verdict-visible #alibiScreen,
.verdict-visible #lobby {
  display: none;
}

.gameover-visible main,
.gameover-visible #alibiScreen,
.gameover-visible #lobby,
.gameover-visible #verdictScreen {
  display: none;
}

.game-hidden main {
  display: none;
}

.hidden {
  display: none;
}

body.touch-explore-active {
  overscroll-behavior: none;
}

body.touch-explore-active .page {
  max-width: none;
}

body.mobile-explore-input-active {
  overflow: hidden;
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  height: 100svh;
  height: 100dvh;
  touch-action: none;
}

body.mobile-explore-input-active .page {
  max-width: none;
  overflow: hidden;
}

@media (pointer: coarse) {
  canvas#game {
    border: none;
    box-shadow: none;
  }

  body.mobile-explore-input-active header {
    position: fixed;
    top: calc(var(--safe-top) + 16px);
    left: calc(var(--safe-left) + 18px);
    right: calc(var(--safe-right) + 18px);
    width: auto;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: var(--brand-mark-height);
    padding: 0 2px;
  }

  body.mobile-explore-input-active header,
  body.mobile-explore-input-active header * {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
  }

  body.mobile-explore-input-active .header-actions,
  body.mobile-explore-input-active .header-actions * {
    pointer-events: auto;
  }

  body.mobile-explore-input-active .brand-mark {
    height: clamp(34px, 8vw, 38px);
    max-width: 100%;
  }

  body.mobile-explore-input-active #lobby,
  body.mobile-explore-input-active #alibiScreen,
  body.mobile-explore-input-active #verdictScreen,
  body.mobile-explore-input-active #gameOverScreen {
    display: none;
  }

  body.mobile-explore-input-active .page {
    padding: 0;
    min-height: 100svh;
    min-height: 100dvh;
    height: 100svh;
    height: 100dvh;
  }

  body.mobile-explore-input-active #exploreShell {
    position: fixed;
    inset: 0;
    display: block;
    height: auto;
    min-height: 0;
    margin-top: 0;
    z-index: 10;
  }

  body.mobile-explore-input-active .arena {
    position: absolute;
    inset: 0;
    display: grid;
    height: auto;
    width: auto;
    place-items: center;
    overflow: hidden;
    padding: 0;
    background: transparent;
  }

  body.mobile-explore-input-active.touch-explore-active .arena {
    top: var(--mobile-explore-canvas-region-top, 0px);
    bottom: 0;
  }

  body.mobile-explore-input-active canvas#game {
    max-width: 100%;
    max-height: 100%;
    object-fit: fill;
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(252, 249, 243, 0.98), rgba(226, 236, 244, 0.98));
  }

  body.mobile-explore-input-active .overlay {
    border-radius: 0;
  }

  body.mobile-explore-input-active .touch-controls {
    position: fixed;
    inset: 0;
    z-index: 40;
  }
}

@media (max-width: 960px) {
  main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --header-content-gap: 16px;
    --brand-mark-height: clamp(42px, 12vw, 52px);
  }

  .alibi-card,
  .verdict-card,
  .gameover-card {
    padding: clamp(20px, 4.6vw, 26px);
  }

  .alibi-hero,
  .verdict-hero,
  .gameover-hero,
  .alibi-response-section,
  .alibi-progress-section,
  .verdict-section {
    gap: 11px;
  }

  .alibi-copy,
  .verdict-copy {
    gap: 6px;
  }

  .alibi-card h2,
  .verdict-title h2,
  .gameover-hero h2 {
    font-size: clamp(1.42rem, 5.8vw, 1.82rem);
    line-height: 1.08;
  }

  .screen-section-title {
    font-size: 0.89rem;
  }

  .alibi-subtitle,
  .verdict-tagline,
  .gameover-subtitle {
    font-size: 0.89rem;
    line-height: 1.28;
  }

  .alibi-collected-items {
    font-size: 0.93rem;
    line-height: 1.3;
  }

  .alibi-label {
    gap: 7px;
  }

  .alibi-label textarea {
    min-height: 138px;
    padding: 14px 16px;
    font-size: 1rem;
  }

  .alibi-status {
    font-size: 0.9rem;
    line-height: 1.32;
  }

  .alibi-progress-list {
    gap: 7px;
  }

  .alibi-progress-list li {
    gap: 9px;
    padding: 9px 11px;
    border-radius: 15px;
  }

  .verdict-list {
    gap: 9px;
  }

  .verdict-entry {
    gap: 5px;
  }

  .verdict-list li,
  .verdict-entry {
    padding: 11px 12px;
    border-radius: 17px;
  }

  .verdict-entry-header {
    gap: 7px;
  }

  .verdict-suspicion-badge {
    min-height: 26px;
    padding: 4px 8px;
    font-size: 0.68rem;
  }

  .verdict-rank,
  .gameover-rank {
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 9px;
  }

  .verdict-total-score {
    min-height: 26px;
    padding: 4px 9px;
  }

  .verdict-total-score-value {
    font-size: 0.8rem;
  }

  .verdict-list .verdict-reason {
    font-size: 0.88rem;
  }

  .alibi-case-details,
  .verdict-highlight {
    padding: 12px 14px;
    border-radius: 18px;
  }

  .alibi-case-details {
    gap: 7px;
  }

  .verdict-highlight {
    gap: 3px;
  }

  .verdict-highlight-name {
    line-height: 1.14;
  }

  .verdict-highlight-reason {
    line-height: 1.34;
  }

  .alibi-glance-hud,
  .verdict-glance-hud {
    gap: 9px;
  }

  .alibi-glance-stat,
  .verdict-glance-stat {
    gap: 4px;
    padding: 11px 12px;
    border-radius: 17px;
  }

  .page {
    padding: 16px 18px 32px;
  }

  .lobby-card {
    padding: 22px;
  }

  .lobby-grid.lobby-grid-initial-panels > #createRoomPanel,
  .lobby-grid.lobby-grid-in-room > #createRoomPanel {
    min-block-size: 255.5px;
  }

  .lobby-grid.lobby-grid-initial-panels {
    grid-template-columns: 1fr;
  }

  .lobby-grid.lobby-grid-in-room {
    --lobby-copy-invite-inline-size: 100%;
    --lobby-copy-invite-padding-inline: 14px;
    --lobby-copy-invite-font-size: 0.78rem;
    grid-template-columns: 1fr;
  }

  .room-code-value {
    font-size: 1.6rem;
    letter-spacing: 0.12em;
  }

  .copy-room-code {
    right: 2px;
    width: 34px;
    height: 34px;
  }

  .alibi-card {
    gap: 16px;
  }

  .alibi-progress-list li {
    font-size: 0.94rem;
    line-height: 1.24;
  }

  .gameover-card {
    --gameover-card-gap: 16px;
    padding-block-end: var(--gameover-card-gap);
  }

  .gameover-winner,
  .gameover-list li {
    padding: 11px 12px;
    border-radius: 17px;
  }

  .gameover-list {
    gap: 9px;
  }

  .gameover-entry {
    grid-template-columns: min-content minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px 8px;
  }

  .gameover-player-name {
    font-size: 1rem;
  }

  .gameover-score {
    font-size: 0.88rem;
  }

  .gameover-score {
    grid-column: auto;
  }

  .verdict-card {
    gap: 16px;
  }

  .verdict-loading-card {
    gap: 11px;
    padding: 20px 18px;
    border-radius: 24px;
  }

  .verdict-loading-card h3 {
    font-size: clamp(1.16rem, 5.1vw, 1.54rem);
    line-height: 1.12;
  }

  .verdict-loading-card p {
    font-size: clamp(0.92rem, 3.7vw, 1rem);
    line-height: 1.3;
  }

  .verdict-loading-progress {
    font-size: 0.75rem;
  }

  .verdict-badge {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 1.64rem;
  }
}

@media (max-width: 720px), (pointer: coarse) and (orientation: landscape) and (max-height: 560px) {
  .lobby-card {
    gap: 16px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .lobby-card::after {
    content: none;
  }

  .lobby-card:has(.lobby-grid-in-room) .lobby-hero {
    display: none;
  }

  .lobby-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
    padding: 14px 16px;
    border: 1px solid rgba(40, 72, 103, 0.12);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(255, 253, 249, 0.92), rgba(240, 246, 250, 0.86));
    box-shadow: 0 10px 22px rgba(30, 58, 92, 0.08);
    backdrop-filter: blur(8px);
  }

  .lobby-copy {
    gap: 6px;
    justify-items: start;
  }

  .lobby-copy h2 {
    font-size: 0.98rem;
    line-height: 1.22;
  }

  .lobby-subtitle {
    font-size: 0.86rem;
    line-height: 1.3;
  }

  .lobby-hero-actions {
    align-self: center;
    padding-top: 0;
  }
}

@media (max-width: 560px) {
  .alibi-card,
  .verdict-card,
  .gameover-card {
    padding: 18px;
    border-radius: 26px;
  }

  .gameover-card {
    padding-block-end: var(--gameover-card-gap);
  }

  .alibi-hero,
  .verdict-hero,
  .gameover-hero,
  .alibi-response-section,
  .alibi-progress-section,
  .verdict-section {
    gap: 10px;
  }

  .alibi-card h2,
  .verdict-title h2,
  .gameover-hero h2 {
    font-size: clamp(1.32rem, 7vw, 1.64rem);
    line-height: 1.08;
  }

  .screen-section-title {
    font-size: 0.85rem;
    line-height: 1.14;
  }

  .alibi-subtitle,
  .verdict-tagline,
  .gameover-subtitle {
    font-size: 0.85rem;
    line-height: 1.26;
  }

  .alibi-label textarea {
    min-height: 126px;
    padding: 13px 14px;
    font-size: 1rem;
    line-height: 1.36;
  }

  .alibi-status {
    font-size: 0.88rem;
  }

  .alibi-progress-list {
    gap: 6px;
  }

  .alibi-progress-list li {
    gap: 8px;
    padding: 8px 10px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.22;
  }

  .verdict-list {
    gap: 8px;
  }

  .verdict-entry {
    gap: 4px;
  }

  .verdict-list li,
  .verdict-entry {
    padding: 10px 11px;
    border-radius: 16px;
  }

  .verdict-entry-header {
    gap: 6px;
  }

  .verdict-suspicion-badge {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.66rem;
  }

  .verdict-rank,
  .gameover-rank {
    font-size: 0.82rem;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 8px;
  }

  .verdict-total-score {
    min-height: 24px;
    padding: 3px 8px;
  }

  .verdict-total-score-value {
    font-size: 0.76rem;
  }

  .gameover-list {
    gap: 8px;
  }

  .gameover-winner,
  .gameover-list li {
    padding: 10px 11px;
    border-radius: 16px;
  }

  .gameover-entry {
    gap: 2px 8px;
  }

  .gameover-player-name {
    font-size: 1rem;
  }

  .gameover-score {
    font-size: 0.85rem;
  }

  .verdict-name {
    font-size: 1rem;
    line-height: 1.12;
  }

  .verdict-meter {
    height: 8px;
  }

  .verdict-list .verdict-reason {
    font-size: 0.85rem;
    line-height: 1.32;
  }

  .alibi-case-details,
  .verdict-highlight {
    padding: 11px 12px;
    border-radius: 16px;
  }

  .alibi-case-details {
    gap: 6px;
  }

  .alibi-collected-items {
    line-height: 1.34;
  }

  .verdict-highlight {
    gap: 2px;
  }

  .verdict-highlight h3 {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
  }

  .verdict-highlight-name {
    line-height: 1.12;
  }

  .verdict-highlight-reason {
    font-size: 0.85rem;
    line-height: 1.32;
  }

  .verdict-loading-card {
    padding: 18px 16px;
    border-radius: 22px;
  }

  .verdict-loading-card h3 {
    font-size: clamp(1.08rem, 5.8vw, 1.34rem);
    line-height: 1.12;
  }

  .verdict-loading-card p {
    font-size: 0.9rem;
    line-height: 1.28;
  }

  .verdict-loading-meter {
    height: 11px;
  }

  .verdict-loading-progress {
    font-size: 0.72rem;
  }

  .verdict-badge {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 1.48rem;
  }

  .alibi-glance-hud,
  .verdict-glance-hud {
    gap: 8px;
  }

  .alibi-glance-stat,
  .verdict-glance-stat {
    gap: 3px;
    padding: 10px 11px;
    border-radius: 16px;
  }

  .alibi-glance-stat span,
  .verdict-glance-stat span {
    font-size: 0.63rem;
    letter-spacing: 0.14em;
  }

  .alibi-glance-stat strong,
  .verdict-glance-stat strong {
    font-size: clamp(0.94rem, 4vw, 1.08rem);
  }

  .lobby-copy h2 {
    font-size: 0.96rem;
    line-height: 1.24;
  }

  .players-panel-header {
    padding-inline-end: 94px;
  }

  .lobby-room-actions {
    grid-template-columns: minmax(88px, 0.78fr) minmax(132px, 1.22fr);
    gap: 7px;
  }

  .lobby-room-actions .secondary {
    min-block-size: 40px;
    padding-inline: 6px;
    font-size: clamp(0.62rem, 2.1vw, 0.74rem);
    letter-spacing: 0.02em;
  }

  .lobby-room-actions .primary {
    min-block-size: 46px;
    padding-inline: 10px;
    font-size: clamp(0.8rem, 3.2vw, 0.92rem);
    box-shadow: 0 12px 22px rgba(207, 77, 67, 0.22);
  }

  .lobby-grid.lobby-grid-in-room #playersPanel #hostNote {
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .bot-control .bot-control-button {
    min-inline-size: 82px;
    min-block-size: 32px;
    padding-inline: 10px;
    border-radius: 999px;
    font-size: 0.7rem;
  }

  .tutorial-trigger {
    inline-size: 42px;
    block-size: 42px;
    min-height: 42px;
    font-size: 1.02rem;
  }

  .audio-toggle-icon {
    width: 20px;
    height: 20px;
  }

  .audio-toggle-icon svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 560px) and (orientation: portrait) {
  header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
  }

  body.game-hidden .header-actions,
  body.alibi-visible .header-actions,
  body.verdict-visible .header-actions,
  body.gameover-visible .header-actions,
  body:not(.game-hidden):not(.alibi-visible):not(.verdict-visible):not(.gameover-visible) .header-actions {
    display: flex;
    justify-self: end;
    align-self: center;
  }

  body.game-hidden .audio-toggle-mobile,
  body.alibi-visible .audio-toggle-mobile,
  body.verdict-visible .audio-toggle-mobile,
  body.gameover-visible .audio-toggle-mobile,
  body:not(.game-hidden):not(.alibi-visible):not(.verdict-visible):not(.gameover-visible) .audio-toggle-mobile,
  body.game-hidden .tutorial-trigger-mobile {
    display: inline-flex;
  }

  .lobby-hero {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .lobby-copy {
    justify-items: start;
    gap: 6px;
  }

  .lobby-hero-actions {
    display: none;
  }

  .tutorial-trigger {
    inline-size: 44px;
    block-size: 44px;
    min-height: 44px;
    font-size: 1.08rem;
  }
}

@media (min-width: 561px), (max-width: 560px) and (orientation: landscape) {
  .audio-toggle-lobby {
    display: inline-flex;
  }
}

@media (max-width: 390px) {
  :root {
    --brand-mark-height: clamp(38px, 11vw, 44px);
  }

  .alibi-card,
  .verdict-card,
  .gameover-card {
    padding: 16px;
    border-radius: 24px;
    gap: 14px;
  }

  .gameover-card {
    --gameover-card-gap: 14px;
    padding-block-end: var(--gameover-card-gap);
    gap: var(--gameover-card-gap);
  }

  .alibi-hero,
  .verdict-hero,
  .gameover-hero,
  .alibi-response-section,
  .alibi-progress-section,
  .verdict-section {
    gap: 9px;
  }

  .alibi-card h2,
  .verdict-title h2,
  .gameover-hero h2 {
    font-size: clamp(1.22rem, 7.4vw, 1.46rem);
    line-height: 1.08;
  }

  .screen-section-title {
    font-size: 0.81rem;
    line-height: 1.12;
  }

  .alibi-subtitle,
  .verdict-tagline,
  .gameover-subtitle {
    font-size: 0.81rem;
    line-height: 1.24;
  }

  .lobby-room-actions {
    grid-template-columns: minmax(80px, 0.8fr) minmax(116px, 1.2fr);
    gap: 6px;
  }

  .lobby-room-actions .secondary {
    min-block-size: 38px;
    padding-inline: 5px;
    font-size: clamp(0.58rem, 2.3vw, 0.68rem);
  }

  .lobby-room-actions .primary {
    padding-inline: 8px;
    font-size: clamp(0.76rem, 3.4vw, 0.86rem);
  }

  .alibi-label textarea {
    min-height: 118px;
    padding: 12px 13px;
    font-size: 1rem;
    line-height: 1.34;
  }

  .alibi-status {
    font-size: 0.85rem;
    line-height: 1.3;
  }

  .alibi-progress-list {
    gap: 5px;
  }

  .alibi-progress-list li {
    gap: 7px;
    padding: 7px 9px;
    border-radius: 13px;
    font-size: 0.89rem;
    line-height: 1.2;
  }

  .verdict-list {
    gap: 7px;
  }

  .verdict-list li,
  .verdict-entry {
    padding: 9px 10px;
    border-radius: 15px;
  }

  .verdict-entry-header {
    gap: 5px;
  }

  .verdict-suspicion-badge {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 0.62rem;
  }

  .verdict-rank,
  .gameover-rank {
    font-size: 0.79rem;
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 8px;
  }

  .verdict-total-score {
    min-height: 22px;
    padding: 3px 7px;
  }

  .verdict-total-score-value {
    font-size: 0.72rem;
  }

  .gameover-list {
    gap: 7px;
  }

  .gameover-winner,
  .gameover-list li {
    padding: 9px 10px;
    border-radius: 15px;
  }

  .gameover-entry {
    gap: 2px 7px;
  }

  .gameover-player-name {
    font-size: 0.96rem;
  }

  .gameover-score {
    font-size: 0.82rem;
    line-height: 1.28;
  }

  .verdict-name {
    font-size: 0.96rem;
  }

  .verdict-list .verdict-reason {
    font-size: 0.82rem;
    line-height: 1.3;
  }

  .alibi-case-details,
  .verdict-highlight {
    padding: 10px 11px;
    border-radius: 15px;
  }

  .alibi-case-details {
    gap: 5px;
  }

  .alibi-collected-items {
    font-size: 0.93rem;
    line-height: 1.3;
  }

  .verdict-highlight h3 {
    font-size: 0.72rem;
  }

  .verdict-highlight-name {
    font-size: 0.96rem;
  }

  .verdict-highlight-reason {
    font-size: 0.82rem;
    line-height: 1.3;
  }

  .verdict-loading-card {
    gap: 10px;
    padding: 17px 15px;
    border-radius: 20px;
  }

  .verdict-loading-sparks {
    gap: 10px;
    font-size: clamp(1.08rem, 5.6vw, 1.32rem);
  }

  .verdict-loading-card h3 {
    font-size: clamp(0.98rem, 6vw, 1.16rem);
    line-height: 1.12;
  }

  .verdict-loading-card p {
    font-size: 0.86rem;
    line-height: 1.26;
  }

  .verdict-loading-meter {
    height: 10px;
  }

  .verdict-loading-progress {
    font-size: 0.69rem;
    letter-spacing: 0.11em;
  }

  .verdict-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1.32rem;
  }

  .alibi-glance-hud,
  .verdict-glance-hud {
    gap: 7px;
  }

  .alibi-glance-stat,
  .verdict-glance-stat {
    padding: 9px 10px;
    border-radius: 15px;
  }

  .alibi-glance-stat span,
  .verdict-glance-stat span {
    font-size: 0.61rem;
  }

  .alibi-glance-stat strong,
  .verdict-glance-stat strong {
    font-size: clamp(0.92rem, 4.3vw, 1.02rem);
  }

  .tutorial-trigger {
    inline-size: 40px;
    block-size: 40px;
    min-height: 40px;
    font-size: 0.98rem;
  }

  .audio-toggle-icon {
    width: 18px;
    height: 18px;
  }

  .audio-toggle-icon svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 390px) and (orientation: portrait) {
  header {
    gap: 8px;
  }
}

@media (min-width: 721px) {
  .lobby-grid {
    --lobby-balanced-panel-min-block-size: 255.5px;
  }

  .lobby-grid.lobby-grid-initial-panels > #createRoomPanel,
  .lobby-grid.lobby-grid-initial-panels > #joinRoomPanel,
  .lobby-grid.lobby-grid-in-room > #createRoomPanel,
  .lobby-grid.lobby-grid-in-room > #playersPanel {
    min-block-size: var(--lobby-balanced-panel-min-block-size);
  }

  .lobby-grid.lobby-grid-initial-panels > #joinRoomPanel,
  .lobby-grid.lobby-grid-in-room > #playersPanel {
    grid-template-rows: auto auto auto minmax(min-content, 1fr);
  }

  header {
    width: min(100%, var(--active-shell-width), var(--desktop-explore-stage-width));
    margin: 0 auto;
  }

  .verdict-loading-active .verdict-hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
  }

  .verdict-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 20px;
  }

  .verdict-glance-hud {
    grid-template-columns: repeat(2, minmax(148px, 1fr));
  }

  .alibi-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
  }

  .alibi-glance-hud {
    grid-template-columns: repeat(2, minmax(148px, 1fr));
  }

  .alibi-subtitle {
    max-width: none;
  }
}
