/* =========================
   Game Day Schedule Builder
   ========================= */

:root{
  --bg:#0b0c10;
  --panel:#12141b;
  --card:#171a23;
  --ink:#f5f7ff;
  --muted:#b7bfd6;
  --soft:#2a2f3f;
  --line:#30374b;
  --accent:#7c5cff;
  --accent2:#19c37d;
  --danger:#ff4d4d;
  --paper:#ffffff;
  --paperInk:#0b1020;
  --paperMuted:#4a5268;
  --paperLine:#e6e8ef;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 20% 0%, #1b1e2a 0%, var(--bg) 55%);
  color:var(--ink);
}

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  gap:16px;
  padding:14px 16px;
  background: rgba(18,20,27,.78);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.brand-title{font-weight:900; letter-spacing:.2px}
.brand-sub{font-size:12px; color:var(--muted); margin-top:2px}

.actions{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.sep{width:1px; height:28px; background:rgba(255,255,255,.10)}

/* Buttons */
.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color:var(--ink);
  padding:10px 12px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
}
.btn:hover{background: rgba(255,255,255,.10)}
.btn:active{transform: translateY(1px)}
.btn.primary{
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(25,195,125,.88));
  border-color: rgba(255,255,255,.08);
}
.btn.primary:hover{filter:brightness(1.05)}
.btn.ghost{background: transparent}
.btn.mini{padding:8px 10px; border-radius:10px; font-size:13px}
.filebtn{display:inline-flex; align-items:center; gap:8px}

/* Layout */
.app{
  display:grid;
  grid-template-columns: 440px 1fr;
  gap:16px;
  padding:16px;
}
@media (max-width: 1080px){
  .app{grid-template-columns: 1fr; }
}

/* Left panel */
.panel{
  display:flex; flex-direction:column; gap:12px;
}
.panel-head h2{margin:0; font-size:18px}
.panel-note{color:var(--muted); font-size:12px; margin-top:6px}

.card{
  background: rgba(23,26,35,.86);
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  padding:12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 520px){
  .grid2{grid-template-columns: 1fr}
}
.field{display:flex; flex-direction:column; gap:6px; margin-bottom:10px}
label{font-size:12px; color:var(--muted); font-weight:800; letter-spacing:.3px; text-transform:uppercase}
input, select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.28);
  color:var(--ink);
  outline:none;
}
input:focus, select:focus{
  border-color: rgba(124,92,255,.55);
  box-shadow: 0 0 0 4px rgba(124,92,255,.16);
}

/* Logos */
.logos{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  margin-top:6px;
  margin-bottom:10px;
}
.logoBox{display:flex; flex-direction:column; gap:8px}
.logoLabel{font-size:12px; color:var(--muted); font-weight:800; text-transform:uppercase; letter-spacing:.3px}
.logoDrop{
  position:relative;
  border-radius:14px;
  height:86px;
  border:1px dashed rgba(255,255,255,.20);
  background: rgba(255,255,255,.04);
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.logoDrop img{
  max-width:100%;
  max-height:100%;
  display:none;
}
.logoDrop.hasImg img{display:block}
.logoHint{
  position:absolute;
  inset:0;
  display:flex; align-items:center; justify-content:center;
  color:rgba(245,247,255,.70);
  font-weight:800;
  font-size:12px;
  letter-spacing:.2px;
  text-transform:uppercase;
}
.logoDrop.hasImg .logoHint{display:none}

/* Items table */
.rowHead{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-bottom:8px;
}
.rowHead h3{margin:0; font-size:16px}
.tableWrap{overflow:auto; border-radius:12px; border:1px solid rgba(255,255,255,.08)}
.tbl{
  width:100%;
  border-collapse:collapse;
  min-width:520px;
  background: rgba(0,0,0,.15);
}
.tbl th, .tbl td{
  padding:10px 10px;
  border-bottom:1px solid rgba(255,255,255,.06);
  vertical-align:middle;
}
.tbl th{
  position:sticky; top:0;
  background: rgba(18,20,27,.95);
  backdrop-filter: blur(8px);
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.25px;
  font-weight:900;
}
.tbl td input{
  background: rgba(0,0,0,.22);
  border-radius:10px;
  padding:9px 10px;
}
.colDrag{width:34px}
.colTime{width:140px}
.colLoc{width:170px}
.colCard{width:64px; text-align:center}
.colDel{width:44px; text-align:center}
.dragHandle{
  cursor:grab;
  width:24px; height:24px;
  border-radius:8px;
  display:grid; place-items:center;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}
.dragHandle:active{cursor:grabbing}
.trRow{user-select:none}
.trRow.dragging{opacity:.5}
.trRow.dropTarget{outline:2px solid rgba(124,92,255,.55)}

.iconBtn{
  width:30px; height:30px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color:var(--ink);
  cursor:pointer;
}
.iconBtn.danger:hover{border-color: rgba(255,77,77,.55); background: rgba(255,77,77,.08)}

.chk{
  width:18px; height:18px;
  accent-color: var(--accent);
}

.help{
  margin-top:10px;
  color:var(--muted);
  font-size:12px;
}

/* Preview */
.preview{
  display:flex; flex-direction:column;
  gap:12px;
}
.previewHead{
  display:flex; align-items:center; justify-content:space-between;
}
.previewHead h2{margin:0; font-size:18px}
.toggle{display:flex; gap:8px}
.chip{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color:var(--ink);
  padding:8px 10px;
  border-radius:999px;
  font-weight:800;
  cursor:pointer;
}
.chip.active{
  background: rgba(124,92,255,.22);
  border-color: rgba(124,92,255,.45);
}

.paperWrap{
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:10px;
}

.paper{
  background: var(--paper);
  color: var(--paperInk);
  border-radius:18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  border:1px solid rgba(0,0,0,.08);
  overflow:hidden;
}

/* Full page sizing */
.fullPaper{
  width: 8.5in;
  min-height: 11in;
}
.paperHeader{
  padding:18px 18px 10px;
  border-bottom:1px solid var(--paperLine);
}
.logoRow{
  display:grid;
  grid-template-columns: 1fr 4fr 1fr;
  gap:12px;
  align-items:center;
}
.logoFrame{
  height:72px;
  border:1px solid var(--paperLine);
  border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  background:#fafbff;
}
.logoFrame img{max-width:100%; max-height:100%}
.centerTitle{text-align:center}
.eyebrow{
  font-size:12px;
  font-weight:900;
  letter-spacing:1.4px;
  color:var(--paperMuted);
}
.titleLine{
  font-size:28px;
  font-weight:950;
  letter-spacing:-.2px;
  margin-top:3px;
}
.vs{color:var(--paperMuted); font-weight:800; padding:0 6px}
.metaLine{
  margin-top:6px;
  font-size:12px;
  color:var(--paperMuted);
  font-weight:700;
}
.metaKey{font-weight:900; color:var(--paperInk)}
.dot{margin:0 6px}
.noteLine{
  margin-top:8px;
  font-size:12px;
  color:var(--paperInk);
  font-weight:750;
  opacity:.92;
}
.paperBody{padding:14px 18px 16px}
.tableTitle{
  font-weight:950;
  letter-spacing:.2px;
  margin:4px 0 10px;
  font-size:14px;
  text-transform:uppercase;
  color:var(--paperInk);
}
.printTbl{
  width:100%;
  border-collapse:collapse;
  font-size:12.5px;
}
.printTbl th, .printTbl td{
  padding:10px 10px;
  border-bottom:1px solid var(--paperLine);
  vertical-align:top;
}
.printTbl th{
  text-transform:uppercase;
  letter-spacing:.6px;
  font-size:11px;
  color:var(--paperMuted);
  font-weight:950;
}
.pTime{width:120px}
.pLoc{width:190px; color:var(--paperMuted)}
.sectionRow td{
  padding:10px 10px;
  background:#f6f7fb;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.7px;
  color:var(--paperInk);
}
.paperFooter{
  display:flex; align-items:center; justify-content:space-between;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--paperLine);
  font-size:11px;
  color:var(--paperMuted);
  font-weight:750;
}
.footerLeft{opacity:.95}
.footerRight{font-weight:900}

/* Notecard sizing (default preview 4x6) */
.cardPaper{
  width: 6in;
  height: 4in;
  border-radius:18px;
}
.cardHeader{padding:12px 12px 8px; border-bottom:1px solid var(--paperLine)}
.cardTop{
  display:grid;
  grid-template-columns: 54px 1fr 54px;
  gap:10px;
  align-items:center;
}
.cardLogo{
  height:48px;
  border:1px solid var(--paperLine);
  border-radius:14px;
  background:#fafbff;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.cardLogo img{max-width:100%; max-height:100%}
.cardTitle{
  font-weight:950;
  letter-spacing:-.2px;
  font-size:16px;
  line-height:1.1;
}
.cardMeta{
  margin-top:4px;
  font-size:10.5px;
  color:var(--paperMuted);
  font-weight:800;
}
.cardNote{
  margin-top:8px;
  font-size:10.5px;
  font-weight:750;
  color:var(--paperInk);
  opacity:.92;
}
.cardBody{padding:10px 12px}
.cardList{
  display:flex;
  flex-direction:column;
  gap:7px;
  font-size:11.5px;
}
.cardItem{
  display:grid;
  grid-template-columns: 78px 1fr;
  gap:8px;
  padding:7px 8px;
  border:1px solid var(--paperLine);
  border-radius:12px;
  background:#ffffff;
}
.cardTime{font-weight:950}
.cardText{color:var(--paperInk); font-weight:750}
.cardSub{color:var(--paperMuted); font-weight:800; font-size:10px; margin-top:2px}
.cardFooter{
  position:absolute;
  bottom:0;
  left:0; right:0;
  padding:8px 12px;
  border-top:1px solid var(--paperLine);
  display:flex; justify-content:space-between; align-items:center;
  font-size:10px;
  color:var(--paperMuted);
  font-weight:900;
}

/* Paper positioning */
.paperWrap{position:relative}
.paperWrap .paper{position:relative}

/* Print rules */
@media print{
  body{background:#fff}
  .no-print{display:none !important}
  .app{display:block; padding:0}
  .paperWrap{padding:0}
  .paper{
    box-shadow:none;
    border:none;
    border-radius:0;
    margin:0;
  }

  /* Full page */
  body.print-full #paperFull{display:block}
  body.print-full #paperCard{display:none !important}
  body.print-full .fullPaper{width:auto; min-height:auto}

  /* Notecard */
  body.print-card #paperCard{display:block}
  body.print-card #paperFull{display:none !important}

  /* Force page size where supported */
  body.print-card{
    /* common: 4x6 notecard */
  }
}

/* Try to set page size in supporting browsers */
@page {
  margin: 0.5in;
}
@page card {
  size: 6in 4in;
  margin: 0.25in;
}
body.print-card{
  /* some browsers map named pages imperfectly; still helps in a few engines */
}

/* Standard app footer (screen) */
.app-footer{
  position:sticky;
  bottom:0;
  z-index:5;
  margin:16px;
  margin-top:0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 14px;
  font-size:11px;
  font-weight:800;
  color: var(--muted);
  border:1px solid rgba(255,255,255,.08);
  background: rgba(18,20,27,.72);
  backdrop-filter: blur(10px);
  border-radius:14px;
}
@media (max-width: 520px){
  .app-footer{flex-direction:column; align-items:flex-start}
}

/* App logo */
.appLogo{
  width:96px;
  height:96px;
  border-radius:18px;
  border:2px solid rgba(255,255,255,.25);
  object-fit:contain;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}

/* Tablet */
@media (max-width: 900px){
  .appLogo{
    width:72px;
    height:72px;
  }
}

/* Phone */
@media (max-width: 520px){
  .appLogo{
    width:56px;
    height:56px;
  }
}
.brand{display:flex; align-items:center; gap:12px}

/* Standard site banner (matches other tools) */
.site-banner{
  min-height:120px;
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  background: rgba(18,20,27,.78);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.sb-left{display:flex; align-items:center; gap:12px}
.sb-site{font-weight:900; letter-spacing:.2px}
.sb-right{text-align:right; display:flex; flex-direction:column; gap:2px}
.sb-app{font-weight:950; letter-spacing:.2px}
.sb-ver{font-size:12px; color: var(--muted); font-weight:800}


/* Fix: prevent horizontal scrolling while typing in schedule inputs */
.app, .app * {
  box-sizing: border-box;
}
.builder, .panel, .list, .items, .rows, .scheduleList, .form, .left, .editor {
  overflow-x: hidden;
}
.row, .itemRow, .schedule-row {
  overflow-x: hidden;
}
.row input, .itemRow input, .schedule-row input, input[type="text"], input[type="time"], textarea{
  min-width: 0;
  max-width: 100%;
}
/* Disable scroll anchoring that can cause jumpy scroll on some browsers */
* { overflow-anchor: none; }



/* Fix v1.0.9: stop schedule table from horizontally auto-scrolling while typing */
html, body{
  overflow-x: hidden;
}
.tableWrap{
  overflow-x: hidden !important;
}
.tbl{
  width: 100%;
  table-layout: fixed;
}
.tbl th, .tbl td{
  overflow: hidden;
}
.tbl input, .tbl textarea{
  width: 100%;
}
/* Slightly more flexible column widths */
.colTime{width:120px;}
.colLoc{width:160px;}
.colCard{width:56px;}
@media (max-width: 700px){
  .colTime{width:100px;}
  .colLoc{width:130px;}
  .colCard{width:52px;}
}

