:root {
  --ink: #171514;
  --red: #7d1f24;
  --red-dark: #541318;
  --gold: #c89b4b;
  --cream: #f5efe3;
  --paper: #fffdf8;
  --line: #d8cdbb;
  --green: #226b3a;
  --shadow: 0 16px 44px rgba(22, 16, 12, .12);
}

* { box-sizing: border-box; }
body { background: #ece7de; color: var(--ink); font-family: Arial, Helvetica, sans-serif; line-height: 1.55; margin: 0; }
a { color: var(--red); }
.site-header { align-items: center; background: var(--ink); border-bottom: 3px solid var(--gold); display: flex; gap: 24px; justify-content: space-between; padding: 14px max(24px, calc((100vw - 1180px) / 2)); }
.site-name { color: #fff; line-height: 1.05; text-decoration: none; }
.site-name span { color: var(--gold); display: block; font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.site-name strong { display: block; font-family: Georgia, serif; font-size: 1.45rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.site-nav a { border-radius: 3px; color: #fff; font-size: .92rem; font-weight: 800; padding: 9px 12px; text-decoration: none; }
.site-nav a:hover, .site-nav a.active { background: var(--red); }
.site-footer { color: #665e57; font-size: .85rem; padding: 24px; text-align: center; }
.shell { margin: 0 auto; max-width: 1180px; padding: 24px; }
.shell.narrow { max-width: 820px; }
.rules-shell { max-width: 960px; }
.panel { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 32px; }
.brand { color: var(--gold); font-size: 13px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.15; }
h1 { font-family: Georgia, serif; font-size: clamp(2rem, 6vw, 3.4rem); margin: .25rem 0 1rem; }
h2 { font-size: 1.35rem; }
.lead { color: #504842; font-size: 1.06rem; }
.fine { color: #665e57; font-size: .88rem; }
.stack { display: grid; gap: 18px; }
label { display: block; font-weight: 800; }
input:not([type="checkbox"]), textarea, select { background: #fff; border: 1px solid #9f968e; border-radius: 4px; display: block; font: inherit; margin-top: 6px; padding: 12px; width: 100%; }
input:focus, textarea:focus, select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(125, 31, 36, .14); outline: none; }
button, .small-button { background: var(--red); border: 0; border-radius: 4px; color: #fff; cursor: pointer; display: inline-block; font: inherit; font-weight: 900; padding: 12px 18px; text-decoration: none; }
.button { background: var(--red); border-radius: 4px; color: #fff; display: inline-block; font-weight: 900; padding: 13px 19px; text-decoration: none; }
.button:hover { background: var(--red-dark); color: #fff; }
.button.secondary { background: var(--ink); }
.button.secondary:hover { background: var(--red-dark); }
button:hover, .small-button:hover { background: var(--red-dark); color: #fff; }
button:disabled { cursor: wait; opacity: .65; }
.link-button { background: transparent; color: var(--red); padding: 2px 5px; text-decoration: underline; }
.link-button:hover { background: transparent; color: var(--red-dark); }
.two-col, .three-col { display: grid; gap: 16px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { align-items: end; grid-template-columns: 1fr 2fr 1fr; }
.three-col button { grid-column: 1 / -1; justify-self: start; }
.address-grid { display: grid; gap: 16px; grid-template-columns: 2fr .55fr 1fr; }
.three-settings { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
fieldset { border: 1px solid var(--line); display: grid; gap: 18px; margin: 0; padding: 22px; }
legend { color: var(--red); font-family: Georgia, serif; font-size: 1.25rem; font-weight: 700; padding: 0 8px; }
hr { border: 0; border-top: 1px solid var(--line); width: 100%; }
.alert { border-left: 5px solid var(--gold); margin: 18px 0; padding: 15px 18px; }
.alert.error { background: #fce9e9; border-color: #a41e29; }
.alert.success { background: #e7f5e9; border-color: var(--green); }
.login-panel { margin-top: 10vh; }
.staff-nav { background: var(--ink); display: flex; gap: 20px; justify-content: flex-end; padding: 12px 18px; }
.staff-nav a { color: #fff; font-size: .9rem; font-weight: 800; text-decoration: none; }
.step { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 22px; position: relative; }
.step-number { align-items: center; background: var(--gold); border-radius: 50%; display: flex; font-weight: 900; height: 34px; justify-content: center; position: absolute; right: 0; top: 18px; width: 34px; }
.name-confirm { background: var(--cream); padding: 12px; }
.verify-box, .optin-box, .token-box { border: 1px solid var(--line); padding: 18px; }
.verify-box { background: #f8f6f1; }
.optin-box { background: var(--cream); }
.token-box { border: 2px solid var(--gold); }
.check { align-items: start; display: grid; font-weight: 500; gap: 10px; grid-template-columns: 20px 1fr; margin-bottom: 16px; }
.check input { height: 18px; margin-top: 4px; width: 18px; }
.reveal-button { font-size: 1.12rem; padding: 16px 22px; }
.result-step { background: #eef8ef; border: 3px solid var(--green); padding: 28px; text-align: center; }
.result-step h2 { color: var(--green); font-family: Georgia, serif; font-size: clamp(2rem, 7vw, 4rem); margin: .4rem 0; }
.winner-label { color: var(--red); font-weight: 900; letter-spacing: .15em; }
.code-line { font-size: 1.1rem; }
.grand-entry-confirm { color: var(--green); font-size: 1.1rem; font-weight: 900; }
.receipt-brand { color: var(--ink); font-size: .82rem; font-weight: 900; letter-spacing: .18em; margin-bottom: 8px; }
.receipt-label { color: #665e57; font-size: .75rem; font-weight: 900; letter-spacing: .14em; margin: 24px 0 0; }
.receipt-details { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); margin: 24px auto; max-width: 620px; padding: 12px 0; text-align: left; }
.receipt-details p { display: grid; gap: 18px; grid-template-columns: 130px 1fr; margin: 8px 0; }
.receipt-details span { color: #665e57; }
.receipt-thanks { color: #665e57; font-size: .9rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 24px; }
.secondary-button { background: var(--ink); }
.form-shell { max-width: 980px; }
.form-heading { align-items: flex-start; display: flex; gap: 20px; justify-content: space-between; }
.secure-badge { background: var(--ink); border-radius: 3px; color: #fff; font-size: .75rem; font-weight: 900; letter-spacing: .12em; padding: 8px 10px; }
.admin-header { background: var(--ink); color: #fff; padding: 28px; }
.admin-header h1 { color: #fff; margin-bottom: 0; }
.admin-section { margin-top: 22px; }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); margin: 22px 0; }
.stats.four-stats { grid-template-columns: repeat(4, 1fr); }
.stats.five-stats { grid-template-columns: repeat(5, 1fr); }
.stats div { background: var(--paper); border: 1px solid var(--line); padding: 20px; text-align: center; }
.stats strong { display: block; font-family: Georgia, serif; font-size: 2.3rem; }
.stats span { color: #665e57; }
.inline-form { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; }
.section-heading { align-items: center; display: flex; gap: 20px; justify-content: space-between; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 680px; width: 100%; }
th, td { border: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { background: var(--ink); color: #fff; }
code { background: #eee8de; padding: 2px 5px; }
.hero { background: var(--ink); color: #fff; margin: -32px -32px 28px; padding: 42px 32px; text-align: center; }
.hero h1 { color: #fff; }
.callout { background: var(--cream); border-left: 6px solid var(--gold); padding: 20px; }
.rules h2 { border-bottom: 1px solid var(--line); margin-top: 32px; padding-bottom: 7px; }
.rules li { margin-bottom: 8px; }
.home-hero { background: linear-gradient(115deg, rgba(20,17,15,.97), rgba(74,18,22,.92)), radial-gradient(circle at 80% 20%, #c89b4b 0, transparent 35%); color: #fff; min-height: 430px; padding: 80px 24px; }
.home-hero-inner { margin: 0 auto; max-width: 900px; text-align: center; }
.home-hero h1 { color: #fff; font-size: clamp(3.5rem, 11vw, 7.5rem); letter-spacing: .04em; margin: .2rem 0; }
.hero-tagline { font-family: Georgia, serif; font-size: clamp(1.25rem, 3vw, 1.8rem); margin: 0 auto 30px; max-width: 720px; }
.hero-actions { margin-top: 28px; }
.home-shell { margin-top: -54px; position: relative; }
.intro-panel { margin: 0 auto 24px; max-width: 900px; text-align: center; }
.intro-panel h2 { font-family: Georgia, serif; font-size: 2rem; }
.how-grid { display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 24px 0; }
.how-card { background: var(--paper); border-top: 5px solid var(--gold); box-shadow: 0 8px 25px rgba(22,16,12,.08); padding: 24px; }
.how-card > span { align-items: center; background: var(--red); border-radius: 50%; color: #fff; display: flex; font-weight: 900; height: 38px; justify-content: center; width: 38px; }
.how-card h2 { font-family: Georgia, serif; }
.home-details { align-items: center; display: grid; gap: 30px; grid-template-columns: 1fr auto; margin-top: 24px; }
.home-details h2 { font-family: Georgia, serif; margin: .35rem 0; }
.eyebrow { color: var(--red); font-size: .78rem; font-weight: 900; letter-spacing: .15em; }
.grand-prize-banner { align-items: center; background: var(--ink); border: 2px solid var(--gold); color: #fff; display: grid; gap: 22px; grid-template-columns: auto 1fr; margin: 24px 0; padding: 28px; }
.grand-prize-banner h2 { color: #fff; font-family: Georgia, serif; font-size: clamp(1.6rem, 4vw, 2.5rem); margin: .25rem 0; }
.grand-prize-banner p { margin-bottom: 0; }
.grand-prize-banner .eyebrow { color: var(--gold); }
.grand-icon { align-items: center; background: var(--gold); border-radius: 50%; color: var(--ink); display: flex; font-size: 2rem; height: 64px; justify-content: center; width: 64px; }
.export-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.active-drop-control { align-items: end; display: grid; gap: 24px; grid-template-columns: 1fr minmax(280px, .65fr); }
.active-drop-control h2, .active-drop-control p { margin-bottom: .35rem; margin-top: 0; }
.drop-title-row { align-items: center; display: flex; gap: 20px; justify-content: space-between; }
.drop-title-row > div { align-items: center; display: flex; gap: 12px; }
.drop-title-row h2 { margin: 0; }
.drop-code-badge, .test-badge { background: var(--gold); border-radius: 3px; color: var(--ink); display: inline-block; font-size: .75rem; font-weight: 900; letter-spacing: .12em; padding: 6px 9px; }
.test-badge { background: #efe0a5; border: 1px solid #aa8126; }
.test-row { background: #fff9df; }
.compact-check { grid-column: 1 / -1; margin: 0; }
.danger-button { background: #9c1f29; }
.danger-link { color: #9c1f29; font-weight: 900; }
.admin-drop-image { background: #fff; border: 1px solid var(--line); height: 130px; object-fit: contain; padding: 6px; width: 130px; }
.drop-item-image { background: rgba(255,255,255,.96); border: 3px solid var(--gold); border-radius: 12px; display: block; height: 240px; margin: 20px auto 4px; object-fit: contain; padding: 10px; width: 240px; }
.active-form-drop { align-items: center; background: var(--cream); border-left: 5px solid var(--gold); display: flex; gap: 12px; justify-content: space-between; margin: 18px 0; padding: 14px 16px; }
.active-form-drop span { color: #665e57; }
.test-confirm { background: #fff4c4; border: 2px solid #aa8126; color: #5a4310; font-weight: 900; padding: 12px; }
.drop-image-cropper { background: var(--cream); border: 1px solid var(--line); margin-top: 14px; max-width: 650px; padding: 18px; }
.drop-image-cropper > p { margin-top: 0; }
.drop-crop-canvas { background: #fff; border: 2px solid var(--gold); cursor: grab; display: block; height: auto; max-width: 100%; touch-action: none; width: 420px; }
.drop-crop-canvas.dragging { cursor: grabbing; }
.crop-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.drop-crop-status { color: var(--green); font-weight: 900; margin-bottom: 0; }
.rules-drop-item { background: var(--cream); border: 1px solid var(--line); margin: 0 auto 28px; max-width: 360px; padding: 14px; text-align: center; }
.rules-drop-item img { background: #fff; display: block; height: auto; margin: 0 auto 10px; max-height: 320px; object-fit: contain; width: 100%; }
.rules-drop-item figcaption { color: var(--red); font-weight: 900; }
.code-upload-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 20px 0 28px; }
.code-upload-box { background: #f8f6f1; border: 1px solid var(--line); padding: 20px; }
.code-upload-box h3 { margin-top: 0; }
.replace-box { border-color: #b48a34; }
.code-edit-table { min-width: 980px; }
.code-edit-table td { vertical-align: middle; }
.code-edit-table input.table-input { margin: 0; min-width: 105px; padding: 8px; }
.code-edit-table .prize-input { min-width: 230px; }
.code-edit-table .value-input { width: 105px; }
.table-check { align-items: center; display: flex; font-size: .88rem; gap: 7px; white-space: nowrap; }
.table-check input { height: 17px; width: 17px; }
.code-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.small-save-button { padding: 8px 12px; }
.available-badge, .locked-badge { border-radius: 3px; display: inline-block; font-size: .75rem; font-weight: 900; padding: 5px 8px; text-transform: uppercase; }
.available-badge { background: #dff2e2; color: #1b6832; }
.locked-badge { background: #e5e1dc; color: #554d46; }
.inline-delete-form { margin-top: 8px; }

@media (max-width: 720px) {
  .site-header { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .site-nav { width: 100%; }
  .site-nav a { flex: 1; padding: 8px; text-align: center; }
  .shell { padding: 12px; }
  .panel { padding: 20px; }
  .two-col, .three-col, .stats, .stats.four-stats, .stats.five-stats, .address-grid, .three-settings, .active-drop-control, .code-upload-grid { grid-template-columns: 1fr; }
  .hero { margin: -20px -20px 22px; padding: 32px 20px; }
  .staff-nav { justify-content: center; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .home-hero { min-height: 360px; padding: 60px 18px 90px; }
  .how-grid, .home-details { grid-template-columns: 1fr; }
  .home-details .button { text-align: center; }
  .grand-prize-banner { grid-template-columns: 1fr; text-align: center; }
  .grand-icon { margin: 0 auto; }
  .drop-title-row, .active-form-drop { align-items: flex-start; flex-direction: column; }
}

@media print {
  @page { margin: .5in; size: auto; }
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .staff-nav, .form-heading, .lead, #app-message, #redeem-form, .result-actions { display: none !important; }
  .shell, .panel { border: 0; box-shadow: none; margin: 0; max-width: none; padding: 0; }
  #redemption-app { display: block !important; }
  #result-panel { background: #fff; border: 3px solid #000; color: #000; display: block !important; margin: 0 auto; max-width: 7in; padding: .4in; }
  #result-panel h2 { color: #000; font-size: 32pt; }
  .winner-label, .grand-entry-confirm { color: #000; }
  .receipt-details { border-color: #000; }
  .receipt-thanks { color: #000; }
}
