:root {
  --gold: #f0c419;
  --gold-dark: #b8860b;
  --orange: #f5921b;
  --black: #0c0c0c;
  --panel: #161616;
  --suitcase-gray: #b9b9bd;
  --suitcase-opened: #3a3a3d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  color: #fff;
  /* The whole page is fixed to the viewport — nothing outside .grid-scroll ever scrolls,
     so this has to fit a TV/iPad screen exactly with no page-level scrollbars. */
  overflow: hidden;
}

body {
  background: var(--orange) url("../assets/background.jpg") center center / cover no-repeat fixed;
}

.page {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5vh;
  padding: 0 2vw 1.5vh;
}

.header-image {
  flex-shrink: 0;
  width: auto;
  height: auto;
  max-width: 90vw;
  /* Capped by height, not width, so it scales with the viewport but can never
     grow tall enough to push .grid-scroll (flex: 1, fills whatever's left) off
     the bottom of the page. */
  max-height: 18vh;
  object-fit: contain;
}

@media (min-width: 900px) {
  .page {
    padding-top: 0;
    padding-bottom: 2.5vh;
  }

  .header-image {
    max-height: 32vh;
  }
}

.grid-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 1800px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--panel);
  border: 4px solid #707070;
  border-radius: 14px;
  padding: 1.6vh 1.6vw;
  /* A visible scrollbar eats space from the right padding only, making the
     grid look off-center (touch scrolling doesn't need it visible). */
  scrollbar-width: none;
}

.grid-scroll::-webkit-scrollbar {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2vw;
}

@media (min-width: 900px) {
  .grid-scroll {
    width: 85%;
    background: rgba(0, 0, 0, 0.5);
  }

  .grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 0.8vw;
  }
}

.case {
  position: relative;
  aspect-ratio: 968 / 738;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.case:active {
  transform: scale(0.92);
}

.case img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.case .case-number {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: Arial, sans-serif;
  font-weight: 900;
  color: #333;
  font-size: clamp(11px, 1.6vw, 22px);
  pointer-events: none;
}

.case.opened {
  cursor: default;
}

.case.opened:active {
  transform: none;
}

.case.opened img {
  filter: grayscale(1);
  opacity: 0.45;
}

.case.opened .case-number {
  color: #777;
}

/* --- Reveal overlay --- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.overlay[hidden] {
  display: none;
}

.reveal-card {
  background: linear-gradient(180deg, #1a1a1a, var(--black));
  border: 5px solid var(--gold);
  border-radius: 20px;
  padding: 5vh 6vw;
  text-align: center;
  max-width: 90vw;
  box-shadow: 0 0 80px rgba(240, 196, 25, 0.4);
}

.reveal-card .eyebrow {
  font-family: Arial, sans-serif;
  letter-spacing: 0.3em;
  color: var(--gold);
  font-size: clamp(14px, 1.6vw, 20px);
  margin-bottom: 1vh;
}

.reveal-card .prize-label {
  font-size: clamp(32px, 6vw, 72px);
  font-weight: 900;
  color: #fff;
  margin: 0.3em 0 0.6em;
}

.reveal-card button {
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: clamp(14px, 1.6vw, 20px);
  letter-spacing: 0.1em;
  padding: 0.7em 2.4em;
  border-radius: 30px;
  border: none;
  background: var(--gold);
  color: var(--black);
  cursor: pointer;
}

.admin-link {
  position: fixed;
  bottom: 6px;
  right: 8px;
  opacity: 0.06;
  font-size: 10px;
  color: #fff;
  text-decoration: none;
}

/* --- Admin page --- */
.admin-body {
  overflow: auto;
  align-items: flex-start;
  padding-top: 4vh;
}

.admin-panel {
  width: 100%;
  max-width: 900px;
  background: var(--panel);
  border: 4px solid var(--gold);
  border-radius: 16px;
  padding: 32px;
  font-family: Arial, sans-serif;
}

.admin-panel h1 {
  margin-top: 0;
  font-family: inherit;
}

.admin-panel h2 {
  font-family: inherit;
  font-size: 18px;
  color: var(--gold);
  margin: 28px 0 8px;
}

.admin-panel .hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: #aaa;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.admin-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-actions button,
.prize-editor-footer button {
  font-family: Arial, sans-serif;
  font-weight: bold;
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 15px;
}

.btn-primary {
  background: var(--gold);
  color: var(--black);
}

.btn-secondary {
  background: #333;
  color: #fff;
}

.btn-danger {
  background: #d4322c;
  color: #fff;
}

.btn-small {
  padding: 6px 12px !important;
  font-size: 13px !important;
}

.prize-editor {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.prize-editor th,
.prize-editor td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #333;
}

.prize-editor th {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.prize-editor input[type="text"] {
  width: 100%;
  min-width: 120px;
  padding: 6px 8px;
  background: #222;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  font-family: Arial, sans-serif;
}

.prize-editor .qty-input {
  width: 70px;
  padding: 6px 8px;
  background: #222;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  font-family: Arial, sans-serif;
}

.prize-editor input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.prize-editor-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.prize-total {
  font-weight: bold;
  color: var(--gold);
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
}

.summary-table th,
.summary-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #333;
}

.summary-table th {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 8px;
}

.totals-row td {
  font-weight: bold;
  border-top: 2px solid var(--gold);
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--gold);
  text-decoration: none;
  font-size: 14px;
}
