:root {
  --cream: #f3eadc;
  --cream-deep: #e7dcc8;
  --paper: #faf6ee;
  --ink: #1c1915;
  --muted: #564e46;
  --red: #c8102e;
  --red-deep: #9d0c24;
  --line: rgba(28, 25, 21, 0.12);
  --shadow: 0 18px 40px rgba(60, 36, 18, 0.12);
  --radius: 18px;
  font-family: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -10%, rgba(200, 16, 46, 0.08), transparent 32%),
    var(--cream);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(var(--cream), var(--cream)) padding-box,
    radial-gradient(circle at 8px 100%, transparent 6px, var(--red) 7px) bottom left / 16px 10px repeat-x;
  background-size: auto, 16px 8px;
  background-repeat: no-repeat, repeat-x;
  background-position: 0 0, bottom;
  padding-bottom: 20px;
}

h1, h2 { font-family: Georgia, "Iowan Old Style", Palatino, serif; font-weight: 600; }

h1 { margin: 0; font-size: 34px; letter-spacing: -0.03em; line-height: 1; }

.sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 16px;
  align-items: start;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

h2 { margin: 0; font-size: 22px; }

.cast {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cast button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  padding: 8px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.cast button:hover { border-color: rgba(200, 16, 46, 0.45); }

.cast button[aria-selected="true"] {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}

.cast button.bound {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.cast img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: #ddd4c6;
  display: block;
}

.cast span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 650;
}

.cast .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0;
}

