/* Thanamcherla Cricket Tournament Portal — mobile-first styles */
:root {
  --green-900: #063b25;
  --green-800: #0b5d3b;
  --green-700: #117a4d;
  --green-100: #e3f2ea;
  --red: #c8102e;
  --gold: #f2b705;
  --gold-600: #d99e00;
  --ink: #16241d;
  --muted: #5e6e66;
  --line: #dbe3de;
  --bg: #f6f8f5;
  --card: #ffffff;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --warn-bg: #fff6db;
  --info-bg: #e8f1fb;
  --success-bg: #e3f2ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(6, 59, 37, 0.06), 0 6px 20px rgba(6, 59, 37, 0.06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Poppins', var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--green-700); }
a:hover { color: var(--green-900); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 0.5em; color: var(--green-900); }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--ink); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.wrap { white-space: normal; word-break: break-word; min-width: 200px; }
.prose { white-space: pre-line; }
.lead { font-size: 1.1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 600; color: var(--green-700); margin-bottom: 0.4em; }
.plain-list { list-style: none; padding: 0; margin: 0 0 1em; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }

/* Layout */
.main { flex: 1; width: 100%; padding: 16px 0 40px; }
.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 560px; }
.container.wide { max-width: 1280px; }
.grid-2, .grid-3 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Header */
.topbar { background: var(--green-800); color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 10px 16px; gap: 8px; position: sticky; top: 0; z-index: 20; }
.topbar-admin { background: var(--green-900); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 600; min-width: 0; }
.brand:hover { color: #fff; }
.brand-mark { font-size: 1.5rem; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #fff; }
.brand-name { font-size: 1rem; line-height: 1.2; }
.nav { display: none; width: 100%; flex-direction: column; gap: 2px; padding: 8px 0; }
.nav.is-open { display: flex; }
.nav a, .nav .linklike { color: #fff; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; text-align: left; }
.nav a:hover, .nav .linklike:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.18); box-shadow: inset 0 -3px 0 var(--gold); }
.nav-public { display: flex; width: auto; flex-direction: row; padding: 0; }
.nav-toggle { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }
.inline-form { display: inline; margin: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--green-700); cursor: pointer; text-decoration: underline; }
.nav .linklike { text-decoration: none; width: 100%; }
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav { display: flex; flex-direction: row; width: auto; padding: 0; flex-wrap: wrap; }
  .nav a, .nav .linklike { padding: 8px 10px; }
  .nav .linklike { width: auto; }
}
@media (min-width: 900px) and (max-width: 1180px) { .admin-nav a, .admin-nav .linklike { font-size: 0.88rem; padding: 6px 8px; } }
.test-mode-banner { background: var(--danger); color: #fff; text-align: center; font-weight: 600; font-size: 0.9rem; padding: 8px 16px; }
.demo-banner { background: #7a3cc8; }
.demo-numbers { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.demo-numbers code { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.preview-banner { background: var(--gold); color: var(--ink); text-align: center; font-size: 0.9rem; padding: 6px 16px; }

.footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 20px 16px 28px; border-top: 1px solid var(--line); background: #fff; }
.footer p { margin: 0.2em 0; }

/* Hero / landing */
.main > .hero:first-child { margin-top: -16px; }
.topbar-public { flex-wrap: nowrap; }
.topbar-public .nav-public a { white-space: nowrap; }
.hero { position: relative; min-height: 78vh; display: grid; place-items: center; text-align: center; color: #fff; overflow: hidden;
  background: radial-gradient(ellipse at 30% 10%, rgba(242, 183, 5, 0.25), transparent 55%), linear-gradient(160deg, var(--green-700), var(--green-900) 70%); }
.hero::after { content: ''; position: absolute; inset: auto -10% -60px -10%; height: 140px; background: var(--bg); border-radius: 50% 50% 0 0; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 59, 37, 0.35) 0%, rgba(6, 59, 37, 0.55) 45%, rgba(6, 59, 37, 0.85) 100%); }
.hero:not(.hero-photo) .hero-overlay { display: none; }
.hero-content { position: relative; z-index: 1; padding: 48px 16px 110px; max-width: 760px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 7vw, 3.6rem); margin-bottom: 0.25em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); }
.hero .eyebrow { color: var(--gold); }
.hero-tagline { font-size: clamp(1rem, 2.5vw, 1.25rem); opacity: 0.92; }
.hero-logo { width: 96px; height: 96px; object-fit: contain; margin: 0 auto 16px; border-radius: 20px; background: #fff; padding: 6px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 24px 0 12px; }
.hero-note { font-size: 0.9rem; opacity: 0.85; }
.steps { margin-top: 8px; }
.steps h2 { text-align: center; }
.step-list { list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .step-list { grid-template-columns: repeat(3, 1fr); } }
.step-list li { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; gap: 14px; }
.step-list p { margin: 0.3em 0 0; color: var(--muted); font-size: 0.93rem; }
.step-num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-family: var(--display); }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
@media (min-width: 640px) { .card { padding: 28px; } }
.card.highlight { border-top: 4px solid var(--gold); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px;
  font: 600 0.95rem/1.2 var(--font); text-decoration: none; cursor: pointer; background: var(--green-100); color: var(--green-900); min-height: 44px; }
.btn:hover { filter: brightness(0.96); color: var(--green-900); }
.btn-primary { background: var(--green-800); color: #fff; }
.btn-primary:hover { background: var(--green-900); color: #fff; }
.btn-accent { background: var(--gold); color: var(--ink); }
.btn-accent:hover { background: var(--gold-600); color: var(--ink); }
.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, 0.8); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--green-800); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; }
.btn-ghost.btn-danger, .linklike.btn-danger { background: transparent; color: var(--danger); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: 0.85rem; }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* Forms */
.form { margin: 0 0 16px; }
.field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
input[type="text"], input[type="tel"], input[type="number"], input[type="date"], input[type="password"], input[type="url"], input[type="email"], input[type="search"], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #c5d1ca; border-radius: 10px; padding: 11px 12px; min-height: 46px; }
textarea { min-height: 0; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-700); outline: 3px solid rgba(17, 122, 77, 0.2); outline-offset: 0; }
input[type="file"] { font: inherit; max-width: 100%; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.error { color: var(--danger); font-size: 0.875rem; margin: 6px 0 0; }
.help { color: var(--muted); font-size: 0.85rem; margin: 6px 0 0; }
.req { color: var(--red); }
.optional { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.check { display: flex; gap: 8px; align-items: center; margin: 0 0 16px; font-size: 0.95rem; }
.check input { width: 18px; height: 18px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: grid; place-items: center; padding: 0 12px; background: var(--green-100); border: 1px solid #c5d1ca; border-right: 0; border-radius: 10px 0 0 10px; font-weight: 600; }
.input-prefix input { border-radius: 0 10px 10px 0; }
.otp-input { font-size: 1.6rem; letter-spacing: 0.5em; text-align: center; font-family: ui-monospace, monospace; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.role-option { position: relative; margin: 0 !important; }
.role-option input { position: absolute; opacity: 0; }
.role-option span { display: block; text-align: center; padding: 12px 8px; border: 1px solid #c5d1ca; border-radius: 10px; cursor: pointer; font-weight: 500; }
.role-option input:checked + span { background: var(--green-800); color: #fff; border-color: var(--green-800); }
.role-option input:focus-visible + span { outline: 3px solid var(--gold); }
.photo-picker { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.photo-preview { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.choice-list { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 0 0 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; flex: 1 1 160px; max-width: 320px; }
.filters input, .filters select { min-height: 40px; padding: 8px 10px; }
.settings-preview { max-height: 160px; width: auto; border-radius: 10px; margin-bottom: 8px; }
.settings-logo { max-height: 80px; }
.edit-photo { max-height: 360px; width: auto; margin: 0 auto 16px; border-radius: 10px; }

/* Notices */
.flash-stack { max-width: 960px; margin: 0 auto 12px; padding: 0 16px; }
.layout-admin .flash-stack { max-width: 1280px; }
.layout-public .flash-stack { margin-top: 16px; }
.flash, .notice { border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 0.95rem; border-left: 4px solid; }
.flash-success, .notice-success { background: var(--success-bg); border-color: var(--green-700); }
.flash-error, .notice-error { background: var(--danger-bg); border-color: var(--danger); }
.flash-info, .notice-info { background: var(--info-bg); border-color: #2f6fb3; }
.notice-warn { background: var(--warn-bg); border-color: var(--gold-600); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--green-100); color: var(--green-900); text-transform: capitalize; vertical-align: middle; }
.badge-success, .badge-active, .badge-approved { background: #d3eedf; color: #0a5132; }
.badge-muted, .badge-archived, .badge-deactivated, .badge-completed, .badge-used { background: #eceff0; color: #4a5550; }
.badge-warn, .badge-pending, .badge-upcoming { background: var(--warn-bg); color: #7a5600; }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }

/* Welcome */
.welcome-card { text-align: center; border-top: 5px solid var(--gold); }
.welcome-icon { font-size: 3rem; }
.reg-id-box { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; background: var(--green-100); border: 2px dashed var(--green-700); border-radius: 14px; padding: 14px 20px; margin: 8px 0 18px; }
.reg-id-box .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.reg-id { font-family: ui-monospace, monospace; font-size: clamp(1.2rem, 5vw, 1.6rem); font-weight: 700; color: var(--green-900); letter-spacing: 0.04em; word-break: break-all; }
.reg-id-box.compact { padding: 10px 14px; }
.reg-id-box.compact .reg-id { font-size: 1.05rem; }
.welcome-card .actions-row { justify-content: center; }

/* Portal */
.portal-hero { margin-bottom: 16px; }
.player-chip { display: flex; align-items: center; gap: 16px; }
.player-chip h1 { margin: 0; }
.player-chip p { margin: 0; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: var(--shadow); flex: none; }
.avatar-sm { width: 40px; height: 40px; border-width: 2px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; border-bottom: 3px solid transparent; }
.tile:hover { border-bottom-color: var(--gold); color: var(--ink); }
.tile-icon { font-size: 1.6rem; }
.tile .muted { font-size: 0.85rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.facts div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.announcement { background: var(--warn-bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.about-section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.year-tabs, .chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.year-tabs a, .chips a { flex: none; padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--green-900); font-weight: 600; font-size: 0.9rem; }
.year-tabs a[aria-current="page"], .chips a[aria-current="page"] { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid-lg { grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(6, 1fr); } .photo-grid-lg { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .photo-grid-lg { grid-template-columns: repeat(4, 1fr); } }
.photo-thumb { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--green-100); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.photo-thumb:hover img { transform: scale(1.04); }
.photo-card { margin: 0; }
.photo-card figcaption { font-size: 0.85rem; margin-top: 6px; color: var(--muted); }
.award-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .award-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .award-grid { grid-template-columns: repeat(3, 1fr); } }
.award-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; border-top: 4px solid var(--gold); }
.award-media { aspect-ratio: 4 / 3; background: linear-gradient(160deg, var(--green-700), var(--green-900)); }
.award-media img { width: 100%; height: 100%; object-fit: cover; }
.award-placeholder { height: 100%; display: grid; place-items: center; font-size: 4rem; }
.award-body { padding: 16px; }
.award-category { color: var(--gold-600); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; margin: 0 0 4px; }
.award-recipient { font-size: 1.25rem; margin-bottom: 4px; }
.award-achievement { font-weight: 600; color: var(--green-800); }
.profile { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 760px) { .profile { grid-template-columns: 280px 1fr; } }
.profile-card { text-align: center; }
.profile-photo { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; border: 4px solid var(--green-100); }
.details { margin: 0; }
.details > div { display: grid; grid-template-columns: 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 520px) { .details > div { grid-template-columns: 180px 1fr; gap: 12px; } }
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); font-size: 0.9rem; }
.details dd { margin: 0; font-weight: 500; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0; }
.table-wrap.card { padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #f0f4f1; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); white-space: nowrap; }
.table tbody tr:hover { background: #fafcfb; }
.row-link { cursor: pointer; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 12px 0; font-size: 0.9rem; }

/* Admin */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(6, 1fr); } }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.stat-value { font-family: var(--display); font-size: 1.8rem; font-weight: 700; color: var(--green-800); }
.stat-label { font-size: 0.85rem; color: var(--muted); }
.stat-alert { border-left: 4px solid var(--gold); }
.stat-alert .stat-value { color: var(--gold-600); }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.bulk-bar .check { margin: 0; }
.admin-photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 640px) { .admin-photo-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .admin-photo-grid { grid-template-columns: repeat(6, 1fr); } }
.admin-photo { position: relative; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.admin-photo img { aspect-ratio: 1; width: 100%; object-fit: cover; }
.admin-photo.is-unpublished img { opacity: 0.55; }
.admin-photo-select { position: absolute; top: 6px; left: 6px; background: #fff; border-radius: 6px; padding: 4px; line-height: 0; }
.admin-photo-select input { width: 18px; height: 18px; }
.admin-photo-meta { padding: 8px; }
.category-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.category-list li { background: var(--bg); border-radius: 999px; padding: 4px 12px; font-size: 0.9rem; }
.existing-list { display: grid; gap: 12px; }
.existing-item { display: flex; gap: 12px; align-items: center; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.92); z-index: 50; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 88vh; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 80vh; object-fit: contain; margin: 0 auto; }
.lightbox figcaption { color: #eee; margin-top: 10px; font-size: 0.9rem; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, 0.15); color: #fff; border: 0; font-size: 2rem; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; line-height: 1; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

@media print {
  .topbar, .footer, .btn, .nav-toggle { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* Teams (BRD v1.1) */
.container.wide-portal { max-width: 1180px; }
.team-chip { display: inline-flex; gap: 8px; align-items: center; background: var(--green-100); border-radius: 999px; padding: 6px 14px; margin: 0; }
.team-chip .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.team-chip-none { background: var(--warn-bg); }
.team-grid { border: 0; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .team-grid { grid-template-columns: repeat(3, 1fr); } }
.team-option { position: relative; margin: 0 !important; }
.team-option input { position: absolute; opacity: 0; }
.team-option span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; border: 2px solid #c5d1ca; border-radius: 12px; cursor: pointer; text-align: center; font-family: var(--display); letter-spacing: 0.04em; }
.team-option small { font-family: var(--font); color: var(--muted); letter-spacing: 0; font-weight: 400; }
.team-option input:checked + span { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.team-option input:checked + span small { color: rgba(255, 255, 255, 0.85); }
.team-option input:focus-visible + span { outline: 3px solid var(--gold); }
.teams-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .teams-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .teams-grid { grid-template-columns: repeat(3, 1fr); } }
.team-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border-top: 4px solid var(--green-700); }
.team-card.is-mine { border-top-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.team-card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: linear-gradient(160deg, var(--green-800), var(--green-900)); color: #fff; }
.team-card-head h2 { color: #fff; margin: 0; font-size: 1.1rem; letter-spacing: 0.06em; }
.team-count { font-size: 0.82rem; background: rgba(255, 255, 255, 0.15); border-radius: 999px; padding: 2px 10px; }
.team-mine-label { margin: 10px 16px 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-600); }
.team-empty { padding: 14px 16px; margin: 0; }
.roster { list-style: none; margin: 0; padding: 8px 8px 12px; }
.roster li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.roster li:nth-child(odd) { background: var(--bg); }
.admin-teams { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 760px) { .admin-teams { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .admin-teams { grid-template-columns: repeat(3, 1fr); } }
.team-rename { display: flex; gap: 8px; margin-bottom: 6px; }
.team-rename input { font-family: var(--display); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.admin-team .roster { padding: 0; }
#team, #edit { scroll-margin-top: 90px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 0; }
.kit-fields { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 0; }
.kit-fields legend { padding: 0 6px; }
.kit-help { margin: -4px 0 10px; }
.kit-name { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.jersey-badge { display: inline-block; min-width: 2.2em; text-align: center; font-family: var(--display); font-weight: 700; font-size: 0.8rem; background: var(--green-900); color: #fff; border-radius: 6px; padding: 1px 6px; }
.roster-name { flex: 1; }

/* Submit loaders */
.btn:disabled, .linklike:disabled { cursor: progress; opacity: 0.75; }
.is-loading { position: relative; }
.btn.is-loading::before, .linklike.is-loading::before {
  content: ''; display: inline-block; width: 1em; height: 1em; margin-right: 8px; vertical-align: -0.15em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-loading::before, .linklike.is-loading::before { animation-duration: 2s; } }
