*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Рекламный баннер */
.banner-wrap {
    width: 100%;
    background: #000;
}
.banner-link {
    display: block;
    max-width: 480px;
    margin: 0 auto;
    line-height: 0;
}
.banner-img {
    width: 100%;
    height: auto;
    display: block;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0d1b2a;
    color: #e8edf2;
    min-height: 100vh;
    padding: 16px;
}

.container {
    max-width: 480px;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 32px 0 24px;
}

.logo { font-size: 48px; margin-bottom: 8px; }

h1 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.4;
}
.alert-success { background: #1a4731; border: 1px solid #2d7a4f; color: #6ee7a8; }
.alert-error   { background: #3d1a1a; border: 1px solid #7a2d2d; color: #f87171; }
.alert-info    { background: #1a2d3d; border: 1px solid #2d5a7a; color: #93c5fd; }

/* Form */
.form { display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 8px; }

label {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    background: #1e2d3d;
    border: 1.5px solid #2d4056;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: #3b82f6;
}
input::placeholder { color: #4a6080; }

/* Training options */
.training-list { display: flex; flex-direction: column; gap: 10px; }

.training-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #1e2d3d;
    border: 1.5px solid #2d4056;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.training-option:has(input:checked) {
    border-color: #3b82f6;
    background: #1a2d4a;
}
.training-option.full {
    opacity: 0.45;
    cursor: not-allowed;
}
.training-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

.training-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.training-info strong { font-size: 15px; color: #fff; text-transform: capitalize; }
.time { font-size: 13px; color: #64748b; }
.venue { font-size: 12px; color: #94a3b8; }
.slots { font-size: 13px; color: #4ade80; }
.slots.low { color: #fb923c; }

/* Button */
.btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: #3b82f6;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
    -webkit-appearance: none;
    margin-top: 4px;
}
.btn:hover { background: #2563eb; }
.btn-outline {
    background: transparent;
    border: 1.5px solid #3b82f6;
    color: #3b82f6;
}
.btn-outline:hover { background: #1a2d4a; }
.btn-sm {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-block;
}
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

/* User header */
.user-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid #2d4056;
}
.user-top {
    display: flex;
    align-items: center;
    gap: 14px;
}
.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.user-nickname { font-size: 18px; font-weight: 700; color: #fff; }

.jersey-wrap {
    display: grid;
    place-items: center;
    width: 80px;
    flex-shrink: 0;
}
.jersey-img {
    grid-area: 1 / 1;
    width: 100%;
    display: block;
}
.jersey-number {
    grid-area: 1 / 1;
    font-size: 18px;
    font-weight: 900;
    color: #1e3a8a;
    line-height: 1;
    letter-spacing: -1px;
    margin-top: 6px;
    pointer-events: none;
}
.player-number { color: #3b82f6; font-size: 13px; font-weight: 700; margin-left: 4px; }
.user-stats { font-size: 13px; color: #64748b; }
.user-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.user-actions .btn-sm {
    flex: 1;
    text-align: center;
}

.section-title {
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 20px 0 12px;
    font-weight: 600;
}

/* Training cards */
.training-cards { display: flex; flex-direction: column; gap: 10px; }

.training-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #1e2d3d;
    border: 1.5px solid #2d4056;
    border-radius: 10px;
    gap: 12px;
}
.training-card.registered {
    border-color: #22c55e;
    background: #162e1e;
}
.training-card-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.training-card-info strong { font-size: 15px; color: #fff; }
.training-rating { font-size: 13px; color: #fbbf24; }
.star-btn { background: none; border: none; color: #4a6080; font-size: 22px; cursor: pointer; padding: 0 1px; line-height: 1; transition: color .15s; }
.star-btn:hover, .star-btn:hover ~ .star-btn { color: #fbbf24; outline: none; }

.btn-cancel {
    background: transparent;
    border: 1.5px solid #ef4444;
    color: #ef4444;
}
.btn-cancel:hover { background: #3d1a1a; }

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Stat cards */
.stats-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.stat-card {
    flex: 1;
    background: #1e2d3d;
    border: 1px solid #2d4056;
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
}
.stat-value { font-size: 24px; font-weight: 700; color: #fff; }
.stat-label { font-size: 11px; color: #64748b; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

/* Rating input в форме */
.rating-input { display: flex; flex-wrap: wrap; gap: 6px; }
.rating-option input[type="radio"] { display: none; }
.rating-option span {
    display: inline-block;
    padding: 6px 12px;
    border: 1.5px solid #2d4056;
    border-radius: 8px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}
.rating-option input:checked + span {
    border-color: #fbbf24;
    color: #fbbf24;
    background: rgba(251,191,36,0.1);
}

/* Star rating */
.star-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #2d4056;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}
.star-btn.active { color: #fbbf24; }
.star-btn:hover  { color: #fbbf24; }
.star-clear { font-size: 13px; color: #64748b; margin-left: 4px; }
.star-clear:hover { color: #ef4444; }

/* Admin styles */
.admin-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #2d4056;
}
.admin-header h1 { font-size: 18px; }
.admin-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.admin-actions .btn-sm { flex: 1; text-align: center; }
.admin-actions form { display: contents; }
.admin-actions form .btn-sm { flex: 1; text-align: center; }

.card {
    background: #1e2d3d;
    border: 1px solid #2d4056;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}
.card-header {
    padding: 14px 16px;
    background: #162233;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.card-header h2 { font-size: 15px; font-weight: 700; }
.badge {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    background: #2d4056;
    color: #93c5fd;
    white-space: nowrap;
}

table { width: 100%; border-collapse: collapse; }
td { padding: 12px 16px; border-bottom: 1px solid #1a2d3d; font-size: 14px; }
tr:last-child td { border-bottom: none; }
td:last-child { text-align: right; }

.team-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}
.team-white {
    background: #fff;
    color: #0d1b2a;
    border: 1px solid #cbd5e1;
}
.team-black {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #374151;
}

/* Итоговый состав */
.composition {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid #1a2d3d;
}
.team-column {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
}
.team-column-header {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.team-column.whites .team-column-header {
    background: #fff;
    color: #0d1b2a;
}
.team-column.blacks .team-column-header {
    background: #1a1a1a;
    color: #fff;
}
.team-column-body {
    background: #162233;
    padding: 10px 14px;
    min-height: 40px;
}
.team-column-body .player {
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px solid #1e2d3d;
    color: #e2e8f0;
}
.team-column-body .player:last-child { border-bottom: none; }
.team-column-body .empty-team {
    font-size: 13px;
    color: #4a6080;
    text-align: center;
    padding: 4px 0;
}

select {
    width: 100%;
    background: #0d1b2a;
    border: 1px solid #2d4056;
    border-radius: 6px;
    color: #fff;
    padding: 10px 12px;
    font-size: 16px;
    cursor: pointer;
}

.empty { text-align: center; color: #4a6080; padding: 20px; font-size: 14px; }

/* Tag input (leagues) */
.tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    background: #1e2d3d;
    border: 1.5px solid #2d4056;
    border-radius: 10px;
    min-height: 48px;
    align-items: center;
    cursor: text;
}
.tag-input-wrap:focus-within { border-color: #3b82f6; }
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #1a3a5c;
    border: 1px solid #3b82f6;
    border-radius: 20px;
    font-size: 13px;
    color: #93c5fd;
}
.tag button {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    line-height: 1;
    width: auto;
    display: inline;
    margin-top: 0;
}
.tag button:hover { color: #ef4444; }

/* Team restriction dropdown */
.team-dropdown {
    border: 1.5px solid #2d4056;
    border-radius: 10px;
    overflow: hidden;
}
.team-dropdown-summary {
    padding: 10px 14px;
    background: #1e2d3d;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.team-dropdown-summary::-webkit-details-marker { display: none; }
.team-dropdown-summary::after {
    content: '▾';
    font-size: 12px;
    color: #64748b;
    transition: transform 0.2s;
}
.team-dropdown[open] .team-dropdown-summary::after { transform: rotate(-180deg); }
.team-dropdown[open] .team-dropdown-summary { color: #e2e8f0; border-bottom: 1px solid #2d4056; }
.team-dropdown-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #162233;
    padding: 6px;
}
.restrict-team-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #1e2d3d;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    color: #e2e8f0;
    transition: background 0.15s;
}
.restrict-team-option:has(input:checked) {
    background: #1a2d4a;
    color: #93c5fd;
}
.restrict-team-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

.private-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #1e2d3d;
    border: 1.5px solid #2d4056;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 4px;
}
.private-toggle:has(input:checked) {
    border-color: #7c3aed;
    background: #1c1535;
    color: #c4b5fd;
}
.private-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #7c3aed;
    flex-shrink: 0;
}

/* Add training form */
.add-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.add-form input { padding: 10px 12px; font-size: 14px; }
.row { display: flex; gap: 10px; }
.add-form .row input { flex: 1; }

@media (max-width: 360px) {
    h1 { font-size: 18px; }
    .logo { font-size: 36px; }
}
