﻿/* Base */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background: #f4f7fb;
    color: #0f2f2f;
}
.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}
.site-header {
    background: #0f2f2f;
    color: #fff;
    padding: 16px 0;
}
.brand {
    font-weight: 700;
    letter-spacing: 1px;
}
.nav a {
    color: #e7f3f3;
    margin-left: 16px;
    text-decoration: none;
    font-weight: 600;
}
.site-footer {
    margin-top: 40px;
    padding: 20px 0 40px;
    text-align: center;
    color: #5a6772;
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    align-items: center;
    padding: 40px 0;
}
.hero-card {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 47, 47, 0.12);
}
.cta { margin-top: 16px; }

.card {
    background: #fff;
    padding: 28px;
    border-radius: 16px;
    margin-top: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.form label {
    display: block;
    margin-bottom: 16px;
    font-weight: 600;
}
.form input, .form select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 8px;
    border: 1px solid #1f7a65;
    border-radius: 10px;
    font-size: 14px;
}
select { border: 1px solid #1f7a65; }
select:focus { outline: 2px solid #9bd3c6; border-color: #1f7a65; }
.button {
    display: inline-block;
    padding: 10px 18px;
    background: #1f7a65;
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 700;
}
.button.secondary { background: #e0eceb; color: #1f7a65; }

.notice {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
}
.notice.success { background: #e1f3ed; color: #1a6d55; }
.notice.error { background: #eef2f6; color: #334155; }

.password-box {
    padding: 10px 14px;
    background: #f2f4f7;
    border-radius: 8px;
    font-family: Consolas, monospace;
    display: inline-block;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 28px;
}
.photo-frame {
    width: 320px;
    height: 240px;
    border: 2px dashed #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f4f7fb;
    overflow: hidden;
    margin-bottom: 12px;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.camera-controls video { width: 320px; height: 240px; border-radius: 12px; background: #111; display: block; margin-bottom: 8px; }

.table { width: 100%; border-collapse: collapse; border: 1px solid #c6e3db; border-radius: 10px; overflow: hidden; }
.table th, .table td { padding: 10px; border-bottom: 1px solid #d4ebe4; text-align: left; }
.table th + th, .table td + td { border-left: 1px solid #d4ebe4; }

@media (max-width: 900px) {
    .hero, .profile-grid, .split { grid-template-columns: 1fr; }
    .nav a { display: inline-block; margin: 8px 8px 0 0; }
    .photo-frame, .camera-controls video { width: 100%; height: auto; }
}

.footer-powered { margin-top: 6px; font-size: 12px; letter-spacing: 0.5px; }

.processing-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.35); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.processing-box { background: #ffffff; padding: 16px 22px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); font-weight: 700; }

.admin-links { margin: 12px 0 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-users-table { min-width: 760px; }
.admin-users-table th, .admin-users-table td { white-space: nowrap; font-size: 14px; }

.attendance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.attendance-card { background: #fff; border: 1px solid #e7f3f3; border-radius: 14px; padding: 16px; box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.attendance-card img { width: 100%; height: auto; object-fit: contain; background: #f4f6f8; border-radius: 10px; margin-bottom: 10px; display: block; }
.attendance-actions { display: flex; gap: 6px; margin-top: 8px; }
.attendance-actions button.button { font-size: 16px; }
.status-pill { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-present { background: #d1fae5; color: #065f46; }
.status-absent { background: #fee2e2; color: #991b1b; }
.status-unmarked { background: #fee2e2; color: #991b1b; }

.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }

.skill-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.skill-table th, .skill-table td { border: 1px solid #b7d8cf; padding: 8px 10px; vertical-align: top; }
.skill-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.skill-legend { font-size: 12px; color: #475569; }
.skill-select { width: 90px; padding: 6px 8px; border-radius: 8px; border: 1px solid #9bc9bc; }
.save-status { font-size: 12px; color: #1f7a65; margin-left: 8px; }
.save-status.error { color: #b02a2a; }

.progress-bar { width: 100%; height: 10px; background: #e7f3f3; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; }
.prog-a { background: #f59e0b; }
.prog-g { background: #22c55e; }
.prog-p { background: #16a34a; }
.prog-none { background: transparent; }


.progress-track { position: relative; width: 80%; height: 24px; background: linear-gradient(90deg, #fde68a 0%, #bbf7d0 40%, #86efac 100%); border-radius: 999px; border: 2px solid #cbd5e1; overflow: hidden; }
.progress-car { position: absolute; top: 0px; left: 6px; width: 46px; height: 20px; background: url('assets/car.png') no-repeat center/contain; transition: transform 0.3s ease; }
.car-pos-a { transform: translateX(1%); }
.car-pos-g { transform: translateX(40%); }
.car-pos-p { transform: translateX(90%); }
.car-pos-none { transform: translateX(0%); opacity: 0.4; }


.progress-flag { position: absolute; right: 10px; top: 5px; width: 12px; height: 8px; background: conic-gradient(#111827 0 90deg, #f4f7fb 90deg 180deg, #111827 180deg 270deg, #f4f7fb 270deg 360deg); background-size: 6px 4px; border-radius: 2px; }




.skills-scroll { overflow-x: auto; }
.skills-scroll table { min-width: 900px; }

@media (max-width: 700px) {
  .progress-track { width: 70%; }
}

.skill-table { border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid #c6e3db; border-radius: 12px; overflow: hidden; }
.skill-table thead th { background: #dff1eb; color: #0f2f2f; font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.skill-table tbody tr:nth-child(even) { background: #f2fbf8; }
.skill-table tbody tr:hover { background: #e5f6f0; }
.skill-table td, .skill-table th { padding: 10px 12px; border-bottom: 1px solid #d4ebe4; }
.skill-table tbody tr:last-child td { border-bottom: none; }

.site-header { position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.brand { font-size: 18px; }
.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); transition: all 0.2s ease; }
.nav a:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); }
.nav .active { background: #ffffff; color: #0f2f2f; border-color: #ffffff; }
@media (max-width: 700px) { .nav { gap: 6px; } .nav a { padding: 6px 10px; font-size: 13px; } }
@media (max-width: 700px) {
  .admin-users-table { min-width: 680px; }
  .admin-users-table th, .admin-users-table td { padding: 8px 6px; font-size: 13px; }
}

.terms { padding: 10px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.terms label { display: flex; align-items: flex-start; gap: 6px; font-weight: 500; margin-bottom: 10px; justify-content: flex-start; }
.terms input { margin-right: 8px; }

.terms span { line-height: 1.4; }

.terms input[type="checkbox"] { margin-top: 3px; width: 14px; height: 14px; }
.terms span { display: block; }

.button:disabled { background: #cbd5e1; color: #64748b; cursor: not-allowed; }



input[readonly], textarea[readonly], select[disabled], input[disabled] {
  background: #cbd5e1;
  color: #475569;
  border: 1px dashed #64748b;
  box-shadow: inset 0 0 0 1px #cbd5e1;
  cursor: not-allowed;
}
input[readonly]::placeholder, textarea[readonly]::placeholder {
  color: #64748b;
}

.table.compact th, .table.compact td { padding: 6px 8px; font-size: 12px; border-color: #d4ebe4; }
.table.compact th { font-weight: 700; }
.table.compact img.thumb { width: 36px; height: 36px; }







.attendance-card.all-players-card { border: 2px solid #1f7a65; box-shadow: 0 8px 18px rgba(31,122,101,0.15); }
.attendance-card.themed-child-card { border: 2px solid #1f7a65; box-shadow: 0 8px 18px rgba(31,122,101,0.15); }
.card.themed-parent-card { border: 2px solid #0f4c81; box-shadow: 0 8px 18px rgba(15,76,129,0.14); background: #f4f9ff; }

.live-scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.live-team { border: none; border-radius: 12px; padding: 14px; background: #f8fffc; box-shadow: 0 8px 18px rgba(15,47,47,0.12); }
.live-team h3 { margin: 0 0 8px; font-size: 18px; }
.live-team-name { font-weight: 700; margin-bottom: 8px; min-height: 40px; }
.live-score-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.live-score { font-size: 144px; line-height: 1; font-weight: 800; margin: 10px 0 14px; color: #0f2f2f; }
.live-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.live-btn-plus, .live-btn-minus { min-width: 130px; min-height: 52px; font-size: 24px; }
.live-bottom-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.live-page h2 { margin-bottom: 8px; }
.live-page .notice { margin-bottom: 8px; }
.live-page .live-scoreboard { margin-top: 6px; }
.live-page .live-bottom-actions { margin-top: 10px; }
.live-page { padding-top: 18px; padding-bottom: 18px; }
.live-page .live-scoreboard { gap: 10px; margin-top: 4px; }
.live-page .live-team { padding: 10px 12px; }
.live-page .live-team h3 { margin: 0 0 4px; font-size: 16px; }
.live-page .live-team-name { margin-bottom: 4px; min-height: 28px; line-height: 1.2; }
.live-page .live-team-name.recent-plus { color: #b91c1c; }
.live-page .live-team { position: relative; }
.live-page .live-recent-star {
  display: none;
  position: absolute;
  top: 6px;
  right: 10px;
  color: #ef4444;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
}
.live-page .live-team.has-recent-plus .live-recent-star { display: inline-block; }
.live-page .live-score-row { gap: 10px; }
.live-page .live-score { margin: 0; font-size: 128px; line-height: 0.9; }
.live-page .live-actions { gap: 6px; }
.live-page .live-btn-plus, .live-page .live-btn-minus { min-height: 42px; }
.live-page .live-bottom-actions { margin-top: 72px; gap: 8px; }
.live-page .live-team.live-team-green {
  background: #12372e;
  border: 2px solid #1f7a65;
  color: #ecfdf5;
}
.live-page .live-team.live-team-blue {
  background: #102347;
  border: 2px solid #1f4f8f;
  color: #ecf4ff;
}
.live-page .live-team.live-team-green h3 { color: #d1fae5; }
.live-page .live-team.live-team-blue h3 { color: #dbeafe; }
.live-page .live-team.live-team-green .live-team-name,
.live-page .live-team.live-team-blue .live-team-name { color: inherit; }
.live-page .live-team.live-team-green .live-score,
.live-page .live-team.live-team-blue .live-score { color: #ffffff; }
@media (max-width: 900px) {
  .live-scoreboard { grid-template-columns: 1fr; }
  .live-score-row { align-items: flex-start; }
  .live-score { font-size: 58px; }
  .live-page .live-score { font-size: 52px; }
}

.fixture-history-table { width: 100%; min-width: 1080px; table-layout: auto; }
.fixture-history-table th, .fixture-history-table td { white-space: nowrap; word-break: normal; }
.fixture-actions-cell { min-width: 360px; }
.fixture-actions-wrap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) {
  .fixture-history-table { min-width: 1160px; table-layout: auto; }
  .fixture-history-table th, .fixture-history-table td { font-size: 12px; }
}

.player-history-table { width: 100%; min-width: 1080px; table-layout: auto; }
.player-history-table th, .player-history-table td { white-space: nowrap; word-break: normal; }
.player-history-table a { white-space: nowrap; display: inline-block; }
@media (max-width: 900px) {
  .player-history-table { min-width: 1220px; }
  .player-history-table th, .player-history-table td { font-size: 12px; }
}


/* Pro theme overrides */
:root {
  --bg: #f3f7fb;
  --panel: #ffffff;
  --ink: #0a1f33;
  --muted: #5b6b7f;
  --brand: #0f6b4d;
  --brand-2: #0d4f8b;
  --line: #cfe0ef;
  --stage-font: "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
body {
  font-family: "Verdana", "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(1000px 300px at 0% 0%, #e3f2ea 0%, transparent 60%),
    radial-gradient(900px 280px at 100% 0%, #e2edf9 0%, transparent 62%),
    var(--bg);
  color: var(--ink);
}
.site-header {
  background: linear-gradient(90deg, #0f6b4d 0%, #0d4f8b 100%);
}
.brand { font-size: 20px; letter-spacing: 0.6px; }
.card, .hero-card {
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(10, 31, 51, 0.08);
}
.button {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  border: 1px solid rgba(255,255,255,0.12);
}
.button.secondary {
  background: #e8f0f7;
  color: #0b365a;
  border: 1px solid #c7d9ea;
}
.form input, .form select, .form textarea {
  border: 1px solid #99b7d3;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid #bad6ef;
  border-color: #2e6ea8;
}
.table { border: 1px solid #bfd6ea; }
.table th, .table td { border-bottom: 1px solid #d4e5f4; }
.table th + th, .table td + td { border-left: 1px solid #d4e5f4; }
.site-footer { color: var(--muted); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.metric-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, #ffffff 0%, #eef6ff 100%);
  padding: 12px 14px;
}
.metric-label {
  font-size: 12px;
  color: #36516e;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 700;
}
.metric-value {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  color: #123f68;
}
.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tournament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.tournament-card {
  border: 1px solid #bfd6ea;
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #eff7ff 100%);
  padding: 14px;
}
.tournament-title {
  margin: 0;
  font-size: 19px;
  color: #0f3458;
}
.tournament-meta {
  margin-top: 8px;
  color: #36516e;
  font-size: 13px;
}
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}
.pill-draft { background: #e2e8f0; color: #334155; }
.pill-active { background: #dcfce7; color: #166534; }
.pill-completed { background: #dbeafe; color: #1d4ed8; }
.pill-cancelled { background: #fee2e2; color: #b91c1c; }
.form textarea {
  width: 100%;
  padding: 10px 12px;
  margin-top: 8px;
  border: 1px solid #1f7a65;
  border-radius: 10px;
  min-height: 100px;
  font-family: inherit;
  resize: vertical;
}

.stage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 12px;
}
.stage-panel {
  border: 1px solid #a7b6c8;
  border-radius: 10px;
  background: #f1f2f4;
  padding: 14px;
  font-family: var(--stage-font);
}
.stage-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #20324a;
  font-family: var(--stage-font);
}
.stage-table-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
  font-family: var(--stage-font);
}
.stage-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-family: var(--stage-font);
}
.stage-table th,
.stage-table td {
  border: 1px solid #8da2bc;
  padding: 8px 10px;
  font-size: 13px;
  background: #dde8f5;
}
.stage-table th {
  background: #c8d6e8;
  color: #12263f;
  font-weight: 700;
}
.stage-table td input,
.stage-table td select {
  width: 100%;
  font-size: 13px;
  padding: 7px 9px;
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid #7b99bc;
  margin: 0;
}
.stage-table th.player-col,
.stage-table td.player-col {
  min-width: 220px;
}
.stage-table th.set-col {
  width: 108px;
  min-width: 108px;
  max-width: 108px;
}
.stage-table td.set-col {
  width: 84px;
  min-width: 84px;
  max-width: 84px;
  text-align: center;
}
.stage-table td.set-col input,
.stage-table td.set-col select {
  width: 78px;
  min-width: 78px;
  max-width: 78px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
.stage-table td input[type="number"] {
  background: #a5d86a;
}
.stage-panel.readonly .stage-table td {
  background: #d9e6f6;
}
.stage-table tr.editing-row td {
  background: #fff7cc !important;
  box-shadow: inset 0 0 0 1px #f2c94c;
}
.stage-panel.readonly .stage-table td.set-col {
  background: #9ed35d;
  font-weight: 700;
}
.stage-result-panel {
  margin-top: 16px;
  border: 1px solid #8da2bc;
  border-radius: 10px;
  background: #f1f2f4;
  padding: 10px;
  font-family: var(--stage-font);
}
.stage-result-panel h3 {
  margin: 0 0 8px;
  color: #20324a;
}
.stage-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.podium-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  border: 1px solid #8da2bc;
  margin-top: 8px;
}
.podium-row span {
  display: flex;
  align-items: center;
  padding: 8px;
  background: #d2d8e2;
  font-weight: 700;
  font-size: 13px;
}
.podium-row strong {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  font-size: 14px;
}
.podium-first strong { background: #ff4a4a; color: #fff; }
.podium-second strong { background: #e8c8a8; color: #1f2937; }
.podium-third strong { background: #fff526; color: #1f2937; }
@media (max-width: 1200px) {
  .stage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .stage-result-grid { grid-template-columns: 1fr; }
  .stage-table { min-width: 700px; }
  .stage-table th, .stage-table td { padding: 7px 8px; font-size: 12px; }
  .stage-table td input, .stage-table td select { min-height: 34px; font-size: 12px; }
}

.world-meta-band {
  margin-top: 10px;
  border: 1px solid #a18443;
  background: linear-gradient(90deg, #0f223a 0%, #1b3455 70%, #7f6830 100%);
  color: #f8f3e7;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--stage-font);
}
.world-meta-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.world-meta-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #eadcbf;
}
.stage-panel-world {
  border-color: #8f7640;
  background: linear-gradient(180deg, #f9f7f1 0%, #f2ede0 100%);
}
.stage-panel-world h3 {
  color: #2a3b55;
}
.doubles-world-table th {
  background: #1b2f4a;
  color: #f9efd8;
  border-color: #4f6480;
  text-transform: uppercase;
  font-size: 12px;
}
.doubles-world-table td {
  border-color: #9fb0c6;
  background: #ffffff;
}
.doubles-world-table {
  min-width: 1500px;
}
.doubles-world-table th.player-col,
.doubles-world-table td.player-col {
  min-width: 180px;
}
.doubles-world-table th.set-col {
  width: 102px;
  min-width: 102px;
  max-width: 102px;
}
.doubles-world-table td.set-col {
  width: 78px;
  min-width: 78px;
  max-width: 78px;
}
.doubles-world-table th,
.doubles-world-table td {
  padding: 9px 10px;
}
.doubles-world-table td select,
.doubles-world-table td input {
  min-height: 40px;
  font-size: 13px;
}
.doubles-world-table td input[type="number"] {
  background: #b5df78;
  border-color: #7ea544;
  font-weight: 700;
}
.doubles-world-table td.player-col {
  font-weight: 700;
}
.doubles-world-table.readonly td.set-col {
  background: #a4d768;
  font-weight: 800;
}
.doubles-world-table tr.winner-team-a td.team-a-cell,
.doubles-world-table tr.winner-team-b td.team-b-cell {
  background: #ffffff;
}
.doubles-world-table tr.winner-team-a td.team-a-cell select,
.doubles-world-table tr.winner-team-b td.team-b-cell select {
  background: #dff6df;
  border-color: #7cc47c;
}
.doubles-world-table tr.winner-team-a td.team-b-cell select,
.doubles-world-table tr.winner-team-b td.team-a-cell select {
  background: #fde2e2;
  border-color: #e29a9a;
}
