:root {
  color-scheme: dark;
  --bg: #02040a;
  --panel: #111823;
  --panel-2: #151d29;
  --blue: #102f57;
  --blue-hot: #236397;
  --text: #eef3fb;
  --muted: #c0cad8;
  --red: #e84848;
  --gold: #ffd45d;
  --border-light: #6f86a0;
  --border-dark: #000;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(10, 28, 50, 0.85), rgba(1, 4, 10, 0.45) 44%, transparent 44%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
    var(--bg);
}

body:not(.is-ready) .site-header,
body:not(.is-ready) .desktop,
body:not(.is-ready) .site-disclaimer {
  visibility: hidden;
}

body.is-dragging {
  cursor: move;
  user-select: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.site-header {
  position: fixed;
  top: 42px;
  left: 24px;
  right: 24px;
  z-index: 1;
  text-align: center;
  pointer-events: none;
}

body.is-start-title-lowered .site-header {
  top: 96px;
}

body.is-title-link .site-header {
  pointer-events: auto;
}

.site-header h1 {
  margin: 0;
  color: #f4f7fb;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: 0;
  text-shadow:
    2px 2px 0 #000,
    0 0 12px rgba(35, 99, 151, 0.35);
}

body.is-title-link .site-header h1 {
  cursor: pointer;
}

body.is-title-link .site-header h1:hover,
body.is-title-link .site-header h1:focus-visible {
  color: #ffffff;
  text-shadow:
    2px 2px 0 #000,
    0 0 18px rgba(80, 160, 220, 0.6);
}

.desktop {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 108px 24px 92px;
  position: relative;
  overflow: hidden;
}

.case-desktop {
  display: block;
  padding-top: 118px;
}

.result-desktop {
  align-content: start;
  gap: 18px;
  padding-top: 122px;
}

.window {
  width: min(420px, 100%);
  padding: 2px;
  position: relative;
  z-index: 2;
  background: var(--panel-2);
  border: 1px solid #000;
  box-shadow:
    inset 1px 1px 0 #8194aa,
    inset -1px -1px 0 #05080d,
    8px 8px 0 rgba(0, 0, 0, 0.45);
}

.key-window {
  width: min(420px, 100%);
}

.cases-window {
  width: min(720px, 100%);
}

.complaint-window,
.answer-window,
.attachment-window {
  position: fixed;
}

.complaint-window {
  width: min(570px, calc(100vw - 32px));
}

.answer-window {
  width: min(430px, calc(100vw - 32px));
}

.attachment-window {
  width: min(390px, calc(100vw - 32px));
}

.result-window,
.rating-window {
  width: min(760px, 100%);
}

.is-fixed-window {
  position: relative;
}

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 5px 6px 5px 8px;
  color: #fff;
  background: linear-gradient(90deg, #07152a, var(--blue) 58%, #07101d);
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.14);
  cursor: move;
  user-select: none;
  touch-action: none;
}

.window-title {
  overflow: hidden;
  font-weight: 700;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
}

.window-close {
  width: 18px;
  height: 18px;
  padding: 0;
  display: flex;
  margin-left: 10px;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.window-close span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  background: #172131;
  border: 1px solid #000;
  box-shadow:
    inset 1px 1px 0 #7f91a8,
    inset -1px -1px 0 #05070b;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
}

.window-close:hover span,
.window-close:focus-visible span {
  background: #26344a;
  outline: 1px solid var(--blue-hot);
}

.window-body {
  margin-top: 2px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(22, 31, 43, 0.96), rgba(12, 17, 25, 0.98)),
    var(--panel);
  border: 1px solid #000;
  box-shadow:
    inset 1px 1px 0 #485d72,
    inset -1px -1px 0 #030508;
}

.key-form,
.answer-form {
  display: grid;
  gap: 10px;
}

.field-label,
.form-message {
  color: var(--muted);
  text-shadow: 1px 1px 0 #000;
}

.form-message {
  min-height: 17px;
  margin: 0;
  color: #ff9b9b;
}

.key-input,
.answer-input {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  color: var(--text);
  caret-color: #fff;
  background: #020407;
  border: 1px solid #000;
  outline: 0;
  border-radius: 0;
  box-shadow:
    inset 1px 1px 0 #000,
    inset -1px -1px 0 #43566a,
    1px 1px 0 #304152;
}

.answer-input {
  min-height: 190px;
  resize: vertical;
  line-height: 1.45;
}

.key-input:focus,
.answer-input:focus {
  box-shadow:
    inset 1px 1px 0 #000,
    inset -1px -1px 0 #4d6f91,
    0 0 0 1px var(--blue-hot),
    1px 1px 0 #304152;
}

.submit-button {
  justify-self: end;
  min-width: 118px;
  min-height: 34px;
  padding: 6px 14px;
  color: #fff;
  background: #172131;
  border: 1px solid #000;
  border-radius: 0;
  box-shadow:
    inset 1px 1px 0 #8293a8,
    inset -1px -1px 0 #030508,
    1px 1px 0 #05070b;
  cursor: pointer;
  text-shadow: 1px 1px 0 #000;
}

.submit-button:hover,
.submit-button:focus-visible {
  background: #14233a;
  outline: 1px solid var(--blue-hot);
}

.submit-button:active {
  box-shadow:
    inset -1px -1px 0 #8293a8,
    inset 1px 1px 0 #030508;
  transform: translate(1px, 1px);
}

.submit-button:disabled {
  color: #8a94a0;
  background: #111720;
  cursor: not-allowed;
  opacity: 0.75;
  transform: none;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 14px;
}

.case-card {
  display: grid;
  gap: 6px;
}

.case-tile,
.rating-button {
  min-height: 104px;
  padding: 10px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  background: #101927;
  border: 1px solid #000;
  border-radius: 0;
  box-shadow:
    inset 1px 1px 0 #718399,
    inset -1px -1px 0 #030508,
    2px 2px 0 #05070b;
  cursor: pointer;
  text-shadow: 1px 1px 0 #000;
}

.case-tile:hover,
.case-tile:focus-visible,
.rating-button:hover,
.rating-button:focus-visible {
  background: #14233a;
  outline: 1px solid var(--blue-hot);
}

.case-number {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.case-result {
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 5px 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
  background: #0b111a;
  border: 1px solid #000;
  box-shadow:
    inset 1px 1px 0 #3f5369,
    inset -1px -1px 0 #030508;
  text-shadow: 1px 1px 0 #000;
  user-select: none;
}

.case-result.has-rating {
  color: var(--gold);
  font-size: 15px;
  letter-spacing: 0;
}

.complaint-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.complaint-meta div {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.complaint-meta dt {
  color: var(--muted);
}

.complaint-meta dd {
  margin: 0;
}

.link-button {
  padding: 0;
  color: #8fc9ff;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  text-shadow: 1px 1px 0 #000;
}

.link-button:hover,
.link-button:focus-visible {
  color: #c7e6ff;
  outline: 0;
}

.complaint-text,
.answer-preview {
  min-height: 150px;
  padding: 14px;
  color: #f3f6fb;
  line-height: 1.48;
  background: #05080d;
  border: 1px solid #000;
  box-shadow:
    inset 1px 1px 0 #000,
    inset -1px -1px 0 #405269;
}

.answer-preview {
  min-height: 110px;
  white-space: pre-wrap;
}

.fake-photo,
.fake-video-screen {
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #e8eef8;
  line-height: 1.45;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 35%),
    #05070b;
  border: 1px solid #000;
  box-shadow:
    inset 1px 1px 0 #000,
    inset -1px -1px 0 #3a4d63;
}

.fake-photo span {
  max-width: 260px;
}

.video-panel {
  display: grid;
  gap: 12px;
}

.fake-video-screen {
  min-height: 190px;
  align-content: center;
}

.frame-text {
  min-height: 42px;
  margin: 0;
}

.bodycam-status {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffdada;
  text-shadow: 1px 1px 0 #000;
}

.bodycam-status.is-hidden {
  visibility: hidden;
}

.record-dot {
  width: 11px;
  height: 11px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(232, 72, 72, 0.75);
}

.video-slider {
  width: 100%;
  accent-color: var(--blue-hot);
}

.frame-labels {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.rating-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.rating-button {
  min-height: 86px;
  align-content: center;
  gap: 8px;
}

.rating-button span {
  min-height: 18px;
  color: var(--gold);
}

.rating-button b {
  font-size: 13px;
}

.rating-button.is-selected {
  background: #18314d;
  outline: 1px solid var(--gold);
}

.close-case-button {
  width: 100%;
  justify-self: stretch;
}

.site-disclaimer {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 14px;
  z-index: 1;
  margin: 0 auto;
  max-width: 980px;
  color: rgba(238, 243, 251, 0.72);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
}

body:not(.show-disclaimer) .site-disclaimer {
  display: none;
}

.loading-text {
  margin: 0;
  color: var(--muted);
  text-shadow: 1px 1px 0 #000;
}

@media (max-width: 1080px) {
  .desktop {
    overflow: auto;
  }

  .case-desktop {
    display: grid;
    gap: 14px;
    place-items: stretch;
    justify-items: center;
  }

  .complaint-window,
  .answer-window,
  .attachment-window {
    position: relative;
    left: auto;
    top: auto;
    width: min(570px, 100%);
    margin: 0 auto 14px;
  }

  .answer-window {
    width: min(430px, 100%);
  }

  .attachment-window {
    width: min(390px, 100%);
  }

  .answer-window {
    order: 2;
  }

  .attachment-window {
    order: 3;
  }
}

@media (max-width: 620px) {
  .site-header {
    top: 22px;
  }

  body.is-start-title-lowered .site-header {
    top: 58px;
  }

  .desktop {
    padding: 86px 12px 116px;
  }

  .window-body {
    padding: 14px;
  }

  .complaint-meta div,
  .rating-options {
    grid-template-columns: 1fr;
  }
}
