:root {
  color-scheme: light;
  --ink: #11071f;
  --paper: #fff45c;
  --panel: #fffdf2;
  --panel-hot: #ff5ec4;
  --panel-cool: #39f5ff;
  --panel-lime: #b8ff2f;
  --panel-purple: #7c4dff;
  --panel-orange: #ff9f1c;
  --link-blue: #003cff;
  --muted: #4d3a65;
  --line: #11071f;
  --red: #ff2f55;
  --teal: #00b8a9;
  --gold: #ffd23f;
  --focus: #1e00ff;
  --shadow: 6px 6px 0 #11071f;
  --soft-shadow: 3px 3px 0 #11071f;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  overflow-x: hidden;
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 11px 9px, #fff45c 0 1px, transparent 2px) 0 0 / 38px 38px,
    radial-gradient(circle at 28px 24px, #ffffff 0 1px, transparent 2px) 0 0 / 52px 52px,
    radial-gradient(circle at 6px 33px, #39f5ff 0 1px, transparent 2px) 0 0 / 64px 64px,
    linear-gradient(#00003f, #030022);
  font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.2;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 255, 255, 0.18) 18px 20px),
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(255, 255, 255, 0.12) 18px 20px);
  pointer-events: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-header {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px;
  border: 4px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(90deg, #000080 0 22px, #c0c0c0 22px 100%),
    linear-gradient(135deg, var(--panel-hot), var(--panel-orange) 36%, var(--panel-cool) 72%, var(--panel-lime));
  box-shadow: var(--shadow);
}

.app-header::before {
  content: "MOVIE ZONE ONLINE";
  position: absolute;
  left: 14px;
  top: -18px;
  padding: 2px 8px;
  border: 3px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--link-blue);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: underline;
  box-shadow: 3px 3px 0 var(--line);
}

.app-header::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: -12px;
  width: 38%;
  max-width: 360px;
  height: 18px;
  border: 3px solid var(--line);
  background:
    repeating-linear-gradient(90deg, #ff0000 0 12px, #ff9f1c 12px 24px, #fff45c 24px 36px, #00ff00 36px 48px, #39f5ff 48px 60px, #003cff 60px 72px, #7c4dff 72px 84px);
}

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

.mark {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 74px;
  min-width: 74px;
  aspect-ratio: 1;
  padding: 7px;
  border: 4px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(90deg, #000080 0 30%, #c0c0c0 30%),
    #11071f;
  box-shadow: var(--soft-shadow);
}

.mark span {
  border-radius: 2px;
  background:
    linear-gradient(#ffffff 0 0) 50% 16% / 46% 8% no-repeat,
    linear-gradient(#ffffff 0 0) 50% 84% / 46% 8% no-repeat,
    linear-gradient(145deg, var(--panel-hot), var(--gold) 48%, var(--panel-cool));
}

.eyebrow {
  display: inline-block;
  margin: 0 0 7px;
  padding: 4px 8px;
  border: 3px solid var(--line);
  border-radius: 4px;
  background: #c0c0c0;
  color: var(--link-blue);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  box-shadow: 3px 3px 0 var(--line);
}

h1 {
  margin: 0;
  color: #fffdf2;
  font-family: "Arial Black", Impact, "Trebuchet MS", sans-serif;
  font-size: 3.6rem;
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow:
    3px 3px 0 var(--line),
    6px 6px 0 #ff0000,
    -3px -3px 0 #39f5ff;
}

.name-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  width: min(430px, 100%);
  padding: 12px;
  border: 4px solid var(--line);
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0 8px, transparent 8px 16px),
    #c0c0c0;
  box-shadow: var(--soft-shadow);
}

.name-panel label,
.field {
  display: grid;
  gap: 6px;
}

.name-panel span,
.field-label,
.seen-field legend {
  color: var(--link-blue);
  font-family: "Courier New", monospace;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
}

input,
textarea {
  width: 100%;
  border: 3px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
  box-shadow: inset 2px 2px 0 rgba(17, 7, 31, 0.18);
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease;
}

input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 74px;
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--focus);
  background: #fffab8;
  box-shadow:
    inset 2px 2px 0 rgba(17, 7, 31, 0.18),
    0 0 0 4px var(--panel-cool);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(250px, 0.65fr) 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.cat-zone {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 10px;
  border: 4px solid var(--line);
  border-radius: 6px;
  background:
    radial-gradient(circle at 12px 14px, #fff45c 0 1px, transparent 2px) 0 0 / 26px 26px,
    linear-gradient(#000080 0 24px, #c0c0c0 24px);
  box-shadow: var(--shadow);
}

.cat-zone img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: contain;
  border: 4px solid var(--line);
  border-radius: 4px;
  background: #000033;
  box-shadow: var(--soft-shadow);
  grid-row: span 2;
}

.cat-zone-title,
.cat-zone-ticker {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  border: 4px solid var(--line);
  border-radius: 4px;
  background: #c0c0c0;
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.9), inset -3px -3px 0 rgba(17, 7, 31, 0.38);
}

.cat-zone-title {
  padding: 12px;
  color: var(--link-blue);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.25rem;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #ffffff;
}

.cat-zone-title span:last-child {
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  text-decoration: underline;
}

.cat-zone-ticker {
  overflow: hidden;
  padding: 10px;
  color: #ffffff;
  background:
    radial-gradient(circle at 7px 7px, #fff45c 0 1px, transparent 2px) 0 0 / 18px 18px,
    #000080;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cat-zone-ticker span {
  display: block;
  padding: 5px 0;
  border-bottom: 2px dotted #fff45c;
}

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

.stats div {
  min-height: 78px;
  padding: 12px;
  border: 4px solid var(--line);
  border-radius: 6px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.35) 0 7px, transparent 7px 14px),
    var(--panel);
  box-shadow: var(--soft-shadow);
}

.stats div:nth-child(1) {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.35) 0 7px, transparent 7px 14px),
    var(--panel-lime);
}

.stats div:nth-child(2) {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.35) 0 7px, transparent 7px 14px),
    var(--panel-cool);
}

.stats div:nth-child(3) {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.35) 0 7px, transparent 7px 14px),
    var(--gold);
}

.stats span {
  display: block;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.68);
}

.stats small {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  padding: 8px;
  border: 4px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(#000080 0 24px, #c0c0c0 24px),
    var(--panel-hot);
  box-shadow: var(--soft-shadow);
}

.search-field {
  flex: 1 1 220px;
  min-width: min(100%, 220px);
}

.search-field input {
  border-color: var(--line);
  background: #ffffff;
}

.filter-group {
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 3px solid var(--line);
  border-radius: 4px;
  background: var(--ink);
}

.filter-button,
.utility-button {
  min-height: 40px;
  border: 3px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-size: 0.88rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 3px 3px 0 var(--line);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease;
}

.filter-button {
  padding: 0 12px;
}

.filter-button.is-active {
  background: #00ff00;
  color: #000080;
}

.utility-button {
  padding: 0 13px;
  background: #c0c0c0;
}

.utility-button:hover,
.filter-button:hover {
  transform: translate(-1px, -1px);
  background: var(--gold);
  box-shadow: 4px 4px 0 var(--line);
}

.utility-button:active,
.filter-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.utility-button.danger {
  background: var(--panel-hot);
  color: var(--ink);
}

.alphabet-board {
  overflow: hidden;
  border: 4px solid var(--line);
  border-radius: 6px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.board-heading,
.movie-row {
  display: grid;
  grid-template-columns: 88px minmax(210px, 1.1fr) 96px minmax(190px, 0.7fr) minmax(260px, 1.25fr);
  gap: 12px;
  align-items: center;
}

.board-heading {
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 4px solid var(--line);
  background:
    repeating-linear-gradient(90deg, #ff0000 0 20px, #ff9f1c 20px 40px, #fff45c 40px 60px, #00ff00 60px 80px, #39f5ff 80px 100px, #003cff 100px 120px, #7c4dff 120px 140px);
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-heading span {
  padding: 4px 6px;
  border: 2px solid var(--line);
  background: #c0c0c0;
  color: var(--link-blue);
  text-decoration: underline;
}

.movie-list {
  display: grid;
}

.movie-row {
  padding: 14px;
  border-bottom: 4px solid var(--line);
  background:
    repeating-linear-gradient(90deg, rgba(17, 7, 31, 0.045) 0 2px, transparent 2px 12px),
    #fffdf2;
}

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

.movie-row:nth-child(4n + 1) {
  background:
    repeating-linear-gradient(90deg, rgba(17, 7, 31, 0.045) 0 2px, transparent 2px 12px),
    #fffdf2;
}

.movie-row:nth-child(4n + 2) {
  background:
    repeating-linear-gradient(90deg, rgba(17, 7, 31, 0.045) 0 2px, transparent 2px 12px),
    #e7fbff;
}

.movie-row:nth-child(4n + 3) {
  background:
    repeating-linear-gradient(90deg, rgba(17, 7, 31, 0.045) 0 2px, transparent 2px 12px),
    #fff0fb;
}

.movie-row:nth-child(4n + 4) {
  background:
    repeating-linear-gradient(90deg, rgba(17, 7, 31, 0.045) 0 2px, transparent 2px 12px),
    #f5ffd6;
}

.movie-row.is-hidden {
  display: none;
}

.movie-row.is-mismatch .letter-badge {
  background: var(--red);
  color: #ffffff;
}

.letter-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.letter-badge {
  display: grid;
  place-items: center;
  width: 50px;
  min-width: 50px;
  height: 50px;
  border: 4px solid var(--line);
  border-radius: 4px;
  background:
    conic-gradient(from 45deg, #ff0000 0 25%, #fff45c 0 50%, #39f5ff 0 75%, #00ff00 0);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.38rem;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--line);
}

.letter-note {
  min-width: 0;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  font-weight: 900;
}

.movie-row.is-mismatch .letter-note {
  color: var(--red);
}

.score-field input {
  text-align: center;
}

.seen-field {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.seen-field legend {
  grid-column: 1 / -1;
  padding: 0;
}

.seen-field label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 42px;
  padding: 0 10px;
  border: 3px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  font-weight: 900;
  box-shadow: inset 2px 2px 0 rgba(17, 7, 31, 0.12);
}

.seen-field input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--panel-hot);
}

.seen-field span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-status {
  margin: 14px 0 0;
  padding: 7px 10px;
  border: 3px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(90deg, #000080 0 18px, #c0c0c0 18px),
    var(--panel-lime);
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-size: 0.84rem;
  font-weight: 900;
  text-align: right;
  box-shadow: var(--soft-shadow);
}

.copy-helper {
  position: fixed;
  left: -9999px;
  top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1020px) {
  .app-header,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .app-header {
    display: grid;
  }

  .app-header::after {
    width: 52%;
  }

  h1 {
    font-size: 3rem;
  }

  .name-panel {
    width: 100%;
  }

  .toolbar {
    display: grid;
  }

  .cat-zone {
    grid-template-columns: 1fr;
  }

  .cat-zone img {
    grid-row: auto;
    height: auto;
    max-height: none;
  }

  .controls {
    justify-content: stretch;
  }

  .filter-group {
    overflow-x: auto;
  }

  .board-heading {
    display: none;
  }

  .movie-list {
    gap: 10px;
    padding: 10px;
    background: var(--line);
  }

  .movie-row,
  .movie-row:nth-child(4n + 1),
  .movie-row:nth-child(4n + 2),
  .movie-row:nth-child(4n + 3),
  .movie-row:nth-child(4n + 4) {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border: 4px solid var(--line);
    border-radius: 6px;
    background: #fffdf2;
  }

  .letter-cell {
    grid-row: span 4;
    align-items: flex-start;
    flex-direction: column;
  }

  .title-field,
  .score-field,
  .seen-field,
  .comment-field {
    grid-column: 2;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 32px, 1180px);
    padding-top: 18px;
  }

  .app-header {
    padding: 12px;
  }

  .app-header::after {
    display: none;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .mark {
    width: 56px;
    min-width: 56px;
    padding: 5px;
  }

  h1 {
    font-size: 2.12rem;
  }

  .name-panel,
  .stats {
    grid-template-columns: 1fr;
  }

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

  .search-field,
  .filter-group {
    grid-column: 1 / -1;
  }

  .filter-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-button {
    white-space: normal;
  }

  .movie-row,
  .movie-row:nth-child(4n + 1),
  .movie-row:nth-child(4n + 2),
  .movie-row:nth-child(4n + 3),
  .movie-row:nth-child(4n + 4) {
    grid-template-columns: 1fr;
  }

  .letter-cell,
  .title-field,
  .score-field,
  .seen-field,
  .comment-field {
    grid-column: 1;
  }

  .letter-cell {
    grid-row: auto;
    flex-direction: row;
  }
}
