@import url("https://fonts.googleapis.com/css2?family=Kalam:wght@400;700&display=swap");

:root {
  --ink: #111111;
  --bom-bg: #e6e6e6;
  --bom-card: #ffffff;
  --bom-border: #d4d4d4;
  --bom-header: #535353;
  --bom-header-dark: #1f1f1f;
  --bom-accent: #f3a321;
  --bom-link: #2f6fb2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bom-bg);
}

a {
  color: var(--bom-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-nav {
  background: linear-gradient(180deg, #5d5d5d 0%, #4b4b4b 100%);
  color: #ffffff;
  padding: 10px 6vw 0;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "logo search" "tabs tabs";
  gap: 8px;
  border-bottom: 1px solid #3a3a3a;
  position: relative;
}

.logo {
  grid-area: logo;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: inherit;
  text-decoration: none;
  position: relative;
  z-index: 3;
  width: fit-content;
}

.logo-main {
  font-family: "Kalam", "Merriweather", serif;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
}

.logo-accent {
  color: var(--bom-link);
}

.top-links {
  grid-area: tabs;
  display: flex;
  gap: 0;
  align-items: center;
  background: var(--bom-header-dark);
  margin: 0 -6vw;
  padding: 0 6vw;
  overflow-x: auto;
  border-top: 1px solid #2a2a2a;
}

.top-links a {
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-size: 1.05rem;
  color: #ffffff;
  padding: 12px 16px;
  border-top: 3px solid transparent;
  border-left: 1px solid #2a2a2a;
}

.top-links a.active {
  background: #f5f5f5;
  color: #111111;
  border-top-color: var(--bom-accent);
  border-radius: 10px 10px 0 0;
}

.nav-search {
  grid-area: search;
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.nav-search input {
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 260px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-size: 0.95rem;
}

.nav-search button:not(.nav-menu) {
  display: none;
}

.nav-menu {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #ffffff;
  border-radius: 10px;
  padding: 6px 10px;
}

.sub-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--bom-border);
  padding: 6px 6vw;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  white-space: nowrap;
}

.sub-nav a {
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #111111;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 4vw 32px;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  grid-template-areas: "content" "sidebar";
}

.content {
  grid-area: content;
}

.sidebar {
  grid-area: sidebar;
}

.section-box {
  border: 1px solid var(--bom-border);
  border-radius: 12px;
  background: var(--bom-card);
  padding: 12px;
}

.section-title {
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-size: 1.25rem;
  margin: 0 0 8px;
  border-bottom: 1px solid var(--bom-border);
  padding-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.movie-card .section-title {
  font-size: 1.5rem;
  border-bottom: none;
  padding-bottom: 0;
}

.section-link {
  color: var(--bom-link);
  text-decoration: none;
}

.section-link:hover {
  color: var(--bom-link);
}

.more-link {
  display: inline-block;
  margin-top: 6px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-weight: 700;
}

.chart-table {
  overflow-x: auto;
}

.chart-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.chart-table thead th {
  background: #f7f7f7;
  padding: 6px 8px;
  text-align: left;
}

.chart-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--bom-border);
}

.chart-table tr.running-row td,
.section-box table tr.running-row td {
  background: #dff2dc;
}

.daily-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.daily-table th {
  background: #f7f7f7;
  padding: 6px 8px;
  text-align: left;
}

.daily-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--bom-border);
}

.daily-table td:nth-child(3),
.daily-table td:nth-child(4),
.daily-table td:nth-child(5),
.daily-table td:nth-child(6) {
  text-align: right;
  white-space: nowrap;
}

.pct-up {
  color: #1a7f37;
  font-weight: 600;
}

.pct-down {
  color: #c1121f;
  font-weight: 600;
}

.pct-flat {
  color: #555555;
  font-weight: 600;
}

.chart-table.compact thead {
  display: none;
}

.chart-table.compact td {
  padding: 10px 6px;
}

.chart-table.compact td:first-child {
  width: 28px;
  color: #666666;
}

.chart-table.compact td:last-child {
  text-align: right;
  font-weight: 700;
}

.title-link {
  color: var(--bom-link);
  font-weight: 700;
}

.date-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.daily-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
}

.daily-page-title {
  margin: 4px 0 0;
  font-size: 1.5rem;
}

.daily-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.daily-nav-btn {
  border: 1px solid var(--bom-border);
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 12px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
  cursor: pointer;
}

.daily-nav-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.up {
  color: #1a7f37;
  font-weight: 700;
}

.down {
  color: #c1121f;
  font-weight: 700;
}

.date-menu {
  display: none;
  border: 1px solid var(--bom-border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  padding: 6px;
  margin: 6px 0 10px;
}

.date-menu.open {
  display: grid;
  gap: 4px;
}

.date-option {
  border: none;
  background: transparent;
  text-align: left;
  padding: 6px 10px;
  border-radius: 8px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
}

.date-option:hover,
.date-option.active {
  background: #f1f1f1;
}

.release-schedule {
  display: grid;
  gap: 12px;
}

.release-changes {
  display: grid;
  gap: 12px;
}

.release-change-row {
  border-top: 1px solid var(--bom-border);
  padding-top: 8px;
  display: grid;
  gap: 6px;
}

.release-change-row:first-child {
  border-top: none;
  padding-top: 0;
}

.release-change-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.release-change-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #111111;
  border: 1px solid var(--bom-border);
  border-radius: 999px;
  padding: 2px 8px;
}

.release-change-dates {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #555555;
  font-weight: 700;
}

.release-change-arrow {
  color: var(--bom-link);
  font-weight: 700;
}

.release-day {
  border-top: 1px solid var(--bom-border);
  padding-top: 8px;
}

.release-day:first-child {
  border-top: none;
  padding-top: 0;
}

.release-day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.release-day-date {
  font-weight: 700;
}

.release-day-type {
  font-size: 0.8rem;
  font-weight: 700;
}

.release-movie-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--bom-border);
}

.release-title-block {
  display: grid;
  gap: 2px;
}

.release-movie-row:first-child {
  border-top: none;
}

.release-title {
  color: var(--bom-link);
  font-weight: 600;
}

.release-language {
  font-size: 0.82rem;
  color: #666666;
}

.release-scale {
  font-weight: 700;
}

.calendar-row {
  align-items: flex-start;
}

.calendar-poster-col {
  flex: 0 0 54px;
}

.calendar-poster-link {
  display: block;
  text-decoration: none;
}

.calendar-poster {
  width: 54px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--bom-border);
  background: #f3f3f3;
}

.calendar-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666666;
  font-size: 0.7rem;
  text-align: center;
  padding: 6px;
}

.calendar-main-col {
  flex: 1 1 auto;
}

.calendar-scale-col {
  flex: 0 0 auto;
  white-space: nowrap;
}

.calendar-credits {
  font-size: 0.82rem;
  color: #555555;
  line-height: 1.45;
}

.calendar-credits a {
  color: var(--bom-link);
  text-decoration: none;
}

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

.showdown-card {
  border: 1px solid var(--bom-border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}

.showdown-title {
  font-family: "Kalam", "Source Sans 3", sans-serif;
  text-align: center;
  color: var(--bom-link);
  margin-bottom: 4px;
}

.showdown-subtitle {
  text-align: center;
  font-size: 0.82rem;
  color: #666666;
  margin-bottom: 10px;
}

.showdown-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.showdown-body-duo {
  grid-template-columns: 1fr auto 1fr;
}

.showdown-side {
  display: grid;
  gap: 6px;
  text-align: center;
}

.showdown-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: #e6e6e6;
  overflow: hidden;
}

.showdown-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showdown-vs {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #d9b12d;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.showdown-title a {
  color: inherit;
}

.showdown-detail-hero {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.showdown-detail-side {
  display: grid;
  gap: 8px;
  text-align: center;
}

.showdown-detail-poster {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 2 / 3;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
  background: #e6e6e6;
}

.showdown-detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showdown-detail-poster.placeholder {
  border: 1px solid var(--bom-border);
}

.alltime-switch-panel {
  display: none;
}

.alltime-switch-panel.active {
  display: block;
}

.alltime-chart table,
.alltime-chart th,
.alltime-chart td {
  border: 1px solid #d6d6d6;
}

.alltime-chart table {
  border-collapse: collapse;
}

.muted {
  color: #6b6b6b;
  font-style: italic;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-size: 0.9rem;
}

.section-actions select {
  border: 1px solid var(--bom-border);
  border-radius: 10px;
  padding: 4px 8px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.detail-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
}

.detail-filter select {
  border: 1px solid var(--bom-border);
  border-radius: 10px;
  padding: 6px 10px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
}

.records-group {
  margin-bottom: 16px;
  border-top: 1px solid var(--bom-border);
  padding-top: 12px;
}

.records-group h4 {
  margin: 0 0 8px;
  font-family: "Source Sans 3", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #111111;
}

.charts-page-box {
  padding-top: 16px;
}

.charts-hero {
  margin-bottom: 16px;
}

.charts-page-title {
  margin: 4px 0 0;
  font-size: 1.7rem;
  line-height: 1.1;
}

.charts-page-tabs {
  margin-bottom: 14px;
  border-bottom: 1px solid var(--bom-border);
  padding-bottom: 10px;
}

.alltime-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.alltime-tab {
  border: 1px solid var(--bom-border);
  background: #fff;
  color: #222;
  border-radius: 999px;
  padding: 7px 12px;
  font-family: "Source Sans 3", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.alltime-tab.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.alltime-panel {
  display: none;
}

.alltime-panel.active {
  display: block;
}

.search-hero {
  display: grid;
  gap: 10px;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--bom-border);
  font-family: "Kalam", "Source Sans 3", sans-serif;
}

.search-row button {
  border-radius: 10px;
  border: 1px solid var(--bom-border);
  background: #ffffff;
  padding: 6px 12px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
  cursor: pointer;
}

.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-filters select {
  border: 1px solid var(--bom-border);
  border-radius: 10px;
  padding: 6px 10px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
}

.result-grid {
  display: grid;
  gap: 12px;
}

.result-card {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  border: 1px solid var(--bom-border);
  border-radius: 12px;
  padding: 10px;
  background: #fbfbfb;
}

.result-poster {
  width: 70px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: #e5e5e5;
  overflow: hidden;
}

.result-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-meta {
  display: grid;
  gap: 4px;
}

.result-title {
  font-weight: 700;
  font-size: 1rem;
}

.movie-hero {
  display: grid;
  gap: 16px;
}

.movie-card {
  border: 1px solid var(--bom-border);
  border-radius: 16px;
  background: #ffffff;
  padding: 12px;
}

.movie-poster {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  background: #e5e5e5;
  overflow: hidden;
}

.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-meta {
  display: grid;
  gap: 6px;
}

.meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-label {
  font-weight: 700;
  min-width: 110px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.stat-card {
  border: 1px solid var(--bom-border);
  border-radius: 12px;
  padding: 10px;
  background: #f7f7f7;
}

.stat-label {
  font-size: 0.8rem;
  color: #5a5a5a;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.showdown-movie {
  font-weight: 700;
}

.showdown-total {
  font-size: 0.95rem;
}

.showdown-label {
  font-size: 0.8rem;
  color: #666666;
}

.showdown-admin-group {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--bom-border);
  border-radius: 12px;
}

.showdown-admin-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 150px minmax(160px, 1fr) minmax(180px, 1fr) auto auto;
  align-items: start;
}

.showdown-admin-slot,
.showdown-admin-selected {
  padding-top: 8px;
}

.showdown-search-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.credits-grid {
  display: grid;
  gap: 16px;
}

.credits-block h4 {
  margin: 0 0 6px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
  color: var(--bom-link);
}

.credits-list {
  display: grid;
  gap: 6px;
}

.credit-name {
  font-weight: 700;
}

.btn-secondary {
  border: 1px solid var(--bom-border);
  border-radius: 10px;
  background: #ffffff;
  padding: 8px 12px;
  cursor: pointer;
  font-family: "Kalam", "Source Sans 3", sans-serif;
}

.form-grid {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.form-field {
  display: grid;
  gap: 6px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-weight: 700;
}

.form-field input {
  border: 1px solid var(--bom-border);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-field {
  align-content: end;
  justify-items: start;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.admin-search-results {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.admin-search-item {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--bom-border);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
  font-family: "Source Sans 3", Arial, sans-serif;
}

.admin-search-item strong {
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-size: 1.05rem;
  color: var(--bom-link);
}

.admin-search-item span {
  color: #555;
  font-size: 0.95rem;
}

.admin-search-item:hover {
  border-color: #bfbfbf;
}

.admin-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0 12px;
}

.admin-total-pill {
  display: grid;
  gap: 4px;
  border: 1px solid var(--bom-border);
  border-radius: 12px;
  background: #fafafa;
  padding: 10px 12px;
}

.admin-total-pill span {
  font-size: 0.88rem;
  color: #666;
}

.admin-total-pill strong {
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-size: 1.05rem;
}

.admin-daily-editor {
  display: grid;
  gap: 0;
  margin-top: 12px;
  overflow-x: auto;
}

.admin-daily-header,
.admin-daily-row {
  min-width: 980px;
  display: grid;
  grid-template-columns: 110px 130px 100px 140px 150px 100px 80px 90px 96px;
  gap: 8px;
  align-items: center;
}

.admin-daily-header {
  background: #f7f7f7;
  border: 1px solid var(--bom-border);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 10px 12px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
  font-weight: 700;
}

.admin-daily-row {
  border: 1px solid var(--bom-border);
  border-top: none;
  background: #fff;
  padding: 10px 12px;
}

.admin-daily-row:last-child {
  border-radius: 0 0 12px 12px;
}

.admin-daily-row input[type="date"],
.admin-daily-row input[type="number"] {
  width: 100%;
  border: 1px solid var(--bom-border);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: "Kalam", "Source Sans 3", sans-serif;
}

.admin-daily-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.admin-label-cell,
.admin-weekday,
.admin-source {
  font-family: "Kalam", "Source Sans 3", sans-serif;
}

.admin-source {
  color: #666;
}

.footer {
  padding: 18px 6vw 32px;
  background: #3d3d3d;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer a {
  color: #ffffff;
}

@media (min-width: 900px) {
  .main-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas: "content sidebar";
  }

  .movie-hero {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }
}

@media (max-width: 430px) {
  .top-nav {
    grid-template-columns: 1fr;
    grid-template-areas: "logo" "search" "tabs";
    padding: 10px 12px 0;
  }

  .top-links {
    margin: 0 -12px;
    padding: 0 8px;
  }

  .nav-search {
    width: 100%;
  }

  .nav-search input {
    min-width: 0;
    width: 100%;
  }

  .nav-menu {
    display: inline-flex;
  }

  .container {
    padding: 10px 12px 24px;
  }

  .search-row {
    flex-direction: column;
  }

  .result-card {
    grid-template-columns: 1fr;
  }

  .showdown-body {
    grid-template-columns: 1fr;
  }

  .showdown-body-duo {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
  }

  .showdown-side {
    min-width: 0;
  }

  .showdown-vs {
    width: 44px;
    height: 44px;
    font-size: 0.82rem;
  }

  .showdown-vs {
    margin: 0 auto;
  }

  .showdown-admin-row {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 900px) {
  .top-nav {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "search"
      "tabs";
    padding: 10px 4vw 0;
  }

  .top-links {
    margin: 0 -4vw;
    padding: 0 4vw;
  }

  .nav-search {
    justify-self: stretch;
    width: 100%;
  }

  .nav-search input {
    min-width: 0;
    width: 100%;
  }

  .container {
    padding: 12px 3vw 24px;
  }

  .daily-header,
  .detail-header,
  .release-day-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .daily-nav {
    width: 100%;
  }

  .showdown-body:not(.showdown-body-duo) {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .showdown-detail-hero {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
  }

  .showdown-detail-side {
    min-width: 0;
  }

  .showdown-detail-poster {
    max-width: 130px;
  }

  .showdown-vs {
    margin: 0 auto;
  }

  .calendar-row,
  .release-movie-row {
    align-items: flex-start;
  }

  .calendar-scale-col,
  .release-scale {
    white-space: normal;
    text-align: left;
  }

  .movie-card {
    padding: 10px;
  }
}

@media (max-width: 640px) {
  .logo-main {
    font-size: 1.45rem;
  }

  .top-links a {
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .section-box {
    padding: 10px;
    border-radius: 10px;
  }

  .section-title {
    font-size: 1.08rem;
    align-items: flex-start;
    flex-direction: column;
  }

  .movie-card .section-title {
    font-size: 1.25rem;
  }

  .chart-table table,
  .daily-table,
  .alltime-chart table {
    font-size: 0.88rem;
    min-width: 640px;
  }

  .chart-table.compact table {
    min-width: 0;
  }

  .chart-table.compact td,
  .chart-table.compact th {
    padding: 8px 5px;
    font-size: 0.88rem;
  }

  .daily-page-title,
  .charts-page-title {
    font-size: 1.28rem;
  }

  .daily-nav {
    gap: 6px;
  }

  .daily-nav-btn,
  .date-toggle {
    font-size: 0.9rem;
  }

  .release-movie-row,
  .calendar-row {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 10px;
  }

  .release-schedule .release-movie-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 4px 0;
    border-top: none;
  }

  .release-schedule .release-day {
    padding-top: 14px;
  }

  .release-schedule .release-day-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
  }

  .release-schedule .release-day-date,
  .release-schedule .release-day-type {
    font-size: 0.98rem;
    font-weight: 700;
  }

  .release-schedule .release-title-block {
    min-width: 0;
  }

  .release-schedule .release-title {
    display: block;
    font-size: 0.98rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .release-schedule .release-language {
    display: none;
  }

  .release-schedule .release-scale {
    text-align: right;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 400;
  }

  .calendar-scale-col {
    grid-column: 2;
    font-size: 0.82rem;
    color: #555;
  }

  .calendar-credits,
  .release-language {
    font-size: 0.78rem;
  }

  .result-card {
    grid-template-columns: 56px 1fr;
    gap: 10px;
  }

  .result-poster {
    width: 56px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .meta-label {
    min-width: 92px;
  }

  .footer {
    padding: 18px 3vw 28px;
  }

  .footer-links {
    gap: 10px;
  }
}


@media (max-width: 640px) {
  .chart-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .chart-table.compact table {
    width: 100%;
    table-layout: fixed;
  }

  .chart-table.compact td:first-child,
  .chart-table.compact th:first-child {
    width: 28px;
  }

  .chart-table.compact td:nth-child(2),
  .chart-table.compact th:nth-child(2) {
    width: auto;
  }

  .chart-table.compact td:last-child,
  .chart-table.compact th:last-child {
    width: 92px;
    white-space: nowrap;
  }

  .chart-table.compact .title-link,
  .chart-table.compact td:nth-child(2) {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #latest-dailies .chart-table.compact td:last-child,
  #latest-weekend .chart-table.compact td:last-child,
  #top-year .chart-table.compact td:last-child,
  #worldwide-year .chart-table.compact td:last-child {
    font-size: 0.82rem;
  }

  .showdown-card {
    padding: 10px;
  }

  .showdown-title {
    font-size: 1rem;
    line-height: 1.2;
  }

  .showdown-subtitle {
    margin-bottom: 8px;
  }

  .showdown-poster {
    max-width: 170px;
    margin: 0 auto;
  }

  .release-day-date {
    font-size: 0.95rem;
  }

  .sidebar .section-title {
    flex-direction: row;
    align-items: center;
  }

  .calendar-poster-col {
    flex: 0 0 46px;
  }

  .calendar-poster {
    width: 46px;
    height: 68px;
  }

  .calendar-main-col {
    min-width: 0;
  }

  .release-title,
  .calendar-credits a,
  .release-title-block a {
    overflow-wrap: anywhere;
  }

  .detail-filter {
    flex-wrap: wrap;
  }

  .detail-filter select {
    width: 100%;
    min-width: 0;
  }

  .records-group {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .records-group table {
    min-width: 520px;
  }

  .movie-hero {
    gap: 12px;
  }

  .movie-poster {
    max-width: 180px;
    margin: 0 auto;
  }

  .meta-row {
    flex-direction: column;
    gap: 2px;
  }

  .meta-label {
    min-width: 0;
  }
}


@media (max-width: 640px) {
  .top-nav {
    gap: 6px;
    padding-top: 8px;
  }

  .logo {
    width: 100%;
  }

  .logo-main {
    line-height: 1;
  }

  .top-links {
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .top-links::-webkit-scrollbar {
    display: none;
  }

  .top-links a {
    flex: 0 0 auto;
    border-left: none;
  }

  .sub-nav {
    padding: 6px 4vw;
    gap: 14px;
  }

  #latest-dailies .chart-table.compact table,
  #latest-weekend .chart-table.compact table,
  #top-year .chart-table.compact table,
  #worldwide-year .chart-table.compact table {
    table-layout: fixed;
  }

  #latest-dailies .chart-table.compact td:nth-child(2),
  #latest-weekend .chart-table.compact td:nth-child(2),
  #top-year .chart-table.compact td:nth-child(2),
  #worldwide-year .chart-table.compact td:nth-child(2) {
    max-width: 0;
  }

  .more-link {
    margin-top: 8px;
  }

  .movie-card {
    display: grid;
    gap: 12px;
  }

  .movie-poster {
    max-width: 160px;
  }

  .movie-meta {
    gap: 8px;
  }

  .credits-grid {
    gap: 12px;
  }

  .credits-list {
    gap: 4px;
  }

  .stat-card {
    padding: 8px;
  }

  .stat-value {
    font-size: 0.98rem;
  }
}


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

  .content,
  .sidebar {
    min-width: 0;
  }

  .section-title .more-link,
  .section-title .date-toggle {
    align-self: flex-start;
  }

  .chart-table.compact td,
  .chart-table.compact th {
    vertical-align: top;
  }

  .chart-table.compact td:last-child,
  .chart-table.compact th:last-child {
    text-align: right;
  }

  .movie-hero .section-box,
  .movie-card {
    overflow: hidden;
  }

  .movie-meta,
  .credits-block,
  .credits-list,
  .stat-grid {
    min-width: 0;
  }

  .credits-block h4 {
    font-size: 1rem;
  }

  .credit-name,
  .meta-row,
  .section-title,
  .showdown-movie {
    overflow-wrap: anywhere;
  }

  .chart-table table td,
  .chart-table table th {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  #chart-detail-table table {
    min-width: 680px;
  }

  #chart-detail-table table td:nth-child(2),
  #chart-detail-table table th:nth-child(2) {
    min-width: 180px;
  }

  #chart-detail-table table td:last-child,
  #chart-detail-table table th:last-child {
    white-space: nowrap;
  }

  .alltime-chart {
    overflow-x: visible;
  }

  .alltime-chart table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  .alltime-chart th,
  .alltime-chart td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
  }

  .alltime-chart th:nth-child(1),
  .alltime-chart td:nth-child(1) {
    width: 31%;
  }

  .alltime-chart th:nth-child(2),
  .alltime-chart td:nth-child(2) {
    width: 36%;
  }

  .alltime-chart th:nth-child(3),
  .alltime-chart td:nth-child(3) {
    width: 33%;
  }

  .alltime-tabs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .alltime-tab {
    width: 100%;
    text-align: center;
  }
}
