* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #07080c; color: #fff; }
button, input { font: inherit; }
button { cursor: pointer; border: 0; border-radius: 14px; padding: 14px 16px; background: linear-gradient(180deg, #242a3a, #111725); color: #fff; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 8px 20px rgba(0,0,0,.25); }
button:hover { filter: brightness(1.15); }
button span { display: block; color: #f7b733; font-size: 12px; margin-top: 3px; }
input { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.15); background: #101522; color: #fff; font-weight: 900; text-align: center; text-transform: uppercase; }
.control-body { min-height: 100vh; padding: 18px; background: radial-gradient(circle at top, #182038, #07080c 58%); }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
h1 { margin: 0; font-size: 28px; letter-spacing: .5px; }
p { margin: 6px 0 0; color: #aab2c5; }
.display-link { color: #06101f; background: #f7b733; padding: 14px 18px; border-radius: 14px; text-decoration: none; font-weight: 900; }
.control-layout { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 18px; }
.team-card, .center-card { background: rgba(14, 18, 31, .92); border: 1px solid rgba(255,255,255,.1); border-radius: 24px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.team-card label { display: block; color: #f7b733; font-weight: 900; margin-bottom: 8px; letter-spacing: 1px; }
.control-score { font-size: clamp(70px, 11vw, 130px); line-height: 1; font-weight: 1000; text-align: center; margin: 18px 0; text-shadow: 0 0 24px rgba(255,255,255,.15); }
.button-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.button-grid.two { grid-template-columns: repeat(2, 1fr); }
.mini-row, .timer-controls, .quarter-row, .utility-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.quarter-row { grid-template-columns: repeat(5, 1fr); }
.utility-row { grid-template-columns: repeat(3, 1fr); }
.danger { background: linear-gradient(180deg, #802121, #3a1111); }
.primary-button { width: 100%; background: linear-gradient(180deg, #f7b733, #c37a12); color: #080b12; font-size: 18px; }
.logos-row { display: flex; justify-content: center; gap: 24px; align-items: center; min-height: 76px; }
.logos-row img { max-width: 130px; max-height: 64px; object-fit: contain; }
.clock-box, .shot-box { margin-top: 18px; text-align: center; padding: 18px; border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.08); }
.label { color: #aab2c5; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.game-clock { font-size: clamp(58px, 10vw, 108px); font-weight: 1000; line-height: 1; margin: 10px 0 16px; }
.shot-clock { display: inline-flex; align-items: center; justify-content: center; width: 150px; height: 110px; border-radius: 20px; color: #ff4b22; background: #08090d; border: 3px solid #ff4b22; font-size: 72px; font-weight: 1000; margin: 12px 0; box-shadow: 0 0 36px rgba(255,75,34,.25); }
.toast { margin-top: 14px; padding: 12px; border-radius: 12px; background: rgba(247,183,51,.12); color: #f7b733; font-weight: 900; text-align: center; min-height: 44px; }
.shortcut-help { margin-top: 16px; color: #aab2c5; text-align: center; font-size: 14px; }
.display-body { height: 100vh; overflow: hidden; background: radial-gradient(circle at top, #222a3d, #050609 60%); }
.tv-scoreboard { height: 100vh; padding: 3vh 4vw; display: flex; flex-direction: column; justify-content: center; }
.tv-logos { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; margin-bottom: 4vh; }
.tv-logos img { max-width: 190px; max-height: 96px; object-fit: contain; }
.tv-logos img:last-child { justify-self: end; }
.event-title { color: #f7b733; font-weight: 1000; letter-spacing: 3px; font-size: clamp(18px, 2.5vw, 42px); text-align: center; }
.score-row { display: grid; grid-template-columns: 1fr .72fr 1fr; gap: 3vw; align-items: stretch; }
.tv-team, .tv-center { border-radius: 34px; background: linear-gradient(180deg, rgba(20,26,44,.96), rgba(9,12,20,.96)); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 20px 80px rgba(0,0,0,.45); padding: 3vh 2vw; text-align: center; position: relative; }
.tv-team-name { color: #f7b733; font-weight: 1000; font-size: clamp(34px, 5vw, 88px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-score { font-size: clamp(110px, 17vw, 280px); line-height: .9; font-weight: 1000; letter-spacing: -8px; }
.tv-meta { color: #d5d9e6; font-size: clamp(18px, 2vw, 36px); font-weight: 900; }
.tv-center { display: flex; flex-direction: column; justify-content: center; }
.tv-quarter { color: #f7b733; font-size: clamp(32px, 4vw, 72px); font-weight: 1000; }
.tv-game-clock { font-size: clamp(76px, 10vw, 170px); line-height: 1; font-weight: 1000; margin: 2vh 0; }
.tv-shot-label { color: #aab2c5; letter-spacing: 3px; font-weight: 900; font-size: clamp(16px, 1.6vw, 28px); }
.tv-shot-clock { color: #ff4b22; font-size: clamp(82px, 10vw, 180px); line-height: 1; font-weight: 1000; text-shadow: 0 0 35px rgba(255,75,34,.45); }
.poss-indicator { position: absolute; top: 18px; right: 24px; color: transparent; font-size: 28px; text-shadow: none; }
.poss-indicator.active { color: #f7b733; text-shadow: 0 0 18px rgba(247,183,51,.7); }
@media (max-width: 980px) { .control-layout { grid-template-columns: 1fr; } .top-bar { flex-direction: column; align-items: stretch; } .display-link { text-align: center; } .score-row { grid-template-columns: 1fr; } .display-body { overflow: auto; } .tv-scoreboard { height: auto; min-height: 100vh; } }

/* v1.1 compact operator mode + settings */
.compact-page { padding: 12px; overflow-x: hidden; }
.compact-top { margin-bottom: 10px; }
.compact-top h1 { font-size: 24px; }
.compact-top p { font-size: 14px; margin-top: 3px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.secondary-link { background: #263047; color: #fff; }
.compact-layout { grid-template-columns: .86fr 1.08fr .86fr; gap: 12px; align-items: start; }
.compact-card { border-radius: 18px; padding: 12px; }
.team-header { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: #f7b733; font-weight: 1000; letter-spacing: .8px; min-height: 28px; }
.team-header strong { color: #fff; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-score { font-size: clamp(62px, 8vw, 112px); margin: 8px 0 12px; }
.compact-buttons { gap: 8px; }
.compact-buttons button, .compact-row button, .compact-four button, .compact-quarter button, .compact-utility button, .shot-actions button { padding: 10px 11px; border-radius: 11px; font-size: 15px; min-height: 50px; }
.compact-buttons button { min-height: 58px; }
button span { font-size: 11px; margin-top: 1px; }
.mini-stats { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; color: #d6dbe8; font-size: 14px; font-weight: 800; }
.compact-row { gap: 8px; margin-top: 8px; }
.center-compact { padding: 10px; }
.compact-logos { min-height: 48px; gap: 12px; display: grid; grid-template-columns: 80px 1fr 80px; }
.compact-logos img { max-width: 80px; max-height: 42px; }
.small-event-title { text-align: center; color: #f7b733; font-size: 13px; font-weight: 1000; letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-box { margin-top: 8px; padding: 10px; border-radius: 16px; }
.compact-clock { font-size: clamp(54px, 7vw, 90px); margin: 4px 0 8px; }
.compact-primary { padding: 10px; border-radius: 12px; min-height: 48px; }
.shot-row-panel { display: grid; grid-template-columns: .8fr 1.2fr; gap: 8px; align-items: stretch; }
.shot-compact-box { display: flex; flex-direction: column; justify-content: center; align-items: center; }
.compact-shot { width: 110px; height: 76px; border-radius: 15px; font-size: 52px; margin: 6px 0 0; }
.shot-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.compact-four { grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.compact-quarter { gap: 8px; margin-top: 8px; }
.compact-utility { gap: 8px; margin-top: 8px; }
.compact-toast { margin-top: 8px; padding: 8px; min-height: 34px; font-size: 14px; }
.compact-help { margin-top: 8px; font-size: 12px; }

.settings-panel { max-width: 1120px; margin: 0 auto; display: grid; gap: 14px; }
.settings-card { background: rgba(14,18,31,.94); border: 1px solid rgba(255,255,255,.1); border-radius: 20px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.settings-card h2 { margin: 0 0 14px; color: #f7b733; letter-spacing: 1px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.settings-grid label { color: #d5d9e6; font-weight: 900; display: grid; gap: 8px; }
.settings-grid input[type="file"] { text-align: left; text-transform: none; }
.settings-grid input[type="color"] { height: 52px; padding: 6px; cursor: pointer; }
.settings-grid small { color: #aab2c5; font-weight: 600; }
.settings-note { font-size: 13px; }
.settings-actions { display: flex; gap: 12px; align-items: center; }

@media (max-height: 760px) and (min-width: 981px) {
  .compact-page { padding: 8px 12px; }
  .compact-top h1 { font-size: 21px; }
  .compact-top p, .compact-help { display: none; }
  .compact-card { padding: 10px; }
  .compact-buttons button, .compact-row button, .compact-four button, .compact-quarter button, .compact-utility button, .shot-actions button { padding: 7px 9px; min-height: 42px; font-size: 14px; }
  .compact-buttons button { min-height: 50px; }
  .compact-score { font-size: clamp(54px, 7vw, 94px); margin: 5px 0 8px; }
  .compact-clock { font-size: clamp(48px, 6.5vw, 76px); }
  .compact-shot { width: 96px; height: 66px; font-size: 46px; }
  .compact-box { padding: 8px; }
  .toast { display: none; }
}

@media (max-width: 980px) {
  .compact-layout { grid-template-columns: 1fr; }
  .top-actions, .settings-actions { flex-direction: column; align-items: stretch; }
  .settings-grid { grid-template-columns: 1fr; }
}
