:root {
  --navy: #0b1f3a;
  --emerald: #047857;
  --slate: #334155;
  --line: #e2e8f0;
  --bg: #f8fafc;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--slate);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--navy); }
header.top {
  background: var(--navy);
  color: white;
  padding: 0.9rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}
header.top a { color: white; text-decoration: none; font-weight: 700; }
nav a { margin-inline-end: 0.8rem; font-weight: 600; }
main { width: min(1040px, calc(100% - 2rem)); margin: 1.5rem auto 3rem; }
h1, h2 { color: var(--navy); line-height: 1.15; }
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-block-end: 1rem;
}
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
label { display: grid; gap: 0.3rem; min-width: 0; font-weight: 700; color: var(--navy); font-size: 0.9rem; }
input, select, textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.sheet, .modal { overflow-x: hidden; }
.sheet input, .sheet select, .sheet textarea,
.modal input, .modal select, .modal textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.hint { margin: 0.15rem 0 0; color: #64748b; font-size: 0.8rem; font-weight: 600; }
.opponent-goal { margin: 0.35rem 0; padding: 0.45rem 0.7rem; border-radius: 10px; border-inline-start: 4px solid #c2410c; background: #fff7ed; color: #7c2d12; font-weight: 700; }
.badge-opponent { background: #ffedd5; color: #9a3412; border-radius: 999px; padding: 0.1rem 0.45rem; font-size: 0.75rem; font-weight: 800; }
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--emerald);
  color: white;
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
  cursor: pointer;
}
.btn.navy { background: var(--navy); }
.btn.ghost { background: white; color: var(--navy); border: 1px solid #cbd5e1; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.badge { background: #d1fae5; color: #065f46; border-radius: 999px; padding: 0.1rem 0.5rem; font-size: 0.75rem; font-weight: 800; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: start; padding: 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; }
.avatar, .banner { object-fit: cover; background: #e2e8f0; }
.avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; }
.banner { width: 100%; height: 9rem; border-radius: 12px; }
.error { color: #991b1b; }
.note { background: #0b1f3a; color: #e2e8f0; border-radius: 12px; padding: 1rem; }
.bell { position: relative; display: inline-block; }
.bell-button {
  list-style: none;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 8px;
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,.35);
}
.bell-button::-webkit-details-marker { display: none; }
.bell-icon { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bell-count {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #b91c1c;
  color: white;
  font-size: 0.65rem;
  line-height: 1.1rem;
  font-weight: 800;
}
.bell-panel {
  position: absolute;
  z-index: 20;
  right: 0;
  top: calc(100% + 0.4rem);
  width: min(22rem, 80vw);
  max-height: 70vh;
  overflow: auto;
  padding: 0.75rem;
  background: white;
  color: var(--slate);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: start;
}
.langs { display: flex; gap: 0.35rem; }
.profile-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1rem; align-items: start; }
.profile-side { display: grid; gap: 0.35rem; }
.profile-side a { display: block; padding: 0.45rem 0.7rem; border-radius: 10px; background: white; border: 1px solid #e2e8f0; font-weight: 800; text-decoration: none; }
@media (max-width: 800px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-side { display: flex; overflow-x: auto; }
  .profile-side a { flex: none; }
}
.app-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
.app-tabs a, .app-tabs button {
  border: 1px solid #cbd5e1;
  background: white;
  color: var(--navy);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.app-tabs a.is-active, .app-tabs button.is-active, .app-tabs a[aria-current="page"] {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
[hidden] { display: none !important; }
.langs button { background: transparent; color: white; border: 1px solid rgba(255,255,255,.35); padding: 0.2rem 0.45rem; }
@media (max-width: 700px) {
  header.top { align-items: flex-start; }
  nav { display: flex; flex-wrap: wrap; gap: 0.4rem; }
}
.match-timer {
  background: #0b1f3a;
  color: #ffffff;
}
.match-timer .timer-readout { font-size: 3rem; font-weight: 800; margin: 0; }
.match-timer h3,
.match-timer .fine,
.match-timer .nameplate,
.match-timer .field,
.match-timer .timer-label,
.match-timer .timer-readout { color: #ffffff; }
.match-timer label { color: #ffffff; }
.match-timer input,
.match-timer select {
  background: #ffffff;
  color: #0b1f3a;
}
.match-timer .btn,
.match-timer .btn.ghost,
.match-timer .btn.navy,
.match-timer .btn:hover,
.match-timer .btn:active {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}
.match-timer .btn:hover,
.match-timer .btn:active {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.6);
}
.match-timer .btn-primary,
.match-timer .btn-primary:hover,
.match-timer .btn-primary:active {
  color: #ffffff;
  background: #047857;
  border-color: #065f46;
}
.match-timer .btn-primary:hover,
.match-timer .btn-primary:active { background: #065f46; }
.match-timer .btn-alert,
.match-timer .btn-alert:hover,
.match-timer .btn-alert:active {
  color: #ffffff;
  background: rgba(180, 83, 9, 0.45);
  border: 1px solid rgba(253, 186, 116, 0.95);
}
.match-timer .btn-alert:hover,
.match-timer .btn-alert:active {
  background: rgba(153, 27, 27, 0.72);
  border-color: #fecaca;
}
.access-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(7, 20, 34, 0.55);
}
.access-modal {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: 90dvh;
  background: white;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}
.access-modal-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 90dvh;
}
.access-modal-head,
.access-modal-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: white;
}
.access-modal-head { padding: 1rem 1rem 0.75rem; border-bottom: 1px solid var(--line); }
.access-modal-head h2 { margin: 0; font-size: 1.15rem; }
.access-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}
.access-modal-foot {
  justify-content: flex-end;
  padding: 0.75rem 1rem calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.access-modal fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0; padding: 0.75rem; min-inline-size: 0; }
.scope-box { margin: 0; padding: 0.85rem 1rem; border-radius: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #064e3b; font-weight: 700; }
.check-row { display: flex; align-items: flex-start; gap: 0.55rem; font-weight: 700; }
.check-row input { width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; flex: none; }
.scope-table { min-width: 0; }
@media (min-width: 720px) {
  .access-backdrop { align-items: center; padding: 1.25rem; }
  .access-modal { border-radius: 18px; }
}
@media (max-width: 720px) {
  .scope-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .scope-table, .scope-table tbody, .scope-table tr, .scope-table td { display: block; width: 100%; }
  .scope-table td::before { content: attr(data-label); display: block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; }
}
