@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(woff/19cfc7226ec3afaa-s.woff2) format("woff2");
}

@font-face {
  font-family: "Lilita One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(woff/043945717efb3a31-s.p.woff2) format("woff2");
}

:root {
  --bg: #070b12;
  --bg2: #101826;
  --panel: rgba(18, 24, 38, 0.86);
  --panel-2: rgba(12, 18, 30, 0.88);
  --line: rgba(98, 149, 255, 0.18);
  --line-strong: rgba(130, 180, 255, 0.42);
  --text: #f3fbff;
  --muted: #99aac8;
  --primary: #4f8cff;
  --primary2: #62c9ff;
  --ok: #2fd58f;
  --warn: #f7c65a;
  --danger: #ff6a85;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(900px 620px at 0% -20%, rgba(79, 140, 255, 0.22), transparent 55%),
    radial-gradient(720px 480px at 100% 120%, rgba(98, 201, 255, 0.16), transparent 60%),
    linear-gradient(140deg, var(--bg), var(--bg2));
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

.login-wrapper { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-container, .navbar, .content-panel, .modal-content {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.login-container { width: 100%; max-width: 430px; border-radius: 20px; padding: 40px 32px; }

.logo { text-align: center; margin-bottom: 28px; }
.logo h1, .navbar h1, .section-title, .phase-section h3, .modal-header h2, .round-title, .empty-state h3 {
  font-family: "Lilita One", cursive;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.4px;
  color: #e7eeff;
  -webkit-text-fill-color: initial;
  background: none;
}
.logo h1 { font-size: 42px; }
.logo p { margin-top: 8px; color: var(--muted); font-size: 14px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; color: #e1d2fb; }
.form-group input, .form-group select, .form-group textarea, .search-controls input, .search-controls select, .search-box input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(9, 13, 24, 0.72); color: var(--text); font-size: 14px;
}
.form-group input::placeholder, .search-controls input::placeholder, .search-box input::placeholder { color: rgba(201, 183, 234, 0.76); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.search-controls input:focus, .search-controls select:focus, .search-box input:focus {
  outline: none; border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(98, 149, 255, 0.16);
}

.btn, .tab-btn, .btn-search, .btn-edit, .btn-delete, .btn-brackets, .btn-add-phase, .btn-remove-phase, .btn-logout {
  border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-family: Inter, sans-serif; font-weight: 700; transition: all 0.16s ease;
}
.btn { width: 100%; padding: 12px 14px; color: #f6f9ff; background: linear-gradient(135deg, var(--primary), var(--primary2)); box-shadow: 0 8px 20px rgba(79, 140, 255, 0.26); }
.btn:hover, .btn-search:hover, .btn-edit:hover, .btn-delete:hover, .btn-brackets:hover, .btn-add-phase:hover, .btn-remove-phase:hover, .btn-logout:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn-secondary { background: rgba(18, 127, 212, 0.2); border-color: rgba(67, 192, 238, 0.38); }

.error-msg, .message-box { display: none; margin-top: 12px; padding: 11px 13px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.error-msg.visible, .message-box.success, .message-box.error { display: block; }
.error-msg, .message-box.error { color: #ffb4c4; background: rgba(255, 100, 129, 0.12); border: 1px solid rgba(255, 100, 129, 0.36); }
.message-box.success { color: #9df6cb; background: rgba(45, 211, 140, 0.12); border: 1px solid rgba(45, 211, 140, 0.35); }

.main-container { display: none; max-width: 1560px; margin: 0 auto; padding: 24px 16px 32px; }
.main-container.active { display: block; }
.navbar { display: flex; align-items: center; justify-content: space-between; border-radius: 16px; padding: 17px 20px; margin-bottom: 16px; }
.navbar h1 { font-size: 30px; }
.btn-logout { padding: 9px 14px; color: #ffb4c4; background: rgba(255, 100, 129, 0.12); border-color: rgba(255, 100, 129, 0.34); }

.tabs { display: flex; gap: 10px; margin-bottom: 14px; }
.tab-btn { padding: 10px 15px; background: rgba(9, 6, 22, 0.68); border-color: var(--line); color: var(--muted); }
.tab-btn.active { color: #fff; border-color: rgba(130, 180, 255, 0.55); background: linear-gradient(135deg, rgba(79, 140, 255, 0.26), rgba(98, 201, 255, 0.18)); }

.dashboard-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.dashboard-layout > .tabs {
  flex-direction: column;
  position: sticky;
  top: 16px;
  margin-bottom: 0;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.dashboard-layout > .tabs .tab-btn {
  width: 100%;
  text-align: left;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.dashboard-panels {
  min-width: 0;
}

.content-panel { display: none; border-radius: 16px; padding: 26px; min-height: 560px; }
.content-panel.active { display: block; }
.section-title { font-size: 30px; margin-bottom: 20px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-bottom: 12px; }
.prizes-grid .form-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.checkbox-group { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(9, 6, 22, 0.56); }
.checkbox-group input[type="checkbox"] { accent-color: var(--primary); width: 18px; height: 18px; }
.phase-section { margin-top: 14px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(13, 9, 30, 0.62); }
.phase-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.btn-add-phase { margin-top: 12px; width: 100%; padding: 11px; color: #d5f1ff; background: rgba(18, 127, 212, 0.2); border-color: rgba(67, 192, 238, 0.36); }
.btn-remove-phase { padding: 8px 12px; color: #ffb4c4; background: rgba(255, 100, 129, 0.12); border-color: rgba(255, 100, 129, 0.34); }

.search-controls, .search-box { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search-controls input, .search-controls select { flex: 1; min-width: 220px; }
.btn-search { padding: 11px 14px; white-space: nowrap; color: #def5ff; background: rgba(18, 127, 212, 0.22); border-color: rgba(67, 192, 238, 0.36); }

.tournament-list, .user-list { display: flex; flex-direction: column; gap: 11px; }
.tournament-item, .user-item {
  position: relative; display: flex; align-items: center; gap: 12px; border-radius: 13px; padding: 14px;
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--primary);
}
.tournament-item:hover, .user-item:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24); }
.tournament-region-badge { position: absolute; top: 9px; left: 9px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; color: #d8f2ff; background: rgba(18, 127, 212, 0.24); border: 1px solid rgba(67, 192, 238, 0.44); }
.tournament-thumbnail { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.tournament-info, .user-info { flex: 1; min-width: 0; }
.tournament-title, .user-title { font-size: 17px; font-weight: 800; }
.tournament-id, .user-id { margin-top: 4px; font-size: 11px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tournament-meta, .user-stat { margin-top: 6px; font-size: 12px; color: var(--muted); }
.user-meta { display: flex; flex-wrap: wrap; gap: 10px; }

.tournament-stats { display: flex; gap: 12px; }
.tournament-stat { text-align: center; }
.stat-label { font-size: 10px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.stat-value { font-weight: 800; }

.status-badge { padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-open { background: rgba(45, 211, 140, 0.16); color: #98f4c7; border: 1px solid rgba(45, 211, 140, 0.35); }
.status-running { background: rgba(18, 127, 212, 0.2); color: #cfefff; border: 1px solid rgba(67, 192, 238, 0.35); }
.status-closed { background: rgba(246, 196, 87, 0.17); color: #ffe6ac; border: 1px solid rgba(246, 196, 87, 0.35); }
.status-finished { background: rgba(160, 174, 205, 0.18); color: #d5e0f8; border: 1px solid rgba(160, 174, 205, 0.34); }

.tournament-actions, .user-actions { display: flex; gap: 7px; }
.btn-edit, .btn-delete, .btn-brackets { padding: 8px 11px; font-size: 12px; font-weight: 600; }
.btn-edit { color: #d5f1ff; background: rgba(18, 127, 212, 0.16); border-color: rgba(67, 192, 238, 0.35); }
.btn-brackets { color: #ffe7ac; background: rgba(246, 196, 87, 0.16); border-color: rgba(246, 196, 87, 0.35); }
.btn-delete { color: #ffb5c3; background: rgba(255, 100, 129, 0.13); border-color: rgba(255, 100, 129, 0.35); }

.loading, .empty-state { text-align: center; padding: 40px 16px; }
.loading { color: #bee8ff; font-weight: 700; }
.empty-state { color: var(--muted); }

.modal { display: none; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.66); backdrop-filter: blur(8px); }
.modal.active { display: flex; }
.modal-content { width: 100%; max-width: 980px; max-height: 90vh; overflow: auto; border-radius: 16px; padding: 22px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.btn-close { width: 38px; height: 38px; border-radius: 9px; color: #ffb5c3; background: rgba(255, 100, 129, 0.14); border-color: rgba(255, 100, 129, 0.34); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; max-height: 410px; overflow: auto; background: rgba(12, 18, 30, 0.58); border: 1px solid var(--line); border-radius: 11px; padding: 10px; }
.emote-item, .map-item { padding: 9px 7px; text-align: center; border-radius: 8px; border: 1px solid var(--line); background: rgba(16, 10, 34, 0.7); cursor: pointer; font-size: 12px; font-weight: 700; }
.emote-item:hover, .map-item:hover { border-color: var(--line-strong); }
.emote-item.selected, .map-item.selected { background: rgba(18, 127, 212, 0.3); border-color: rgba(67, 192, 238, 0.72); }
#selectedEmotesDisplay { margin-top: 8px; min-height: 36px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: rgba(12, 18, 30, 0.62); font-size: 13px; color: #cdefff; }

.bracket-round { margin-bottom: 18px; padding: 14px; border-radius: 11px; border: 1px solid var(--line); background: rgba(13, 9, 30, 0.6); }
.round-title { font-size: 24px; margin-bottom: 10px; }
.matches-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(370px, 1fr)); gap: 11px; }
.bracket-match { padding: 11px; border-radius: 10px; border: 1px solid var(--line); background: rgba(16, 10, 34, 0.72); }
.match-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.match-number { font-weight: 700; color: var(--muted); }
.match-status { padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.match-status.pending { background: rgba(246, 196, 87, 0.2); color: #ffe7ac; }
.match-status.completed { background: rgba(45, 211, 140, 0.2); color: #9ef4ca; }

.teams-container { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.team { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 9px; border: 1px solid var(--line); background: rgba(9, 6, 22, 0.72); }
.team.winner { background: rgba(45, 211, 140, 0.12); border-color: rgba(45, 211, 140, 0.45); }
.team.loser { background: rgba(255, 100, 129, 0.1); border-color: rgba(255, 100, 129, 0.35); opacity: 0.82; }
.team-id { font-size: 12px; font-weight: 800; color: #efd8ff; margin-bottom: 4px; }
.player { font-size: 12px; color: #f2eaff; }
.team-score { padding: 4px 8px; min-width: 52px; text-align: center; border-radius: 8px; font-size: 12px; font-weight: 800; }
.match-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.btn-assign-win { flex: 1; min-width: 145px; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(67, 192, 238, 0.36); background: rgba(18, 127, 212, 0.22); color: #d7f2ff; font-size: 12px; font-weight: 700; cursor: pointer; }

@media (max-width: 980px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-layout > .tabs {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .dashboard-layout > .tabs .tab-btn {
    width: auto;
    text-align: center;
  }
  .prizes-grid .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matches-container { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .main-container { padding: 12px; }
  .navbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .content-panel { padding: 15px; }
  .section-title { font-size: 26px; }
  .tournament-item, .user-item { flex-direction: column; align-items: flex-start; }
  .tournament-actions, .user-actions { width: 100%; }
  .btn-edit, .btn-delete, .btn-brackets { flex: 1; }
}
