/* ============== FINAL SCREEN — MISSION REPORT ============== */
/* Override page-wrap on final to allow 3-column layout */
.final-page {
  max-width: 1240px !important;
}
.final-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  gap: 24px;
  align-items: start;
  width: 100%;
}
.final-side {
  align-self: center;
  width: 100%;
  max-width: 360px;
}
.final-side-left  { justify-self: end; }
.final-side-right { justify-self: start; }

/* Stack on narrower screens — receipt first so it's still the focus */
@media (max-width: 980px) {
  .final-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    justify-items: center;
  }
  .final-side-left, .final-side-right { justify-self: stretch; max-width: 420px; margin: 0 auto; }
  .final-side-left  { order: 2; }
  .receipt-wrap     { order: 1; }
  .final-side-right { order: 3; }
}

.side-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 16px;
  background: rgba(8, 18, 30, 0.55);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 4px;
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.12), inset 0 0 14px rgba(var(--accent-rgb), 0.05);
  position: relative;
}
.side-actions::before, .side-actions::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  pointer-events: none;
}
.side-actions::before {
  top: 5px; right: 5px;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
}
.side-actions::after {
  bottom: 5px; left: 5px;
  border-bottom: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
}
.side-actions-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-align: center;
  margin-bottom: 4px;
  text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
}

.receipt-wrap {
  display: flex;
  justify-content: center;
  perspective: 1200px;
}
.receipt {
  width: 100%;
  max-width: 420px;
  background: rgba(6, 14, 24, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--accent-light);
  padding: 28px 24px 32px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 4px;
  box-shadow:
    0 0 40px rgba(var(--accent-rgb), 0.22),
    inset 0 0 32px rgba(var(--accent-rgb), 0.06),
    0 18px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  transform-origin: top center;
}
/* HUD corner brackets */
.receipt::before, .receipt::after {
  content: '';
  position: absolute;
  width: 24px; height: 24px;
  pointer-events: none;
}
.receipt::before {
  top: 6px; left: 6px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  box-shadow: -1px -1px 10px rgba(var(--accent-rgb), 0.5);
  background: none;
  height: 24px;
}
.receipt::after {
  bottom: 6px; right: 6px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  box-shadow: 1px 1px 10px rgba(var(--accent-rgb), 0.5);
  background: none;
  height: 24px;
}
.receipt-header {
  text-align: center;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.3);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.receipt-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(245, 197, 24, 0.7);
}
.receipt-tagline {
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-top: 4px;
  text-shadow: 0 0 6px rgba(var(--accent-rgb), 0.4);
}
.receipt-meta {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(var(--accent-rgb), 0.55);
  margin-top: 6px;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin: 3px 0;
}
.receipt-row.muted { color: rgba(var(--accent-rgb), 0.6); font-size: 10px; letter-spacing: 0.14em; }
.receipt-row.total {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 0.08em;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--accent);
  color: var(--gold);
  text-shadow: 0 0 16px rgba(245, 197, 24, 0.6);
}
.receipt-divider {
  font-size: 11px;
  color: rgba(var(--accent-rgb), 0.3);
  text-align: center;
  margin: 10px 0;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: -1px;
  position: relative;
}
.receipt-divider::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(var(--accent-rgb), 0.4) 0 4px, transparent 4px 8px);
}
.receipt-items { margin: 8px 0; }
.receipt-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  margin: 5px 0;
  color: var(--accent-light);
}
.receipt-item .qty {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 6px rgba(var(--accent-rgb), 0.5);
}
.receipt-item .desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.05em;
}
.receipt-item.miss .qty { color: #ff5050; text-shadow: 0 0 6px rgba(255, 80, 80, 0.7); }
.receipt-item.miss .desc { color: rgba(255, 130, 130, 0.85); }
.receipt-item.perfect .qty { color: var(--gold); text-shadow: 0 0 8px rgba(245, 197, 24, 0.8); }
.receipt-item.perfect .desc { color: var(--gold); font-weight: 700; }
.receipt-item .pts {
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 6px rgba(245, 197, 24, 0.5);
}
.receipt-tier {
  text-align: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 0.24em;
  color: var(--accent);
  margin: 16px 0 12px;
  padding: 12px 6px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.35);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.05);
  line-height: 1.05;
  text-shadow: 0 0 16px rgba(var(--accent-rgb), 0.7);
}
.receipt-tier::before, .receipt-tier::after {
  content: '◆';
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--gold);
  display: inline-block;
  margin: 0 8px;
  vertical-align: middle;
  text-shadow: 0 0 8px rgba(245, 197, 24, 0.6);
}
.receipt-footer {
  text-align: center;
  margin-top: 12px;
}
.receipt-thanks {
  font-size: 13px;
  letter-spacing: 0.2em;
  margin-bottom: 4px;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(var(--accent-rgb), 0.5);
}
.receipt-footnote {
  font-size: 9px;
  color: rgba(var(--accent-rgb), 0.5);
  letter-spacing: 0.22em;
}
.barcode {
  height: 44px;
  margin: 16px 0 6px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 1px;
  padding: 4px;
  background: rgba(var(--accent-rgb), 0.05);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}
.barcode-bar {
  background: var(--accent);
  box-shadow: 0 0 4px rgba(var(--accent-rgb), 0.5);
}
.barcode-num {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(var(--accent-rgb), 0.4);
}
/* Circular rating badge (1-10 based on score) */
.rating-badge {
  position: absolute;
  top: 12%;
  right: -18px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, rgba(28, 24, 12, 0.95), rgba(8, 18, 30, 0.98));
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(8deg) scale(0);
  opacity: 0.98;
  box-shadow:
    0 0 36px rgba(245, 197, 24, 0.6),
    inset 0 0 22px rgba(245, 197, 24, 0.18);
  z-index: 3;
}
.rating-badge::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(245, 197, 24, 0.5);
  border-radius: 50%;
  pointer-events: none;
}
.rating-badge .rating-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 44px;
  line-height: 1;
  color: var(--gold);
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(245, 197, 24, 0.9);
}
.rating-badge .rating-max {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(245, 197, 24, 0.7);
  margin-top: 2px;
}

.nickname-input {
  width: 100%;
  background: rgba(8, 18, 30, 0.7);
  color: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 3px;
  padding: 14px 16px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.1em;
  outline: none;
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.12), inset 0 0 10px rgba(var(--accent-rgb), 0.05);
  transition: all 0.2s;
}
.nickname-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(245, 197, 24, 0.35), inset 0 0 14px rgba(245, 197, 24, 0.08);
}
.nickname-input::placeholder {
  color: rgba(var(--accent-rgb), 0.45);
  letter-spacing: 0.14em;
}

.save-card {
  background: linear-gradient(180deg, rgba(245, 197, 24, 0.08), rgba(8, 18, 30, 0.75));
  border: 1px solid rgba(245, 197, 24, 0.45);
  border-radius: 4px;
  padding: 18px 18px 16px;
  box-shadow:
    0 0 30px rgba(245, 197, 24, 0.18),
    inset 0 0 22px rgba(245, 197, 24, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.save-card::before, .save-card::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  pointer-events: none;
}
.save-card::before {
  top: 5px; left: 5px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
}
.save-card::after {
  bottom: 5px; right: 5px;
  border-bottom: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
}
.save-card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(245, 197, 24, 0.55);
  text-align: center;
}
.save-card-sub {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(var(--accent-rgb), 0.7);
  text-align: center;
  margin-top: -4px;
}
