:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #63706c;
  --line: rgba(23, 33, 31, 0.14);
  --paper: #fffdf7;
  --card: rgba(255, 255, 255, 0.82);
  --green: #1f7a62;
  --blue: #256fa5;
  --coral: #d95f43;
  --sand: #f1d28a;
  --shadow: 0 18px 50px rgba(28, 46, 43, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 12%, rgba(217, 95, 67, 0.22), transparent 26rem),
    radial-gradient(circle at 88% 4%, rgba(37, 111, 165, 0.18), transparent 25rem),
    linear-gradient(135deg, #fbf5e6 0%, #e9f2ee 50%, #f6eee4 100%);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

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

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  min-height: 340px;
  padding: 26px;
  display: grid;
  align-items: end;
  box-shadow: var(--shadow);
  background: #11342f;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 24, 22, 0.8), rgba(6, 24, 22, 0.22) 54%, rgba(6, 24, 22, 0.58)),
    url("photos/indonesia-rating-hero.webp") center / cover;
  transform: scale(1.02);
}

.hero > * {
  position: relative;
}

.topbar {
  position: absolute;
  top: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #fffdf7;
  z-index: 2;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
}

.summary-link,
.ghost-link {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fffdf7;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.hero-copy {
  width: min(760px, 100%);
  color: #fffdf7;
  padding-top: 86px;
}

.eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  color: rgba(255, 253, 247, 0.84);
  font-size: 0.92rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-title {
  max-width: 10.8em;
}

.hero-title span {
  display: block;
}

.hero-copy p {
  margin: 16px 0 0;
  color: rgba(255, 253, 247, 0.86);
  font-size: clamp(1rem, 2.4vw, 1.22rem);
  line-height: 1.7;
}

.name-panel {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: min(560px, 100%);
}

.name-panel input,
.password-panel input {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  padding: 14px 18px;
  outline: none;
}

.primary-btn,
.submit-btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  color: #fffdf7;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(31, 122, 98, 0.24);
}

.secondary-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
  cursor: pointer;
}

.status-line {
  min-height: 22px;
  margin: 12px 0 0;
  color: rgba(255, 253, 247, 0.82);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 30px 2px 14px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.summary-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.print-stamp {
  display: none;
}

.progress-pill {
  flex: 0 0 auto;
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: var(--muted);
}

.day-block {
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 10px 34px rgba(28, 46, 43, 0.08);
}

.day-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 2px 2px 14px;
}

.day-title h3 {
  margin: 0;
  font-size: 1.35rem;
}

.day-title span {
  color: var(--muted);
}

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

.spot-card {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(28, 46, 43, 0.09);
}

.spot-card img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  background: #111;
}

.spot-body {
  padding: 14px;
}

.spot-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.spot-body h4 {
  margin: 8px 0 12px;
  font-size: 1.12rem;
}

.rating-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.rating-btn {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  cursor: pointer;
  padding: 6px 4px;
  line-height: 1.2;
}

.rating-btn strong {
  display: block;
  font-size: 0.92rem;
}

.rating-btn span {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
}

.rating-btn.is-selected {
  color: #fffdf7;
  background: linear-gradient(135deg, var(--coral), var(--green));
  border-color: transparent;
  transform: translateY(-1px);
}

.rating-btn.is-selected span {
  color: rgba(255, 253, 247, 0.78);
}

.action-bar {
  position: sticky;
  bottom: 10px;
  z-index: 5;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.submit-note {
  color: var(--muted);
  line-height: 1.5;
}

.summary-page .hero {
  min-height: 260px;
}

.password-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 18px;
  width: min(520px, 100%);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.7fr;
  gap: 16px;
  margin-top: 20px;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 28px rgba(28, 46, 43, 0.08);
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
}

.rank-list,
.person-list {
  display: grid;
  gap: 10px;
}

.rank-item,
.person-item {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.rank-item img {
  width: 62px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 33, 31, 0.12);
  margin-top: 8px;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--sand), var(--green));
}

.matrix-wrap {
  overflow-x: auto;
}

.matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  min-width: 720px;
}

.matrix th,
.matrix td {
  padding: 10px 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.7);
}

.matrix th:first-child,
.matrix td:first-child {
  border-radius: 12px 0 0 12px;
  position: sticky;
  left: 0;
}

.matrix th:last-child,
.matrix td:last-child {
  border-radius: 0 12px 12px 0;
}

.empty-state {
  color: var(--muted);
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .spot-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .shell {
    width: min(100% - 32px, 1180px);
  }

  .hero {
    min-height: 380px;
  }

  .hero-copy {
    width: min(680px, 100%);
  }

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

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

  .hero {
    min-height: 430px;
    border-radius: 22px;
    padding: 18px;
  }

  .hero-copy {
    padding-top: 104px;
  }

  h1 {
    font-size: clamp(2.35rem, 11vw, 3.75rem);
    line-height: 1.02;
  }

  .hero-title {
    max-width: 7.2em;
  }

  .topbar {
    top: 14px;
    left: 16px;
    right: 16px;
  }

  .summary-link {
    padding: 9px 11px;
  }

  .name-panel,
  .password-panel,
  .action-bar,
  .section-head,
  .day-title {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .section-head {
    display: block;
  }

  .summary-actions {
    margin-top: 14px;
  }

  .progress-pill {
    display: inline-flex;
    margin-top: 10px;
  }

  .day-block {
    padding: 10px;
    border-radius: 20px;
  }

  .rating-row {
    gap: 5px;
  }

  .rating-btn {
    min-height: 44px;
    border-radius: 12px;
  }

  .rating-btn strong {
    font-size: 0.78rem;
  }

  .rating-btn span {
    font-size: 0.68rem;
  }
}

@page {
  size: A4 landscape;
  margin: 10mm;
}

@media print {
  :root {
    --ink: #17211f;
    --muted: #51605a;
    --line: rgba(23, 33, 31, 0.18);
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    min-height: 0;
    background: #fff;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .summary-page .hero {
    min-height: 0;
    padding: 12mm;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #11342f;
    break-after: avoid;
  }

  .summary-page .hero::before {
    opacity: 0.52;
  }

  .topbar,
  .password-panel,
  #summaryStatus,
  .summary-actions {
    display: none !important;
  }

  .hero-copy {
    width: 100%;
    padding: 0;
  }

  .hero-copy h1 {
    font-size: 34pt;
    line-height: 1;
  }

  .hero-copy .eyebrow {
    margin-bottom: 8px;
    font-size: 10pt;
  }

  .section-head {
    margin: 8mm 0 4mm;
  }

  .section-head h2 {
    font-size: 22pt;
  }

  .section-head p {
    margin-top: 3px;
    font-size: 10pt;
  }

  .print-stamp {
    display: block;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6mm;
    margin-top: 0;
    align-items: start;
  }

  .panel {
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 5mm;
    box-shadow: none;
    background: #fff;
  }

  .panel h2 {
    font-size: 15pt;
  }

  .rank-list,
  .person-list {
    gap: 4px;
  }

  .rank-item,
  .person-item {
    gap: 7px;
    padding: 5px;
    border: 1px solid rgba(23, 33, 31, 0.1);
    border-radius: 0;
    break-inside: avoid;
  }

  .rank-item img {
    width: 46px;
    height: 34px;
    border-radius: 0;
  }

  .matrix tr {
    break-inside: avoid;
  }

  .bar {
    height: 5px;
    margin-top: 4px;
  }

  .empty-state {
    font-size: 8.5pt;
    line-height: 1.35;
  }

  .matrix-wrap {
    overflow: visible;
  }

  .matrix {
    min-width: 0;
    border-spacing: 0 3px;
    font-size: 8.5pt;
  }

  .matrix th,
  .matrix td {
    padding: 5px 6px;
    background: #fff;
    border-bottom: 1px solid rgba(23, 33, 31, 0.1);
  }

  .matrix th:first-child,
  .matrix td:first-child {
    position: static;
    min-width: 120px;
    border-radius: 0;
  }

  .matrix th:last-child,
  .matrix td:last-child {
    border-radius: 0;
  }
}
