/* Wristband Builder v2.0.1 */
:root{
  --bg:#0b1220;
  --panel:#0f1a2d;
  --card:#12213a;
  --text:#e9eef7;
  --muted:#a9b7cf;
  --border:rgba(255,255,255,.10);
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--sans);
  color:var(--text);
  background: radial-gradient(1200px 800px at 20% 0%, rgba(62,166,255,.18), transparent 50%),
              radial-gradient(1000px 600px at 80% 20%, rgba(141,208,255,.10), transparent 55%),
              var(--bg);
}

.app-header{
  position:sticky; top:0; z-index:10;
  background: rgba(11,18,32,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:40px; height:40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(62,166,255,.95), rgba(141,208,255,.75));
  display:grid; place-items:center;
  font-weight:800;
  color:#06203a;
  box-shadow: var(--shadow);
}
.titles .title{font-size:18px; font-weight:800; letter-spacing:.2px}
.titles .subtitle{font-size:12px; color:var(--muted); margin-top:2px}

.actions{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight:700;
}
.btn:hover{background: rgba(255,255,255,.10)}
.btn:active{transform: translateY(1px)}
.btn-primary{
  border-color: rgba(62,166,255,.5);
  background: rgba(62,166,255,.20);
}
.btn-primary:hover{background: rgba(62,166,255,.26)}
.btn-secondary{opacity:.9}

.layout{
  padding: 18px;
  display:grid;
  gap: 18px;
  grid-template-columns: 1.1fr .9fr;
}
@media (max-width: 1100px){
  .layout{grid-template-columns: 1fr}
}

.panel{
  background: rgba(15,26,45,.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

h2{margin:0 0 8px 0; font-size:16px}
h3{margin:14px 0 8px 0; font-size:14px}
.muted{color:var(--muted)}
.small{font-size:12px}

.dropzone{
  margin-top: 10px;
  border: 2px dashed rgba(141,208,255,.35);
  background: rgba(18,33,58,.50);
  border-radius: 18px;
  padding: 18px;
  min-height: 96px;
  display:grid;
  place-items:center;
  outline:none;
}
.dropzone.drag{
  border-color: rgba(62,166,255,.85);
  background: rgba(62,166,255,.10);
}
.dz-title{font-weight:900}
.dz-sub{color:var(--muted); margin-top:4px; font-size:13px}

.controls-grid{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width:700px){
  .controls-grid{grid-template-columns:1fr}
}
.control{
  background: rgba(18,33,58,.45);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}
.label{display:block; font-size:12px; color:var(--muted); margin-bottom:8px}
.select{
  width:100%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 10px;
  border-radius: 12px;
}
.row{display:flex; align-items:center; gap:10px}
.pill{
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.25);
  white-space: nowrap;
}
.toggle{
  display:flex; align-items:center; gap:8px;
  border:1px solid var(--border);
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  user-select:none;
}
.toggle input{transform: scale(1.1)}

.list-header{
  margin-top: 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
}

.play-list{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.play-item{
  display:flex;
  gap: 12px;
  align-items:center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(18,33,58,.55);
}
.play-item.dragging{opacity:.6}
.thumb{
  width: 76px; height: 76px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.25);
  overflow:hidden;
  display:grid; place-items:center;
}
.thumb img{width:100%; height:100%; object-fit: contain}
.meta{flex:1; min-width:0}
.meta .name{font-weight:800; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.meta .dim{font-size:12px; color:var(--muted); margin-top:4px}
.item-actions{display:flex; gap:8px}
.icon-btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  cursor:pointer;
}
.icon-btn:hover{background: rgba(255,255,255,.09)}
.icon-btn.danger{border-color: rgba(255,80,80,.35)}
.icon-btn.danger:hover{background: rgba(255,80,80,.12)}

/* Preview */
.preview-wrap{
  background: rgba(0,0,0,.20);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  overflow:auto;
  max-height: 72vh;
}
.page{
  width: 8.5in;
  height: 11in;
  background: white;
  margin: 0 auto 14px auto;
  position: relative;
  box-shadow: 0 10px 24px rgba(0,0,0,.40);
  transform: scale(var(--scale, 1));
  transform-origin: top left;
}
.sheet{
  position:absolute;
  inset:0;
}

/* Each wrist card is 4.75 x 2.75. We fit 1 across and 4 down on Letter. */
.cards{
  position:absolute;
  left: 1.875in; /* centers 4.75 within 8.5: (8.5-4.75)/2 = 1.875 */
  top: 0in;
  width: 4.75in;
  height: 11in;
  display:grid;
  grid-template-rows: repeat(4, 2.75in);
  gap: 0in; /* no gap between cards */
}

/* Card */
.card{
  position: relative;
  width: 4.75in;
  height: 2.75in;
  background: white;
}
.card.guided{
  outline: 1px solid rgba(0,0,0,.12);
}

/* Inner grid for 6 plays */
.card-grid{
  position:absolute;
  inset:0;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: var(--gap, 0px);
  padding: 0; /* ultra tight by default */
}
.cell{
  display:grid;
  place-items:center;
  overflow:hidden;
  background:white;
}
.cell img{
  width:100%;
  height:100%;
  object-fit: contain;
}

.footer{
  padding: 12px 18px 18px;
  color: var(--muted);
  text-align:center;
  font-size:12px;
}

/* Print */
@media print{
  body{background:white}
  .app-header,.footer,.panel:first-child,.print-tips{display:none !important}
  main.layout{padding:0; display:block}
  .panel{border:none; box-shadow:none; padding:0; background:white}
  .preview-wrap{border:none; padding:0; max-height:none; overflow:visible; background:white}
  .page{box-shadow:none; margin:0; page-break-after: always;}
}

/* Print/card scale (calibration) */
.cards{
  transform: scale(var(--printScale, 1));
  transform-origin: top center;
}
