/*
Theme Name: SpeedSoft Astana
Description: Сайт турнира по спидсофту: регистрация команд, расписание, сетка, результаты и правила.
Version: 1.3.2
Requires PHP: 8.1
Text Domain: speedsoft
*/

:root {
	--bg: #0b0d10;
	--panel: #13171c;
	--panel-2: #1a2027;
	--line: #262e37;
	--text: #eef2f5;
	--muted: #9aa6b2;
	--accent: #d4ff1e;
	--accent-ink: #101400;
	--sky: #19c3e6;
	--danger: #ff5c5c;
	--ok: #4ade80;
	--radius: 14px;
	--font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
	--display: "Unbounded", "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Шапка */
.header { position: sticky; top: 0; z-index: 50; background: rgba(11, 13, 16, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 700; letter-spacing: .02em; }
.brand-mark { width: 34px; height: 34px; }
.brand-logo { height: 44px; width: auto; }
.hero-logo { height: clamp(72px, 10vw, 108px); width: auto; margin-bottom: 14px; }
.brand small { display: block; font: 600 .7rem/1.2 var(--font); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--text); text-decoration: none; white-space: nowrap; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.nav a:hover { background: var(--panel-2); }
.partner-logo { display: inline-flex; align-items: center; background: #eef2f5; border-radius: 8px; padding: 3px 8px; }
.partner-logo img { height: 30px; width: auto; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 12px; font: inherit; cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--accent-ink) !important; border: 0; border-radius: 10px; padding: 12px 20px; font: 700 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(212, 255, 30, .25); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--text) !important; border: 1px solid var(--line); }
.btn-ghost:hover { box-shadow: none; background: var(--panel-2); }
.nav .btn { padding: 9px 14px; margin-left: 6px; }

/* Первый экран */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 9vw, 110px) 0 56px; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; background:
	radial-gradient(600px 300px at 85% 10%, rgba(25, 195, 230, .18), transparent 70%),
	radial-gradient(500px 300px at 10% 90%, rgba(212, 255, 30, .12), transparent 70%),
	repeating-linear-gradient(115deg, transparent 0 46px, rgba(255, 255, 255, .025) 46px 47px); pointer-events: none; }
.hero .wrap { position: relative; }
.hero-tag { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .8rem; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 5rem); max-width: 14ch; }
.hero h1 span { color: var(--accent); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 28px; }
.fact { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-width: 170px; }
.fact b { display: block; font-family: var(--display); font-size: 1.15rem; }
.fact span { color: var(--muted); font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* Первый экран в духе афиши */
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }
.hero .poster-title { display: flex; flex-direction: column; margin: 6px 0 18px; text-transform: uppercase; font-style: italic; line-height: .9; letter-spacing: -.02em; max-width: none; }
.poster-title .w1 { font-size: clamp(3.2rem, 9vw, 7rem); color: #fff; text-shadow: 0 6px 30px rgba(255, 255, 255, .12); }
.poster-title .w2 { font-size: clamp(3.2rem, 9vw, 7rem); color: var(--sky); margin-left: .6em; text-shadow: 0 6px 34px rgba(25, 195, 230, .35); }
.poster-title .w3 { align-self: flex-start; margin: 14px 0 0 .3em; padding: 6px 14px; font: 800 clamp(.95rem, 1.6vw, 1.15rem)/1.2 var(--font); font-style: normal; letter-spacing: .14em; color: #1b1400; background: linear-gradient(90deg, #f5c542, #e7a83a); border-radius: 6px; transform: skewX(-8deg); }
.poster-title .w3 b { font-weight: 900; }
.hero-lead { max-width: 52ch; color: var(--muted); font-size: 1.1rem; }
.hero-events { display: grid; gap: 16px; }
.event-card { position: relative; display: grid; gap: 8px; padding: 22px 24px; border-radius: 18px; text-decoration: none; color: var(--text); background: linear-gradient(135deg, rgba(25, 195, 230, .16), rgba(19, 23, 28, .9) 55%); border: 1px solid rgba(25, 195, 230, .35); overflow: hidden; transition: transform .15s, border-color .15s; }
.event-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 18px solid rgba(255, 255, 255, .04); }
.event-card:hover { transform: translateY(-2px); border-color: var(--sky); }
.event-milsim { background: linear-gradient(135deg, rgba(212, 255, 30, .12), rgba(19, 23, 28, .9) 55%); border-color: rgba(212, 255, 30, .35); }
.event-milsim:hover { border-color: var(--accent); }
.event-label { justify-self: start; font: 800 .78rem/1 var(--font); letter-spacing: .14em; text-transform: uppercase; padding: 6px 10px; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.event-date { display: flex; align-items: center; gap: 14px; }
.event-date b { font: 700 clamp(3rem, 6vw, 4.2rem)/1 var(--display); color: var(--sky); }
.event-milsim .event-date b { color: var(--accent); }
.event-date span { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; line-height: 1.3; }
.event-meta { color: var(--muted); font-size: .95rem; }
.countdown { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.countdown > span { background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: center; min-width: 58px; }
.countdown b { display: block; font: 700 1.4rem/1 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }
.countdown > span > span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: .85rem; background: rgba(74, 222, 128, .12); color: var(--ok); }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.closed { background: rgba(255, 92, 92, .12); color: var(--danger); }
.status-pill.live { background: rgba(255, 92, 92, .14); color: #ff8080; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* Секции */
section { padding: clamp(56px, 8vw, 96px) 0; }
section.alt { background: var(--panel); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head p { margin: 0; color: var(--muted); max-width: 60ch; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
section.alt .card { background: var(--bg); }
.card .num { font: 700 2rem/1 var(--display); color: var(--accent); margin-bottom: 10px; }
.card p:last-child { margin: 0; }

/* Регистрация */
.register-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 32px; align-items: start; }
.form { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; }
section.alt .form { background: var(--bg); }
.form label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.form input, .form textarea, .form select { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: inherit; }
.form input:focus, .form textarea:focus { border-color: var(--sky); outline: none; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.form .check input { width: auto; margin-top: 5px; }
.hp { position: absolute !important; left: -9999px !important; }
.notice { border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; border: 1px solid; }
.notice.ok { background: rgba(74, 222, 128, .08); border-color: rgba(74, 222, 128, .4); }
.notice.err { background: rgba(255, 92, 92, .08); border-color: rgba(255, 92, 92, .4); }
.slots { margin: 18px 0; }
.slots-bar { height: 10px; background: var(--panel); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.slots-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sky), var(--accent)); }
.steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--accent); font-size: .85rem; }

/* Команды */
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.team { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 12px; align-items: center; }
section.alt .team, section.alt .tcard { background: var(--bg); }
.team-badge { flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font: 800 1rem/1 var(--display); color: var(--accent-ink); background: var(--accent); }
.team b { display: block; }
.team > div > span { display: block; color: var(--muted); font-size: .85rem; }
.team-link { font-size: .8rem; font-weight: 700; text-decoration: none; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; }

/* Награды */
.medals { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.medal { margin: 0; text-align: center; padding: 26px; border-radius: 20px; background: radial-gradient(circle at 50% 40%, rgba(245, 197, 66, .16), transparent 65%), var(--panel); border: 1px solid rgba(245, 197, 66, .25); }
.medal img { width: min(320px, 100%); margin: 0 auto 14px; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .6)); transition: transform .3s; }
.medal:hover img { transform: rotate(-4deg) scale(1.03); }
.medal figcaption b { display: block; font: 700 1.2rem/1.3 var(--display); color: #f5c542; }
.medal figcaption span { color: var(--muted); }

/* Ростеры команд */
.teams-title { margin: 30px 0 16px; font-size: 1.3rem; }
.teams-title span { color: var(--muted); font: 600 .95rem var(--font); }
.rosters { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.tcard { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; transition: border-color .15s, transform .15s; }
.tcard:hover { border-color: var(--sky); transform: translateY(-2px); }
.tcard-head { display: flex; align-items: center; gap: 14px; padding-right: 38px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tlogo { flex: none; width: 76px; height: 76px; border-radius: 16px; object-fit: cover; background: #fff; }
.tlogo-mono { display: grid; place-items: center; font: 700 1.3rem/1 var(--display); color: #fff; background: linear-gradient(135deg, hsl(var(--h) 75% 48%), hsl(calc(var(--h) + 50) 70% 28%)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15); }
.tcard-name { min-width: 0; flex: 1; }
.tcard-name h4 { margin: 0 0 2px; font: 700 1rem/1.2 var(--display); overflow-wrap: break-word; hyphens: manual; }
.tcard-name span { color: var(--muted); font-size: .85rem; }
.tcard-ig { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
.tcard-ig:hover { color: #fff; background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); border-color: transparent; }
.roster { margin: 0; padding: 0; list-style: none; counter-reset: p; display: grid; gap: 6px; }
.roster li { counter-increment: p; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.roster li::before { content: counter(p); width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 6px; font-size: .75rem; color: var(--muted); background: var(--panel-2); }
.cap { font-style: normal; font: 800 .7rem/1 var(--font); color: var(--accent-ink); background: var(--accent); padding: 3px 6px; border-radius: 5px; }
.tnote { margin: -2px 0 12px; padding: 7px 10px; border-radius: 10px; font-size: .85rem; font-weight: 700; color: #f5c542; background: rgba(245, 197, 66, .1); }
.reserve { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }

/* Расписание */
.schedule { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.schedule li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.schedule time { font: 700 1.05rem/1 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }

/* Сетка */
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.round { scroll-snap-align: start; }
.round h3 { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font: 800 .8rem/1.2 var(--font); margin-bottom: 12px; }
.match { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
section.alt .match { background: var(--bg); }
.match-meta { display: flex; justify-content: space-between; padding: 7px 12px; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.match-meta .live { color: #ff8080; font-weight: 800; }
.side { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; }
.side + .side { border-top: 1px solid var(--line); }
.side.win { font-weight: 800; }
.side.win .score { color: var(--accent); }
.score { font: 700 1rem/1.4 var(--display); font-variant-numeric: tabular-nums; }

/* Таблицы */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 520px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
td.place { font: 800 1.1rem/1 var(--display); width: 70px; }
tr.top-1 td.place { color: #ffd34d; }
tr.top-2 td.place { color: #d7dee6; }
tr.top-3 td.place { color: #e7a56b; }

/* Правила и арена */
.rules-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: start; }
details { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
section.alt details { background: var(--bg); }
summary { cursor: pointer; padding: 15px 18px; font-weight: 800; list-style: none; display: flex; justify-content: space-between; }
summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: "−"; }
details ul { margin: 0; padding: 0 18px 16px 36px; }
details li { margin-bottom: 6px; }
.arena { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
section.alt .arena { background: var(--bg); }
.arena svg { width: 100%; height: auto; }

/* Трансляция */
.stream { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: var(--radius); background: var(--panel-2); }
.stream-placeholder { aspect-ratio: 16 / 9; border-radius: var(--radius); border: 1px dashed var(--line); display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }

/* Контакты */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.content { padding: 56px 0; }
.content h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

@media (max-width: 1360px) {
	.menu-btn { display: inline-block; }
	.nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px 18px; }
	.nav.open { display: flex; }
	.nav .btn { margin: 8px 0 0; }
}
@media (max-width: 980px) {
	.register-grid, .rules-grid, .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.form .row, .form .players { grid-template-columns: 1fr; }
	.schedule li { grid-template-columns: 1fr; gap: 4px; }
	.fact { min-width: 0; flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.status-pill.live { animation: none; }
}
