:root {
  color-scheme: light dark;
  --bg: #0b1020;
  --panel: #121a33;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #60a5fa;
  --card: #1f2a4d;
  --ok: #22c55e;

  /* Physical scale targets */
  --badge-height: 2.85in;
  --ribbon-height: 0.4in;
  --ribbon-width: 1.4in;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #0b1020, #0a0f1a);
  color: var(--text);
}
header, footer { padding: 16px; text-align: center; }
header h1 { margin: 0 0 6px; font-size: 1.6rem; }
header p { margin: 0; color: var(--muted); }
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px;
  display: grid;
  gap: 12px;
}
.panel {
  background: var(--panel);
  border: 1px solid #243056;
  border-radius: 14px;
  padding: 14px;
}
.panel h2 { margin-top: 0; font-size: 1rem; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.section-head h2 { margin: 0; }

.checklist {
  display: grid;
  gap: 8px;
}
.item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #2a3a66;
  border-radius: 10px;
  background: #172242;
}
.item input { transform: scale(1.2); align-self: flex-start; }
.item > span { text-align: center; line-height: 1.2; }
.actions { display: flex; gap: 8px; margin-top: 10px; }
button {
  border: 1px solid #39518f;
  background: #1c2b52;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
}
.ordered {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  min-height: 56px;
}
.award-card {
  border: 1px solid #334155;
  background: #0f172a;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.awardimg-large {
  width: 220px;
  height: 120px;
  display: block;
}
.award-name-below {
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.25;
  width: 100%;
}
/* legacy dot style removed */
.note { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }
small { color: var(--muted); }

@media (max-width: 600px) {
  .ordered { grid-template-columns: 1fr; }
  .awardimg-large { width: min(92vw, 320px); height: 150px; }
}

.mapper{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.mcard{background:#172242;border:1px solid #2a3a66;border-radius:10px;padding:8px;display:flex;flex-direction:column;gap:6px}
.mcard img{width:100%;height:100px;object-fit:contain;background:#fff;border-radius:6px}
.mcap{font-weight:700;color:#93c5fd}
.mcard select{width:100%;background:#0f1730;color:#e5e7eb;border:1px solid #36508e;border-radius:8px;padding:6px}
.awardimg{width:140px;height:40px;object-fit:contain;border-radius:0;border:none;display:block}
.rack-svg{width:100%;height:100%;display:block;background:transparent;margin:0;padding:0}

.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 50; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal-card {
  position: absolute;
  inset: 4% 4%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #334155;
}
.modal-actions { margin-top: 0; flex-wrap: wrap; justify-content: flex-end; }
.modal-actions button { padding: 6px 10px; border-radius: 8px; }
.policy-scroll {
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #111827;
  -webkit-overflow-scrolling: touch;
}
#policyImage {
  width: 100%;
  height: auto;
  display: block;
  transform-origin: top left;
  touch-action: pan-y pinch-zoom;
  background: #fff;
}

.jacket-preview {
  margin-top: 10px;
  border: 1px solid #334155;
  border-radius: 14px;
  background: linear-gradient(180deg, #1f2937, #111827);
  padding: 14px;
}
.jacket-card {
  max-width: 420px;
  margin: 0 auto;
  background: #0b1224;
  border: 1px solid #3b4c75;
  border-radius: 14px;
  padding: 14px;
}
.jacket-title { text-align: center; color: #cbd5e1; margin-bottom: 10px; font-size: 0.9rem; }
.badge-marker {
  height: var(--badge-height);
  width: auto;
  margin: 0 auto 2px;
  object-fit: contain;
  border-radius: 0;
  border: none;
  background: transparent;
  padding: 0;
  display: block;
}
.rack {
  margin: 2px auto 0;
  display: grid;
  gap: 0;
  justify-content: center;
}
.rack-row {
  display: flex;
  gap: 0 !important;
  justify-content: center;
  align-items: center;
  font-size: 0; /* kill inline/whitespace gaps */
  line-height: 0;
}
.rack-row-top {
  justify-content: center;
}
.rack-row-pair {
  justify-content: center;
  gap: 0; /* touching edges */
}
.rack-row-triple {
  justify-content: center;
  gap: 0; /* touching edges */
}
.rack-row-top .ribbon-slot {
  width: var(--ribbon-width);
  height: var(--ribbon-height);
}
.ribbon-slot {
  width: var(--ribbon-width);
  height: var(--ribbon-height);
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}
.rack-strip {
  display: block;
  overflow: hidden;
  shape-rendering: geometricPrecision;
}
.ribbon-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
}
.rack-empty {
  color: #94a3b8;
  text-align: center;
  font-size: 0.85rem;
  margin-top: 10px;
}

@media (max-width: 700px) {
  .modal-card { inset: 2% 2%; }
  .modal-head { align-items: flex-start; flex-direction: column; }
  .modal-actions { width: 100%; justify-content: flex-start; }
}
