*{box-sizing:border-box;margin:0;padding:0}
body{font-family:sans-serif;background:#f5f5f0;color:#222;min-height:100vh}
.page{display:none}.page.active{display:block}
header{background:#e8570a;color:#fff;padding:1rem 1.5rem;display:flex;align-items:center;gap:1rem}
header h1{font-size:1.3rem;font-weight:500}
.badge{background:rgba(255,255,255,0.2);padding:4px 10px;border-radius:20px;font-size:12px}
.container{max-width:900px;margin:0 auto;padding:1.5rem}
.card{background:#fff;border-radius:12px;border:0.5px solid #ddd;padding:1.25rem;margin-bottom:1rem}
h2{font-size:1.1rem;font-weight:500;margin-bottom:1rem;color:#333}
label{font-size:13px;color:#666;display:block;margin-bottom:4px}
input[type=text],input[type=email],input[type=number],select{width:100%;padding:8px 10px;border:0.5px solid #ccc;border-radius:8px;font-size:14px;margin-bottom:12px;background:#fff;color:#222}
button{padding:8px 18px;border:0.5px solid #ccc;border-radius:8px;background:#fff;cursor:pointer;font-size:14px;color:#333}
button.primary{background:#e8570a;color:#fff;border-color:#e8570a}
button.primary:hover{background:#c94a08}
button.secondary{background:#fff;color:#e8570a;border-color:#e8570a}
button.danger{background:#fcebeb;color:#a32d2d;border-color:#f7c1c1}
.tab-bar{display:flex;gap:4px;margin-bottom:1.2rem;border-bottom:1px solid #eee;overflow-x:auto}
.tab{padding:8px 14px;cursor:pointer;font-size:13px;color:#888;border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap}
.tab.active{color:#e8570a;border-bottom-color:#e8570a;font-weight:500}
.alert{padding:10px 14px;border-radius:8px;font-size:13px;margin-bottom:1rem}
.alert.success{background:#eaf3de;color:#3b6d11;border:0.5px solid #c0dd97}
.alert.error{background:#fcebeb;color:#a32d2d;border:0.5px solid #f7c1c1}
.alert.info{background:#e6f1fb;color:#185fa5;border:0.5px solid #85b7eb}
.hidden{display:none}
.day-block{margin-bottom:1.1rem}
.day-header{font-size:12px;font-weight:500;color:#e8570a;background:#fff5f0;border:0.5px solid #fdd;border-radius:8px;padding:5px 10px;margin-bottom:5px}
.match-row{display:flex;align-items:center;gap:6px;padding:6px 8px;background:#fafaf8;border:0.5px solid #eee;border-radius:8px;margin-bottom:3px;font-size:12px}
.mtime{color:#999;font-size:11px;min-width:58px;flex-shrink:0}
.grp-tag{font-size:10px;font-weight:500;color:#e8570a;background:#fff0eb;border:0.5px solid #fcc;border-radius:10px;padding:2px 7px;white-space:nowrap;flex-shrink:0}
.teams{flex:1;color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.score-wrap{display:flex;align-items:center;gap:4px;flex-shrink:0;margin-left:auto}
.sinp{width:36px;text-align:center;padding:4px 2px;border-radius:6px;border:1px solid #bbb;font-size:13px;font-weight:500;background:#fff;color:#222;margin-bottom:0;-moz-appearance:textfield}
.sinp::-webkit-outer-spin-button,.sinp::-webkit-inner-spin-button{-webkit-appearance:none}
.sinp.missing{border-color:#e24b4a;background:#fcebeb}
.vs{color:#bbb;font-size:11px}
.countries-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:5px;margin-bottom:.75rem}
.country-check{display:flex;align-items:center;gap:6px;font-size:12px;padding:5px 8px;border-radius:6px;cursor:pointer;border:0.5px solid #e5e5e0;background:#f9f9f6}
.country-check:hover{background:#f0f0eb}
.country-check input{margin:0;cursor:pointer}
.country-check.missing{border-color:#e24b4a;background:#fcebeb}
.round-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.5rem}
.prog{font-size:11px;padding:2px 8px;border-radius:10px;background:#f0f0eb;color:#888;font-weight:500}
.prog.ok{background:#eaf3de;color:#3b6d11}
.prog.missing{background:#fcebeb;color:#a32d2d}
.dropdown-grid{display:flex;flex-direction:column;gap:6px;margin-bottom:.5rem}
.dropdown-grid select{margin-bottom:0}
.dropdown-grid select.missing{border-color:#e24b4a;background:#fcebeb}
.deadline-banner{background:#fff3cd;border:0.5px solid #ffc107;border-radius:10px;padding:10px 14px;font-size:13px;color:#856404;margin-bottom:1rem}
.cor-row{display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:0.5px solid #f0f0eb;font-size:13px}
.cor-row:last-child{border-bottom:none}
.cor-inp{width:70px!important;margin-bottom:0!important;text-align:center;padding:4px 6px!important;font-size:13px!important}
.dl-bar{background:#e8570a;border-radius:12px;padding:14px 18px;margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;gap:12px}
.dl-bar span{color:white;font-weight:500;font-size:14px}
.dl-bar button{background:white;color:#e8570a;border:none;padding:8px 18px;border-radius:8px;font-weight:500;cursor:pointer;font-size:14px;flex-shrink:0}
.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;z-index:1000;padding:1rem}
.modal-overlay.hidden{display:none}
.modal{background:#fff;border-radius:12px;padding:1.5rem;max-width:420px;width:100%;box-shadow:0 10px 40px rgba(0,0,0,0.2)}
.modal h3{font-size:1.1rem;margin-bottom:.75rem;color:#a32d2d}
.modal p{font-size:13px;color:#555;line-height:1.5;margin-bottom:1rem}
.modal-actions{display:flex;gap:.5rem;justify-content:flex-end;flex-wrap:wrap}
.data-table{width:100%;border-collapse:collapse;font-size:13px;margin-bottom:.75rem}
.data-table th{text-align:left;padding:6px 8px;color:#888;font-weight:500;border-bottom:1.5px solid #eee}
.data-table td{padding:8px;border-bottom:0.5px solid #f0f0eb}
.data-table tr:last-child td{border-bottom:none}

@media (max-width:600px) {
  .container{padding:1rem}
  header{padding:.85rem 1rem}
  header h1{font-size:1.15rem}
  .card{padding:1rem}
  .match-row{display:grid;grid-template-columns:auto 1fr auto;grid-template-areas:"time grp grp" "teams teams teams" "score score score";gap:5px 8px;padding:8px 10px}
  .match-row .mtime{grid-area:time;min-width:0}
  .match-row .grp-tag{grid-area:grp;justify-self:start}
  .match-row .teams{grid-area:teams;white-space:normal;font-weight:500;font-size:13px;line-height:1.3}
  .match-row .score-wrap{grid-area:score;margin-left:0;justify-self:end}
  .sinp{width:44px;height:36px;font-size:15px}
  .countries-grid{grid-template-columns:repeat(2,1fr)}
  .country-check{font-size:13px;padding:7px 9px}
  .country-check input{width:18px;height:18px}
  .tab{padding:8px 10px;font-size:12px}
  button{padding:9px 16px;font-size:14px;min-height:38px}
  .dl-bar{flex-direction:column;align-items:stretch;text-align:center}
  .dl-bar button{width:100%}
  h2{font-size:1rem}
  table{font-size:12px !important}
  table th,table td{padding:6px 4px !important}
}

@media (max-width:400px) {
  .countries-grid{grid-template-columns:1fr}
}
