* {
    box-sizing: border-box;
}

@font-face {
    font-family: 'Glitch Goblin';
    src: url('/static/fonts/GlitchGoblin.otf') format('opentype'),
         url('/static/fonts/Glitch Goblin.otf') format('opentype'),
         url('/static/fonts/GlitchGoblin.ttf') format('truetype'),
         url('/static/fonts/Glitch Goblin.ttf') format('truetype');
    font-display: swap;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Roboto', Arial, sans-serif;
    background: radial-gradient(circle at 20% 20%, #1e3a8a 0%, #0b1c4d 45%, #081233 100%);
    color: #1f2937;
}

.container {
    flex: 1 0 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px;
}

h1 {
    margin-bottom: 8px;
}

.subtitle {
    margin-top: 0;
    color: #4b5563;
}

.container > h1 {
    color: #f8fbff;
}

.container > .subtitle {
    color: #dbe7ff;
}

.subtitle.small {
    font-size: 14px;
}

.tournaments-box {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 14px;
    margin: 12px 0 16px;
}

.tournaments-box h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.tournament-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.active-tournament-card {
    border: 1px solid #dbe2ea;
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.active-tournament-empty {
    color: #4b5563;
    font-size: 14px;
}

.active-tournament-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.active-tournament-meta {
    color: #4b5563;
    font-size: 13px;
    margin-bottom: 8px;
}

.active-tournament-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.active-tournament-statuses button {
    padding: 6px 10px;
    font-size: 12px;
}

.tournament-page-card {
    background: #fff;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 16px;
    max-width: 860px;
}

.tournament-page-meta {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    color: #334155;
}

.tournament-page-actions {
    margin: 10px 0 14px;
}

.roles-box {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
    margin-bottom: 12px;
}

.role-assign-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.role-assign-form select {
    min-width: 220px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}

.roles-readonly,
.roles-empty {
    color: #4b5563;
    font-size: 13px;
}

.roles-list {
    display: grid;
    gap: 6px;
}

.role-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
}

.role-main {
    font-weight: 600;
}

.role-meta {
    color: #4b5563;
    font-size: 13px;
}

.audit-history {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 8px;
}

.audit-filter-btn {
    padding: 6px 10px;
    font-size: 12px;
}

.audit-user-filter-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.audit-user-filter-wrap label {
    font-size: 13px;
    color: #334155;
}

.audit-user-filter {
    min-width: 220px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}

.audit-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px 10px;
}

.audit-main {
    font-weight: 600;
}

.audit-meta,
.audit-empty {
    color: #4b5563;
    font-size: 13px;
}

.snapshots-list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.snapshot-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px 10px;
}

.snapshot-main {
    font-weight: 600;
}

.snapshot-meta,
.snapshot-empty {
    color: #4b5563;
    font-size: 13px;
}

.snapshot-actions {
    margin-top: 6px;
}

.snapshot-actions button {
    padding: 6px 10px;
    font-size: 12px;
}

.tatami-queue-box {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
    margin-bottom: 12px;
}

.tatami-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.tatami-form input[type='text'] {
    min-width: 280px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}

.tatami-form button {
    padding: 6px 10px;
    font-size: 12px;
}

.queue-summary {
    color: #334155;
    font-size: 13px;
    margin-bottom: 8px;
}

.queue-live-controls {
    margin-bottom: 10px;
}

.queue-live-controls button {
    padding: 6px 10px;
    font-size: 12px;
}

.fight-queue-list {
    display: grid;
    gap: 8px;
}

.queue-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
}

.queue-screen-card {
    max-width: 960px;
}

.queue-current-item {
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: #eef2ff;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.board-screen-card {
    max-width: 1100px;
}

.board-current-item {
    border: 2px solid #1d4ed8;
    border-radius: 12px;
    background: #eff6ff;
    padding: 18px;
}

.board-current-item--changed {
    animation: boardPulse 1.1s ease;
}

@keyframes boardPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.45);
        background: #dbeafe;
    }
    70% {
        box-shadow: 0 0 0 18px rgba(29, 78, 216, 0);
        background: #eff6ff;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(29, 78, 216, 0);
        background: #eff6ff;
    }
}

.board-current-main {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1e3a8a;
}

.board-current-fighters {
    font-size: 40px;
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 10px;
    color: #0f172a;
}

.board-vs {
    font-size: 20px;
    margin: 0 10px;
    color: #1e40af;
}

.board-current-meta {
    font-size: 20px;
    color: #334155;
}

.board-done-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.board-done-item {
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px 12px;
}

.board-done-main {
    font-weight: 600;
    color: #1f2937;
}

.board-done-fighters,
.board-done-meta {
    color: #4b5563;
    font-size: 14px;
}

.queue-main {
    font-weight: 600;
}

.queue-fighters,
.queue-empty {
    color: #4b5563;
    font-size: 13px;
}

.queue-controls {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.queue-controls select {
    min-width: 150px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}

.queue-controls button {
    padding: 6px 10px;
    font-size: 12px;
}

.results-by-category-box {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
    margin-bottom: 12px;
}

.results-by-category-actions {
    margin-bottom: 8px;
}

.results-by-category-actions button {
    padding: 6px 10px;
    font-size: 12px;
}

.results-by-category-list {
    display: grid;
    gap: 8px;
}

.result-category-item {
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
}

.result-category-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}

.result-category-standings {
    display: grid;
    gap: 4px;
}

.result-standing-row {
    color: #334155;
    font-size: 13px;
}

.results-protocol-card {
    width: min(1280px, 100%);
    max-width: 1280px;
    margin: 0 auto;
}

.results-protocol-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.results-protocol-stat-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
}

.results-protocol-stat-label {
    color: #4b5563;
    font-size: 12px;
    margin-bottom: 2px;
}

.results-protocol-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.results-protocol-stat-meta {
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}

.results-protocol-highlights {
    margin-bottom: 14px;
}

.results-protocol-highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.results-protocol-highlight-item {
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.results-protocol-highlight-label {
    color: #4b5563;
    font-size: 12px;
    margin-bottom: 3px;
}

.results-protocol-highlight-main {
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.results-protocol-highlight-meta {
    color: #475569;
    font-size: 13px;
}

.results-protocol-ratings {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.results-protocol-rating-block {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
}

.results-protocol-rating-block h3 {
    margin-top: 0;
}

.results-protocol-table-wrap {
    overflow-x: auto;
}

.results-protocol-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.results-protocol-table th,
.results-protocol-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 8px;
    text-align: left;
    font-size: 13px;
    color: #334155;
    white-space: nowrap;
}

.results-protocol-table th {
    color: #1f2937;
    font-weight: 700;
    background: #ffffff;
}

/* ── Festive results page ── */
#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

.results-festive .tournament-page-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(6px);
}

.results-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.results-page-container .top-nav {
    width: min(1200px, 100%);
}

.results-main-card {
    width: min(1200px, 100%);
}

.results-festive h1.results-title {
    text-align: center;
    font-size: 2rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    letter-spacing: .5px;
}

.results-festive .results-subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 18px;
}

.results-festive .trophy-icon {
    display: block;
    text-align: center;
    font-size: 3rem;
    margin-bottom: 4px;
    animation: trophy-bounce 2s ease-in-out infinite;
}

@keyframes trophy-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ── Podium card ── */
.podium-category {
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: linear-gradient(135deg, #fef9c3 0%, #fff 40%, #ecfdf5 100%);
    padding: 18px 16px 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.podium-category-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 4px;
}

.podium-category-meta {
    text-align: center;
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 14px;
}

/* ── Podium blocks ── */
.podium-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 10px;
    min-height: 180px;
}

.podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 150px;
    max-width: 30%;
    transition: transform .3s;
}

.podium-slot:hover {
    transform: translateY(-4px);
}

.podium-medal {
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 4px;
}

.podium-name {
    font-weight: 700;
    font-size: .95rem;
    color: #1f2937;
    text-align: center;
    word-break: break-word;
    margin-bottom: 2px;
}

.podium-stats {
    font-size: .76rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.podium-block {
    width: 100%;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-weight: 800;
    font-size: 1.6rem;
    color: rgba(255,255,255,.85);
    padding-bottom: 6px;
}

.podium-block-1 {
    height: 110px;
    background: linear-gradient(180deg, #fbbf24, #d97706);
    box-shadow: 0 0 18px rgba(251,191,36,.45);
}

.podium-block-2 {
    height: 80px;
    background: linear-gradient(180deg, #c0c0c0, #9ca3af);
    box-shadow: 0 0 12px rgba(156,163,175,.35);
}

.podium-block-3 {
    height: 60px;
    background: linear-gradient(180deg, #cd7f32, #92400e);
    box-shadow: 0 0 12px rgba(205,127,50,.35);
}

/* Order: 2nd — 1st — 3rd  (flex order) */
.podium-slot[data-place="1"] { order: 2; }
.podium-slot[data-place="2"] { order: 1; }
.podium-slot[data-place="3"] { order: 3; }

/* ── Confetti burst on category (optional subtle sparkle) ── */
.podium-category::before {
    content: "✨";
    position: absolute;
    top: 10px;
    left: 16px;
    font-size: 1.3rem;
    opacity: .6;
    animation: sparkle-pulse 3s ease-in-out infinite;
}

.podium-category {
    position: relative;
    overflow: hidden;
}

@keyframes sparkle-pulse {
    0%, 100% { opacity: .4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* ── Extra standings (beyond top-3) ── */
.podium-extra-standings {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed #d1d5db;
}

.podium-extra-row {
    font-size: .85rem;
    color: #374151;
    padding: 2px 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .podium-wrapper {
        gap: 4px;
    }
    .podium-slot {
        width: 100px;
    }
    .podium-block-1 { height: 80px; }
    .podium-block-2 { height: 60px; }
    .podium-block-3 { height: 44px; }
    .podium-medal { font-size: 1.6rem; }
    .podium-name { font-size: .82rem; }
}

.inline-confirm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inline-confirm-text {
    font-size: 12px;
    color: #374151;
}

.inline-confirm button {
    padding: 6px 10px;
    font-size: 12px;
}

.tournament-form input[type='text'],
.tournament-form input[type='date'] {
    min-width: 220px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
}

.tournaments-list {
    display: grid;
    gap: 8px;
}

.tournament-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    background: #f9fafb;
}

.tournament-item.active {
    border-color: #93c5fd;
    background: #eff6ff;
}

.tournament-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tournament-title {
    font-weight: 700;
}

.tournament-meta {
    color: #4b5563;
    font-size: 13px;
}

.tournament-actions {
    display: flex;
    gap: 8px;
}

.tournament-actions button {
    padding: 6px 10px;
    font-size: 12px;
}

.upload-box {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 20px 0;
}

.upload-box input[type='text'] {
    min-width: 240px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
}

.toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
}

.template-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    color: #374151;
}

.template-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.template-link:hover {
    text-decoration: underline;
}

.public-screens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    padding: 8px 0;
}

.public-screens-tatami-card {
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 10px 12px;
    background: #ffffff;
}

.public-screens-tatami-title {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.public-screens-tatami-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.export-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.audit-feed-box {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}

.audit-feed-box h2 {
    margin: 0 0 8px;
    font-size: 17px;
}

.audit-scope-toggle {
    margin-bottom: 8px;
}

.audit-feed {
    display: grid;
    gap: 8px;
}

.audit-feed-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.audit-feed-filter-btn {
    padding: 6px 10px;
    font-size: 12px;
}

.audit-feed-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px 10px;
}

.audit-feed-main {
    font-weight: 600;
}

.audit-feed-meta,
.audit-feed-empty {
    color: #4b5563;
    font-size: 13px;
}

.audit-feed-more-wrap {
    margin-top: 8px;
}

.audit-feed-more-wrap button {
    padding: 6px 10px;
    font-size: 12px;
}

.renumber-indicator {
    font-size: 13px;
    color: #065f46;
    opacity: 0;
    transition: opacity 0.2s ease;
    min-height: 20px;
}

.renumber-indicator.visible {
    opacity: 1;
}

button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
}

button:hover {
    background: #1e4ec5;
}

button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.status {
    min-height: 24px;
    font-weight: 600;
}

.group {
    position: relative;
    margin-bottom: 28px;
    background: #fff;
    border-radius: 12px;
    padding: 16px 16px 250px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.watermark-layer {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-family: 'Glitch Goblin', 'Roboto', Arial, sans-serif;
    font-size: 132px;
    font-weight: 700;
    color: rgba(148, 163, 184, 0.18);
    pointer-events: none;
    z-index: 0;
}

.group-title {
    position: relative;
    z-index: 1;
    margin-top: 8px;
}

.event-title {
    position: relative;
    z-index: 2;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.category-title {
    position: relative;
    z-index: 2;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.rounds {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 8px 18px 14px 8px;
    align-items: flex-start;
}

.rr-matches {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    padding: 6px 6px 12px;
}

.rr-match {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px;
}

.rr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.rr-table td {
    border: 1px solid #d1d5db;
    padding: 6px;
    min-height: 26px;
}

.rr-table td {
    display: flex;
    align-items: center;
    gap: 6px;
}

.round {
    min-width: 260px;
}

.matches {
    display: flex;
    flex-direction: column;
}

.match {
    position: relative;
    background: #fff;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    min-height: 88px;
    height: 88px;
}

.match.bye-match {
    background: #eff6ff;
    border-color: #93c5fd;
}

.add-preliminary-btn {
    position: absolute;
    left: -26px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid #94a3b8;
    background: #ffffff;
    color: #1f2937;
    padding: 0;
    font-weight: 700;
    line-height: 18px;
    cursor: pointer;
}

.add-preliminary-btn:hover {
    background: #eff6ff;
}

.remove-preliminary-btn {
    position: absolute;
    right: 6px;
    top: 6px;
    transform: none;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid #94a3b8;
    background: #ffffff;
    color: #1f2937;
    padding: 0;
    font-weight: 700;
    line-height: 18px;
    cursor: pointer;
    z-index: 3;
}

.remove-preliminary-btn:hover {
    background: #fef2f2;
}

.preliminary-placeholder {
    border-style: dashed;
    opacity: 0.45;
    min-height: 80px;
}

.match-number {
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 6px;
    min-height: 16px;
    white-space: nowrap;
}

.editable-text {
    display: inline-block;
    min-width: 24px;
    border-bottom: 1px dashed #94a3b8;
    padding: 0 2px;
}

.editable-text:focus {
    outline: 2px solid #93c5fd;
    border-bottom-color: transparent;
    border-radius: 4px;
}

.editable-text:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
}

.fighter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    min-height: 26px;
}

.fighter .editable-text,
.rr-table .editable-text {
    flex: 1;
    min-width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fighter-prefix {
    min-width: 18px;
    font-weight: 600;
}

.fighter-square {
    width: 10px;
    height: 10px;
    border: 1px solid #111827;
    display: inline-block;
}

.fighter-square.red {
    background: #ef4444;
}

.fighter-square.white {
    background: #ffffff;
}

.match.has-next::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -22px;
    width: 22px;
    border-top: 2px solid #94a3b8;
}

.match.has-next.odd::before,
.match.has-next.even::before {
    content: '';
    position: absolute;
    right: -22px;
    width: 2px;
    background: #94a3b8;
    height: var(--link-v, 40px);
}

.match.has-next.odd::before {
    top: 50%;
}

.match.has-next.even::before {
    bottom: 50%;
}

.judge-places {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 190px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px;
    z-index: 2;
}

.third-place-box {
    position: absolute;
    right: 16px;
    bottom: 198px;
    width: 190px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px;
    z-index: 2;
}

.third-place-box h5 {
    margin: 0 0 6px;
    font-size: 12px;
}

.third-place-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.third-place-table td {
    border: 1px solid #d1d5db;
    padding: 6px;
    height: 26px;
}

.third-place-table .fighter-prefix {
    min-width: 18px;
}

.judge-places h5 {
    margin: 0 0 6px;
    font-size: 12px;
}

.judge-places table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.judge-places td {
    border: 1px solid #d1d5db;
    padding: 4px 6px;
}

.judge-places td:last-child {
    height: 24px;
    width: 55%;
}

.judge-info {
    position: absolute;
    left: 16px;
    bottom: 16px;
    width: 250px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px;
    z-index: 2;
}

.judge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 8px;
}

.judge-row:last-child {
    margin-bottom: 0;
}

.judge-line {
    flex: 1;
    border-bottom: 1px solid #6b7280;
    min-height: 14px;
    line-height: 14px;
    font-size: 12px;
}

.copyright-label {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    font-size: 10px;
    color: #6b7280;
    z-index: 2;
    white-space: nowrap;
}

.page-copyright {
    margin-top: auto;
    text-align: center;
    font-size: 12px;
    color: #9db2e8;
    padding: 0 24px 16px;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.top-nav-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #374151;
}

.top-nav-user-photo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(191, 219, 254, 0.7);
}

.container > .top-nav .top-nav-user {
    color: #e5edff;
}

.top-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-nav-actions form {
    margin: 0;
}


.feature-slider {
    position: relative;
    margin-bottom: 16px;
    border: 1px solid rgba(191, 219, 254, 0.45);
    border-radius: 16px;
    background: linear-gradient(140deg, rgba(11, 28, 77, 0.9), rgba(30, 58, 138, 0.82));
    box-shadow: 0 20px 48px rgba(8, 18, 51, 0.35);
    overflow: hidden;
}

.feature-slider-track {
    position: relative;
    min-height: 260px;
}

.feature-slide {
    position: absolute;
    inset: 0;
    padding: 28px 30px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(36px) scale(0.98);
    pointer-events: none;
    transition: opacity 320ms ease, transform 320ms ease;
    color: #f8fbff;
}

.feature-slide.is-active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.feature-slide h1,
.feature-slide h2 {
    margin: 0;
    color: #f8fbff;
    line-height: 1.25;
    max-width: 900px;
}

.feature-slide h1 {
    font-size: clamp(24px, 2.5vw, 34px);
}

.feature-slide h2 {
    font-size: clamp(20px, 2.2vw, 30px);
}

.feature-slide p {
    margin: 0;
    color: #dbe7ff;
    max-width: 860px;
    font-size: clamp(15px, 1.35vw, 18px);
    line-height: 1.5;
}

.feature-slide-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    border: 1px solid rgba(191, 219, 254, 0.65);
    background: rgba(15, 23, 42, 0.45);
    color: #e5edff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 6px 12px;
}

.feature-slider-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid rgba(191, 219, 254, 0.25);
    padding: 10px 14px;
    background: rgba(8, 18, 51, 0.38);
}

.feature-slider-btn {
    min-width: 40px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(191, 219, 254, 0.45);
    background: rgba(15, 23, 42, 0.35);
    color: #f8fbff;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}

.feature-slider-btn:hover {
    background: rgba(30, 58, 138, 0.72);
}

.feature-slider-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

.feature-slider-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: rgba(219, 231, 255, 0.45);
}

.feature-slider-dot.is-active {
    background: #f8fbff;
    box-shadow: 0 0 10px rgba(248, 251, 255, 0.75);
}

.brand-hero-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-hero-text h1 {
    margin: 0 0 6px;
}

.brand-hero-text .subtitle {
    margin: 0;
}

.auth-page {
    position: relative;
    min-height: calc(100vh - 70px);
    padding: 24px;
    display: block;
}

.lang-switch {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.lang-btn {
    background: rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #eff6ff;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
}

.lang-btn:hover {
    background: rgba(139, 92, 246, 0.45);
    border-color: rgba(167, 139, 250, 0.6);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: #a78bfa;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.auth-logo-under-rain {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: clamp(230px, 34vh, 360px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(28px, 6vh, 64px);
    pointer-events: none;
    z-index: 1;
}

.auth-logo-under-rain::before {
    content: '';
    position: absolute;
    top: clamp(42px, 8vh, 108px);
    width: clamp(247px, 39vw, 527px);
    height: clamp(247px, 39vw, 527px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.34) 0%, rgba(139, 92, 246, 0.17) 46%, rgba(99, 102, 241, 0) 82%);
    filter: blur(10px);
    animation: logoAuraPulse 3.2s ease-in-out infinite;
}

.auth-start-body {
    background: radial-gradient(circle at 20% 20%, #312e81 0%, #1e1b4b 45%, #0f0a2e 100%);
    color: #e5edff;
}

.auth-start-body .page-copyright {
    color: #a5b4fc;
}

.kanji-rain {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.kanji-drop {
    position: absolute;
    top: -18%;
    left: var(--left);
    color: rgba(167, 139, 250, 0.28);
    font-size: clamp(26px, 3.2vw, 48px);
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
    animation: kanjiFall var(--duration) linear infinite;
    animation-delay: var(--delay);
}

@keyframes kanjiFall {
    from {
        top: -18%;
    }
    to {
        top: 118%;
    }
}

.auth-hero {
    width: 100%;
    text-align: center;
    padding: clamp(420px, 60vh, 700px) 20px 20px;
    position: relative;
    z-index: 3;
}

.auth-landing {
    margin-top: 28px;
    display: grid;
    gap: 18px;
}

.auth-landing-block {
    min-height: clamp(360px, 60vh, 620px);
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    opacity: 0;
    transform: translateY(56px) scale(0.985);
    filter: blur(2px);
    transition: opacity 700ms ease, transform 850ms cubic-bezier(0.22, 0.61, 0.36, 1), filter 650ms ease;
}

.auth-landing-block.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.auth-feature-card {
    width: clamp(760px, 74vw, 1320px);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 14px;
    padding: 14px;
    align-items: center;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 20px;
    background: rgba(30, 27, 75, 0.6);
    box-shadow: 0 24px 48px rgba(15, 10, 46, 0.5);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.auth-feature-card::after {
    content: '';
    position: absolute;
    inset: -30% -40% auto -40%;
    height: 64%;
    background: linear-gradient(120deg, transparent 0%, rgba(167, 139, 250, 0.17) 45%, transparent 100%);
    transform: translateX(-65%) rotate(5deg);
    transition: transform 900ms ease;
    pointer-events: none;
}

.auth-landing-block.is-visible .auth-feature-card::after {
    transform: translateX(65%) rotate(5deg);
}

.auth-feature-image {
    width: 100%;
    height: 100%;
    min-height: 240px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    transform: scale(1.03);
    transition: transform 1100ms ease;
}

.auth-landing-block.is-visible .auth-feature-image {
    transform: scale(1);
}

.auth-feature-content {
    text-align: left;
    background: rgba(30, 27, 75, 0.5);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 14px;
    padding: 16px;
}

.auth-feature-card h2 {
    margin: 0 0 8px;
    color: #f8fbff;
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.2;
}

.auth-feature-card p {
    margin: 0;
    color: #e0e7ff;
    font-size: clamp(14px, 1.05vw, 17px);
    line-height: 1.5;
}

@media (min-width: 901px) {
    .auth-landing-block:nth-child(even) {
        justify-content: flex-end;
    }

    .auth-landing-block:nth-child(even) .auth-feature-image {
        order: 2;
    }

    .auth-landing-block:nth-child(even) .auth-feature-content {
        order: 1;
    }
}

.auth-hero-logo {
    width: clamp(216px, 35vw, 468px);
    height: auto;
    opacity: 1;
    filter: drop-shadow(0 14px 30px rgba(7, 17, 46, 0.45));
}

@keyframes logoAuraPulse {
    0%,
    100% {
        opacity: 0.45;
        transform: scale(0.96);
    }
    50% {
        opacity: 0.95;
        transform: scale(1.06);
    }
}

.auth-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(40px, 7vw, 72px);
    line-height: 1.05;
    color: #f8fbff;
    letter-spacing: 1px;
    background: linear-gradient(180deg, #ffffff 0%, #e0e7ff 52%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8),
        0 7px 16px rgba(30, 27, 75, 0.85),
        0 16px 36px rgba(15, 10, 46, 0.75);
}

.auth-hero-title-3d {
    margin: 0 auto;
    text-align: center;
    font-size: clamp(36px, 6.2vw, 72px);
    line-height: 1.08;
    letter-spacing: 0.8px;
    background: linear-gradient(180deg, #ffffff 0%, #e0e7ff 55%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85),
        0 5px 0 rgba(139, 92, 246, 0.72),
        0 12px 22px rgba(30, 27, 75, 0.86),
        0 22px 40px rgba(15, 10, 46, 0.7);
}

.auth-hero-subtitle {
    margin: 0;
    font-size: clamp(18px, 2.2vw, 24px);
    max-width: 860px;
    color: #e0e7ff;
    letter-spacing: 0.3px;
    text-shadow:
        0 2px 0 rgba(255, 255, 255, 0.2),
        0 8px 22px rgba(30, 27, 75, 0.92);
}

.auth-hero-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.auth-hero-features li {
    color: #e0e7ff;
    font-size: clamp(16px, 1.7vw, 20px);
}

.auth-mini-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    width: min(320px, calc(100vw - 32px));
    z-index: 4;
}

.auth-mini-panel summary {
    list-style: none;
}

.auth-mini-panel summary::-webkit-details-marker {
    display: none;
}

.auth-mini-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35), 0 4px 12px rgba(139, 92, 246, 0.25);
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.auth-mini-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.45), 0 6px 16px rgba(139, 92, 246, 0.35);
}

.auth-mini-panel[open] .auth-mini-trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.auth-mini-card,
.profile-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.auth-mini-panel[open] .auth-mini-card {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.auth-tab-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-tab-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 12px;
}

.auth-tab-controls label {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    background: transparent;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-tab-controls label:hover {
    color: #475569;
    background: rgba(255, 255, 255, 0.5);
}

#auth-tab-login:checked ~ .auth-tab-controls label[for='auth-tab-login'],
#auth-tab-register:checked ~ .auth-tab-controls label[for='auth-tab-register'] {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.auth-tab-panels {
    position: relative;
}

.auth-tab-panel {
    display: none;
}

#auth-tab-login:checked ~ .auth-tab-panels .auth-tab-panel-login {
    display: block;
}

#auth-tab-register:checked ~ .auth-tab-panels .auth-tab-panel-register {
    display: block;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form input {
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    transition: all 0.25s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.auth-form button {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.auth-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.auth-form-mini input,
.auth-form-mini button {
    font-size: 13px;
}

.auth-form-mini input {
    padding: 10px 12px;
}

.auth-form-mini button {
    padding: 10px 14px;
}

.auth-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: #475569;
    line-height: 1.4;
}

.auth-consent-row input[type='checkbox'] {
    margin-top: 2px;
    accent-color: #8b5cf6;
    width: 16px;
    height: 16px;
}

.auth-legal-texts {
    display: grid;
    gap: 10px;
}

.auth-legal-block {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    overflow: hidden;
    transition: all 0.25s ease;
}

.auth-legal-block:hover {
    border-color: #cbd5e1;
}

.auth-legal-block summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: #6366f1;
    padding: 10px 12px;
    background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
    transition: all 0.25s ease;
}

.auth-legal-block summary:hover {
    background: linear-gradient(135deg, #ddd6fe 0%, #c7d2fe 100%);
}

.auth-legal-content {
    max-height: 170px;
    overflow: auto;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #475569;
    background: #fff;
}

.auth-legal-content p {
    margin: 0 0 8px;
}

.auth-legal-content p:last-child {
    margin-bottom: 0;
}

.auth-error {
    color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 12px;
    min-height: auto;
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 500;
}

.auth-success {
    color: #166534;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px 12px;
    min-height: auto;
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 500;
}

.auth-info {
    color: #6366f1;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 10px 12px;
    min-height: auto;
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 500;
}

.auth-info a {
    color: #4f46e5;
    font-weight: 600;
}

@media (max-width: 900px) {
    .lang-switch {
        position: static;
        justify-content: center;
        margin-bottom: 12px;
    }

    .feature-slider-track {
        min-height: 305px;
    }

    .feature-slide {
        padding: 22px 18px 18px;
    }

    .feature-slide p {
        max-width: 100%;
    }

    .auth-landing {
        gap: 10px;
    }

    .auth-landing-block {
        min-height: auto;
        opacity: 1;
        transform: none;
        filter: none;
    }

    .auth-feature-card {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
        align-content: start;
    }

    .auth-feature-image {
        min-height: 210px;
        max-height: 250px;
    }

    .auth-feature-content {
        padding: 12px;
    }

    .brand-hero-logo {
        width: 60px;
        height: 60px;
    }

    .auth-page {
        min-height: auto;
        display: block;
        padding-top: 16px;
    }

    .auth-mini-panel {
        position: static;
        width: 100%;
        max-width: 380px;
        margin: 0 auto 20px;
    }

    .auth-hero {
        padding: clamp(255px, 40vh, 350px) 4px 20px;
    }

    .auth-hero-logo {
        width: clamp(168px, 52vw, 280px);
    }
}

.profile-row {
    margin: 12px 0;
    font-size: 16px;
}

/* ===================================================================
   SPECTATOR PAGES — public_spectator / public_spectator_tatami
   =================================================================== */

.spectator-body {
    background: radial-gradient(ellipse at 20% 10%, #1e3a8a 0%, #0f1d4d 40%, #080e2b 100%);
    color: #e5edff;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.spectator-body .page-copyright {
    color: rgba(165, 180, 252, 0.7);
}

/* ---- Hero ---- */
.spectator-hero {
    text-align: center;
    padding: 48px 20px 28px;
    position: relative;
}

.spectator-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, rgba(165, 180, 252, 0.6), transparent);
}

.spectator-hero-title {
    margin: 0 0 6px;
    font-size: clamp(26px, 5vw, 42px);
    font-weight: 700;
    line-height: 1.15;
    background: linear-gradient(180deg, #ffffff 0%, #e0e7ff 55%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.spectator-hero-meta {
    margin: 0;
    font-size: clamp(13px, 1.8vw, 16px);
    color: #c7d2fe;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
}

.spectator-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ---- Status badge ---- */
.spectator-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(165, 180, 252, 0.35);
    backdrop-filter: blur(6px);
}

.spectator-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    animation: specDotPulse 1.8s ease-in-out infinite;
}

@keyframes specDotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

/* ---- QR link bar ---- */
.spectator-qr-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 16px;
    margin: 0 auto 8px;
    max-width: 760px;
    border-radius: 12px;
    background: rgba(30, 58, 138, 0.45);
    border: 1px solid rgba(165, 180, 252, 0.2);
    backdrop-filter: blur(6px);
    font-size: 13px;
    color: #c7d2fe;
}

.spectator-qr-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.spectator-qr-bar a {
    color: #a5b4fc;
    text-decoration: none;
    word-break: break-all;
    font-weight: 600;
}

.spectator-qr-bar a:hover {
    text-decoration: underline;
    color: #c7d2fe;
}

.spectator-copy-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.35);
    border: 1px solid rgba(165, 180, 252, 0.35);
    color: #e0e7ff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.spectator-copy-btn:hover {
    background: rgba(99, 102, 241, 0.55);
}

.spectator-qr-code-wrap {
    flex: 0 0 auto;
    width: 96px;
    height: 96px;
    border-radius: 10px;
    border: 1px solid rgba(165, 180, 252, 0.3);
    background: rgba(255, 255, 255, 0.96);
    padding: 6px;
}

.spectator-share-qr {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 6px;
}

.spectator-qr-note {
    max-width: 760px;
    margin: 0 auto 16px;
    padding: 0 2px;
    font-size: 12px;
    color: #a5b4fc;
    text-align: center;
}

/* ---- Participant search ---- */
.spectator-search-box {
    max-width: 760px;
    margin: 0 auto 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(30, 58, 138, 0.38);
    border: 1px solid rgba(165, 180, 252, 0.22);
    backdrop-filter: blur(6px);
}

.spectator-search-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #e0e7ff;
}

.spectator-search-hint {
    margin: 4px 0 10px;
    font-size: 13px;
    color: #c7d2fe;
}

.spectator-search-mode-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.spectator-search-mode-btn {
    border-radius: 10px;
    border: 1px solid rgba(165, 180, 252, 0.35);
    background: rgba(15, 23, 42, 0.65);
    color: #e0e7ff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 10px;
    min-height: 40px;
    cursor: pointer;
}

.spectator-search-mode-btn.is-active {
    border-color: rgba(74, 222, 128, 0.75);
    background: rgba(22, 163, 74, 0.35);
    color: #dcfce7;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

.spectator-search-form {
    display: flex;
    gap: 8px;
}

.spectator-search-form input {
    flex: 1;
    min-width: 0;
    border-radius: 10px;
    border: 1px solid rgba(165, 180, 252, 0.35);
    background: rgba(15, 23, 42, 0.65);
    color: #e0e7ff;
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
}

.spectator-search-form input::placeholder {
    color: #94a3b8;
}

.spectator-search-form input:focus {
    border-color: rgba(165, 180, 252, 0.6);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.spectator-search-form button {
    flex: 0 0 auto;
    border-radius: 10px;
    border: 1px solid rgba(165, 180, 252, 0.4);
    background: rgba(99, 102, 241, 0.45);
    color: #f8fbff;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 14px;
    min-height: 42px;
    cursor: pointer;
}

.spectator-search-form button:disabled {
    opacity: 0.75;
    cursor: default;
}

.spectator-search-result {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.22);
    min-height: 20px;
}

.spectator-search-result-name {
    font-size: 15px;
    font-weight: 700;
    color: #f8fbff;
    margin-bottom: 4px;
}

.spectator-search-result-line + .spectator-search-result-line {
    margin-top: 3px;
}

.spectator-search-result-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.spectator-search-result-list li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.3);
}

.spectator-search-item-name {
    font-size: 14px;
    font-weight: 700;
    color: #f8fbff;
}

.spectator-search-item-meta {
    font-size: 12px;
    color: #c7d2fe;
}

.spectator-search-result-list small {
    color: #c7d2fe;
    font-size: 12px;
}

.spectator-search-result.is-success {
    border-color: rgba(52, 211, 153, 0.5);
    background: rgba(16, 185, 129, 0.14);
    color: #dcfce7;
}

.spectator-search-result.is-error {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(127, 29, 29, 0.24);
    color: #fecaca;
}

.spectator-search-result.is-empty {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(120, 53, 15, 0.24);
    color: #fde68a;
}

/* ---- Section headings ---- */
.spectator-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 16px;
    font-size: clamp(16px, 2.2vw, 20px);
    font-weight: 700;
    color: #e0e7ff;
    padding: 0 20px;
}

.spectator-section-title::before,
.spectator-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(165, 180, 252, 0.3), transparent);
}

/* ---- Nav links row ---- */
.spectator-nav-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    margin-bottom: 8px;
}

.spectator-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid rgba(165, 180, 252, 0.3);
    background: rgba(30, 58, 138, 0.35);
    backdrop-filter: blur(6px);
    color: #c7d2fe;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.spectator-nav-link:hover {
    background: rgba(99, 102, 241, 0.35);
    border-color: rgba(165, 180, 252, 0.5);
    color: #e0e7ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
}

/* ---- Tatami grid ---- */
.spectator-tatami-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 0 20px;
}

.spectator-tatami-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(30, 58, 138, 0.55), rgba(15, 23, 42, 0.6));
    border: 1px solid rgba(165, 180, 252, 0.2);
    backdrop-filter: blur(8px);
    text-decoration: none;
    color: #e0e7ff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.spectator-tatami-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.12), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.spectator-tatami-card:hover::before {
    opacity: 1;
}

.spectator-tatami-card:hover {
    border-color: rgba(165, 180, 252, 0.45);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(8, 14, 43, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.spectator-tatami-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    flex-shrink: 0;
}

.spectator-tatami-name {
    font-size: clamp(16px, 2vw, 19px);
    font-weight: 700;
    color: #f8fbff;
}

.spectator-tatami-hint {
    font-size: 13px;
    color: #94a3b8;
    margin-top: -4px;
}

.spectator-tatami-arrow {
    margin-left: auto;
    font-size: 20px;
    color: rgba(165, 180, 252, 0.5);
    transition: all 0.25s ease;
}

.spectator-tatami-card:hover .spectator-tatami-arrow {
    color: #a5b4fc;
    transform: translateX(4px);
}

.spectator-tatami-card-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.spectator-tatami-info {
    flex: 1;
    min-width: 0;
}

/* ---- Empty state ---- */
.spectator-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 15px;
}

.spectator-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ---- Tatami detail page ---- */
.spectator-tatami-hero {
    text-align: center;
    padding: 36px 20px 20px;
}

.spectator-tatami-hero-title {
    margin: 0 0 4px;
    font-size: clamp(22px, 4.5vw, 36px);
    font-weight: 700;
    color: #f8fbff;
}

.spectator-tatami-hero-sub {
    margin: 0;
    font-size: 14px;
    color: #94a3b8;
}

.spectator-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 16px 20px 0;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(30, 58, 138, 0.35);
    border: 1px solid rgba(165, 180, 252, 0.2);
    color: #a5b4fc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.spectator-back-link:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
}

/* ---- Tabs ---- */
.spectator-tabs {
    display: flex;
    gap: 0;
    margin: 20px 20px 0;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 14px 14px 0 0;
    border: 1px solid rgba(165, 180, 252, 0.15);
    border-bottom: none;
    overflow: hidden;
}

.spectator-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.spectator-tab:hover {
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.1);
}

.spectator-tab.is-active {
    color: #f8fbff;
    background: rgba(99, 102, 241, 0.25);
}

.spectator-tab.is-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
}

/* ---- Tab panels ---- */
.spectator-panels {
    margin: 0 20px 24px;
    border: 1px solid rgba(165, 180, 252, 0.15);
    border-top: none;
    border-radius: 0 0 14px 14px;
    background: rgba(15, 23, 42, 0.35);
    overflow: hidden;
}

.spectator-panel {
    display: none;
    min-height: 400px;
}

.spectator-panel.is-active {
    display: block;
}

.spectator-panel iframe {
    width: 100%;
    min-height: 520px;
    border: none;
    background: #fff;
    display: block;
}

/* ---- Direct links (under tabs) ---- */
.spectator-direct-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    margin-bottom: 28px;
}

.spectator-direct-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    text-decoration: none;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.2s ease;
}

.spectator-direct-link:hover {
    color: #c7d2fe;
    border-color: rgba(165, 180, 252, 0.4);
    background: rgba(99, 102, 241, 0.15);
}

/* ---- Responsive ---- */

/* --- Tablet / medium screens --- */
@media (max-width: 768px) {
    .spectator-body {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .spectator-hero {
        padding: 40px 16px 24px;
    }

    .spectator-hero-title {
        font-size: clamp(22px, 5.5vw, 34px);
    }

    .spectator-tatami-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 0 16px;
    }

    .spectator-tatami-card {
        padding: 16px;
    }

    .spectator-tatami-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 20px;
    }

    .spectator-nav-link {
        padding: 10px 16px;
        font-size: 13px;
    }

    .spectator-tabs {
        margin: 16px 16px 0;
    }

    .spectator-panels {
        margin: 0 16px 20px;
    }

    .spectator-panel iframe {
        min-height: 480px;
    }

    .spectator-search-box {
        margin: 0 16px 14px;
        max-width: none;
    }

    .spectator-direct-links {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .spectator-direct-link {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 10px 12px;
    }
}

/* --- Phone screens --- */
@media (max-width: 480px) {
    .spectator-body {
        -webkit-tap-highlight-color: transparent;
        -webkit-text-size-adjust: 100%;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* Hero */
    .spectator-hero {
        padding: 28px 14px 18px;
    }

    .spectator-hero::after {
        width: 80px;
        height: 2px;
    }

    .spectator-hero-title {
        font-size: clamp(20px, 6vw, 28px);
        line-height: 1.2;
    }

    .spectator-hero-meta {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 13px;
    }

    .spectator-status {
        margin-top: 10px;
        padding: 5px 12px;
        font-size: 12px;
    }

    /* QR bar */
    .spectator-qr-bar {
        margin: 0 12px 16px;
        padding: 10px 12px;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 8px;
        border-radius: 10px;
        font-size: 12px;
    }

    .spectator-qr-main {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .spectator-qr-bar a {
        font-size: 11px;
        line-height: 1.4;
        display: block;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
        white-space: normal;
    }

    .spectator-qr-code-wrap {
        width: 132px;
        height: 132px;
        margin: 0 auto;
    }

    .spectator-copy-btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 8px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .spectator-qr-note {
        margin: 0 12px 12px;
        font-size: 11px;
    }

    /* Nav row — full width stacked buttons */
    .spectator-nav-row {
        padding: 0 12px;
        gap: 8px;
        margin-bottom: 6px;
    }

    .spectator-nav-link {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        padding: 12px 8px;
        font-size: 13px;
        border-radius: 10px;
        min-height: 44px;
    }

    /* Section title */
    .spectator-section-title {
        padding: 0 12px;
        margin: 20px 0 12px;
        font-size: 15px;
        gap: 8px;
    }

    /* Tatami grid — single column, full width touch cards */
    .spectator-tatami-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 12px;
    }

    .spectator-tatami-card {
        padding: 16px 14px;
        border-radius: 14px;
        min-height: 64px;
        -webkit-tap-highlight-color: transparent;
    }

    .spectator-tatami-card-inner {
        gap: 12px !important;
    }

    .spectator-tatami-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        font-size: 22px;
    }

    .spectator-tatami-name {
        font-size: 16px;
    }

    .spectator-tatami-hint {
        font-size: 12px;
    }

    .spectator-tatami-arrow {
        font-size: 18px;
        display: none;
    }

    /* Empty state */
    .spectator-empty {
        padding: 32px 16px;
        font-size: 14px;
    }

    .spectator-empty-icon {
        font-size: 40px;
    }

    /* --- Tatami detail page --- */
    .spectator-back-link {
        margin: 0 12px;
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
        border-radius: 10px;
        position: sticky;
        top: calc(env(safe-area-inset-top, 0px) + 8px);
        z-index: 40;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .spectator-tatami-hero {
        padding: 16px 14px 12px;
    }

    .spectator-tatami-hero-title {
        font-size: clamp(20px, 5.5vw, 30px);
    }

    .spectator-tatami-hero-sub {
        font-size: 13px;
    }

    /* Tabs — bottom-fixed on mobile for thumb reach */
    .spectator-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        z-index: 100;
        border-radius: 0;
        border: none;
        border-top: 1px solid rgba(165, 180, 252, 0.2);
        background: rgba(8, 14, 43, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .spectator-tab {
        padding: 10px 6px 12px;
        font-size: 12px;
        flex-direction: column;
        gap: 2px;
        min-height: 52px;
    }

    .spectator-tab-icon {
        font-size: 18px;
        line-height: 1;
    }

    .spectator-tab-label {
        font-size: 10px;
        line-height: 1;
    }

    .spectator-tab.is-active::after {
        top: 0;
        bottom: auto;
        left: 15%;
        right: 15%;
        border-radius: 0 0 3px 3px;
    }

    /* Panels — full-width, no margin, account for bottom tab bar */
    .spectator-panels {
        margin: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        margin-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    .spectator-body.spectator-board-focus .spectator-back-link,
    .spectator-body.spectator-board-focus .spectator-tatami-hero,
    .spectator-body.spectator-board-focus .spectator-direct-links {
        display: none;
    }

    .spectator-body.spectator-board-focus .spectator-panels {
        margin-top: 0;
    }

    .spectator-panel {
        min-height: clamp(360px, calc(100dvh - 220px), 100dvh);
    }

    .spectator-panel iframe {
        min-height: clamp(360px, calc(100dvh - 220px), 100dvh);
        height: clamp(360px, calc(100dvh - 220px), 100dvh);
        border-radius: 0;
    }

    #panel-board.spectator-panel {
        min-height: clamp(420px, calc(100dvh - 150px), 100dvh);
    }

    #panel-board.spectator-panel iframe {
        min-height: clamp(420px, calc(100dvh - 150px), 100dvh);
        height: clamp(420px, calc(100dvh - 150px), 100dvh);
    }

    /* Fullscreen mode for iframe */
    .spectator-panel.is-fullscreen {
        position: fixed;
        inset: 0;
        z-index: 200;
        min-height: 100dvh;
        background: #fff;
    }

    .spectator-panel.is-fullscreen iframe {
        min-height: 100dvh;
        height: 100dvh;
    }

    /* Direct links — compact row */
    .spectator-direct-links {
        padding: 0 12px;
        gap: 8px;
        margin-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    }

    .spectator-direct-link {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        text-align: center;
        padding: 10px 6px;
        font-size: 11px;
        border-radius: 8px;
        min-height: 40px;
    }

    /* Fullscreen toggle button */
    .spectator-fullscreen-btn {
        position: absolute;
        top: 8px;
        right: 8px;
        z-index: 10;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: 1px solid rgba(165, 180, 252, 0.3);
        background: rgba(8, 14, 43, 0.8);
        backdrop-filter: blur(6px);
        color: #c7d2fe;
        font-size: 16px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    .spectator-fullscreen-btn:hover {
        background: rgba(99, 102, 241, 0.5);
    }

    /* Footer — hidden on tatami detail (tabs cover it) */
    .spectator-body:has(.spectator-tabs) .page-copyright {
        display: none;
    }

    .spectator-search-box {
        margin: 0 12px 12px;
        padding: 12px;
        border-radius: 12px;
    }

    .spectator-search-title {
        font-size: 15px;
    }

    .spectator-search-hint {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .spectator-search-form {
        flex-direction: column;
        gap: 7px;
    }

    .spectator-search-mode-buttons {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .spectator-search-mode-btn,
    .spectator-search-form input,
    .spectator-search-form button {
        width: 100%;
        min-height: 40px;
        font-size: 14px;
    }

    .spectator-search-result {
        font-size: 12px;
    }
}

/* --- Tiny phones (320px) --- */
@media (max-width: 360px) {
    .spectator-hero {
        padding: 22px 10px 16px;
    }

    .spectator-hero-title {
        font-size: 20px;
    }

    .spectator-nav-row {
        flex-direction: column;
        padding: 0 10px;
    }

    .spectator-nav-link {
        width: 100%;
    }

    .spectator-tatami-grid {
        padding: 0 10px;
    }

    .spectator-tab {
        font-size: 11px;
        padding: 8px 4px 10px;
    }

    .spectator-tab-label {
        font-size: 9px;
    }

    .spectator-qr-bar {
        margin: 0 10px 14px;
    }

    .spectator-qr-note {
        margin: 0 10px 12px;
    }

    .spectator-direct-link {
        font-size: 10px;
        padding: 8px 4px;
    }
}

/* --- Landscape phone --- */
@media (max-height: 500px) and (orientation: landscape) {
    .spectator-hero {
        padding: 14px 14px 10px;
    }

    .spectator-hero-title {
        font-size: 20px;
        line-height: 1.15;
    }

    .spectator-hero-meta {
        font-size: 12px;
        gap: 4px 10px;
    }

    .spectator-status {
        margin-top: 8px;
        padding: 4px 10px;
        font-size: 11px;
    }

    .spectator-qr-bar {
        margin: 0 12px 10px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .spectator-qr-main {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .spectator-qr-code-wrap {
        width: 72px;
        height: 72px;
        padding: 4px;
        border-radius: 8px;
    }

    .spectator-copy-btn {
        min-height: 34px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .spectator-qr-note {
        margin: 0 12px 8px;
        font-size: 11px;
    }

    .spectator-search-box {
        margin: 0 12px 10px;
        padding: 8px 10px;
        border-radius: 10px;
    }

    .spectator-search-title {
        font-size: 13px;
    }

    .spectator-search-hint {
        margin: 2px 0 6px;
        font-size: 11px;
    }

    .spectator-search-form input,
    .spectator-search-form button {
        min-height: 34px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .spectator-search-result {
        margin-top: 6px;
        padding: 7px 9px;
        font-size: 11px;
    }

    .spectator-section-title {
        margin: 14px 0 10px;
        padding: 0 12px;
    }

    .spectator-tatami-hero {
        padding: 8px 12px 6px;
    }

    .spectator-tatami-hero-title {
        font-size: 20px;
        line-height: 1.1;
    }

    .spectator-tatami-hero-sub {
        font-size: 12px;
    }

    .spectator-back-link {
        margin: 8px 12px 0;
        padding: 6px 10px;
        min-height: 34px;
        font-size: 12px;
        border-radius: 8px;
    }

    .spectator-tatami-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 0 12px;
    }

    .spectator-tatami-card {
        padding: 12px;
        border-radius: 12px;
        min-height: 52px;
    }

    .spectator-tatami-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 17px;
    }

    .spectator-tatami-name {
        font-size: 14px;
    }

    .spectator-tatami-hint {
        display: none;
    }

    .spectator-tabs {
        margin: 8px 12px 0;
    }

    .spectator-tab {
        flex-direction: row;
        gap: 5px;
        padding: 8px 10px;
        min-height: 36px;
    }

    .spectator-panels {
        margin: 0 12px 8px;
    }

    .spectator-panel {
        min-height: calc(100dvh - 128px);
    }

    .spectator-panel iframe {
        min-height: calc(100dvh - 128px);
        height: calc(100dvh - 128px);
    }

    #panel-board.spectator-panel {
        min-height: calc(100dvh - 118px);
    }

    #panel-board.spectator-panel iframe {
        min-height: calc(100dvh - 118px);
        height: calc(100dvh - 118px);
    }

    .spectator-direct-links {
        gap: 6px;
        padding: 0 12px;
        margin-bottom: 10px;
    }

    .spectator-direct-link {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 32px;
    }
}

@media (max-width: 950px) and (max-height: 450px) and (orientation: landscape) {
    .spectator-tatami-hero-sub {
        display: none;
    }

    .spectator-panel,
    .spectator-panel iframe {
        min-height: calc(100dvh - 106px);
        height: calc(100dvh - 106px);
    }

    #panel-board.spectator-panel,
    #panel-board.spectator-panel iframe {
        min-height: calc(100dvh - 96px);
        height: calc(100dvh - 96px);
    }
}

/* --- Touch-friendly active states --- */
@media (hover: none) and (pointer: coarse) {
    .spectator-tatami-card:active {
        transform: scale(0.97);
        border-color: rgba(165, 180, 252, 0.5);
        background: linear-gradient(145deg, rgba(30, 58, 138, 0.7), rgba(15, 23, 42, 0.75));
        transition: all 0.1s ease;
    }

    .spectator-nav-link:active {
        transform: scale(0.96);
        background: rgba(99, 102, 241, 0.4);
        transition: all 0.1s ease;
    }

    .spectator-tab:active {
        background: rgba(99, 102, 241, 0.3);
    }

    .spectator-direct-link:active {
        background: rgba(99, 102, 241, 0.2);
        transform: scale(0.97);
    }

    .spectator-back-link:active {
        background: rgba(99, 102, 241, 0.35);
        transform: scale(0.97);
    }

    .spectator-copy-btn:active {
        background: rgba(99, 102, 241, 0.6);
        transform: scale(0.97);
    }
}
/* --- Parent Student Progress Module --- */
.psp-wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 16px 0;
}

.psp-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

.psp-kpi-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.psp-kpi-card:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.15));
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.psp-kpi-value {
    font-size: 32px;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 4px;
}

.psp-kpi-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.psp-chart-card {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.5), rgba(15, 23, 42, 0.6));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 380px;
}

.psp-chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.students-summary {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    color: #e5e7eb;
    white-space: nowrap;
}

.psp-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    padding: 20px;
    font-style: italic;
}

.psp-plan-item {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid #3b82f6;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.psp-plan-item:hover {
    background: rgba(99, 102, 241, 0.12);
    transform: translateX(4px);
}

.psp-plan-item:last-child {
    margin-bottom: 0;
}

.psp-plan-meta {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.psp-plan-text {
    font-size: 13px;
    color: #d1d5db;
    line-height: 1.4;
}

.psp-plan-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.psp-plan-list::-webkit-scrollbar {
    width: 6px;
}

.psp-plan-list::-webkit-scrollbar-track {
    background: rgba(99, 102, 241, 0.08);
    border-radius: 3px;
}

.psp-plan-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

.psp-plan-list::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

.student-profile-wrap {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 8px 0;
}

.student-profile-presentation {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.student-profile-hero-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px;
    align-items: center;
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 14px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.18), rgba(30, 41, 59, 0.5));
}

.student-profile-hero-photo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-profile-hero-photo,
.student-profile-hero-photo-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.45);
}

.student-profile-hero-photo {
    object-fit: cover;
    background: #0f172a;
}

.student-profile-hero-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.45), rgba(14, 116, 144, 0.45));
    color: #e2e8f0;
    font-size: 30px;
    font-weight: 700;
}

.student-profile-hero-content {
    min-width: 0;
}

.student-profile-hero-title {
    margin: 0 0 8px;
    color: #f8fafc;
    font-size: 24px;
    line-height: 1.2;
}

.student-profile-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.student-profile-metrics-presentation .student-profile-metric-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(14, 116, 144, 0.2));
}

.student-profile-metric-card {
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}

.student-profile-metric-value {
    font-size: 26px;
    font-weight: 700;
    color: #dbeafe;
    margin-bottom: 4px;
}

.student-profile-metric-label {
    font-size: 12px;
    color: #cbd5e1;
}

.student-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.student-profile-card {
    border: 1px solid rgba(99, 102, 241, 0.24);
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 14px;
}

.student-profile-card h3 {
    margin: 0 0 12px;
    color: #e2e8f0;
    font-size: 15px;
}

.student-profile-dl {
    margin: 0;
    display: grid;
    gap: 8px;
}

.student-profile-dl div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px;
    align-items: baseline;
}

.student-profile-dl dt {
    color: #94a3b8;
    font-size: 12px;
}

.student-profile-dl dd {
    margin: 0;
    color: #e2e8f0;
    font-size: 13px;
}

.student-profile-list {
    display: grid;
    gap: 8px;
}

.student-profile-list-item {
    border: 1px solid rgba(99, 102, 241, 0.24);
    background: rgba(30, 41, 59, 0.45);
    border-radius: 10px;
    padding: 10px;
}

.student-profile-list-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    color: #f8fafc;
}

.student-profile-list-meta {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
}

.student-profile-rank-badge {
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 999px;
    padding: 2px 8px;
    color: #e2e8f0;
    font-size: 11px;
    white-space: nowrap;
}

.student-profile-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.student-profile-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.35);
}

.student-profile-table th,
.student-profile-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.18);
    text-align: left;
    vertical-align: middle;
}

.student-profile-table tbody tr:last-child th,
.student-profile-table tbody tr:last-child td {
    border-bottom: 0;
}

.student-profile-table th {
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 600;
    width: 40%;
    background: rgba(30, 41, 59, 0.45);
}

.student-profile-table td {
    color: #f1f5f9;
    font-size: 13px;
}

.student-profile-table-compact thead th {
    width: auto;
    background: rgba(51, 65, 85, 0.5);
    color: #e2e8f0;
    font-size: 12px;
}

@media (max-width: 768px) {
    .student-profile-hero-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .student-profile-hero-content .students-summary {
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════════════════
   Student Profile v2  (parent_student_profile)
═══════════════════════════════════════════════════════════ */
.spv2-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 900px;
}

/* ── Child tabs ─────────────────────────────────────────── */
.spv2-child-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.spv2-child-tab {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    background: rgba(30, 41, 59, 0.5);
    color: #94a3b8;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    cursor: pointer;
}

.spv2-child-tab:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #e2e8f0;
    border-color: rgba(99, 102, 241, 0.7);
}

.spv2-child-tab--active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.5), rgba(14, 116, 144, 0.4));
    border-color: rgba(99, 102, 241, 0.8);
    color: #f1f5f9;
    font-weight: 600;
}

/* ── Hero ────────────────────────────────────────────────── */
.spv2-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: linear-gradient(135deg, rgba(23, 37, 84, 0.65), rgba(15, 23, 42, 0.8));
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}

.spv2-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 60% at 0% 0%, rgba(99, 102, 241, 0.12), transparent);
    pointer-events: none;
}

.spv2-hero-photo-col {
    flex-shrink: 0;
}

.spv2-photo,
.spv2-photo-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 3px solid rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 4px 16px rgba(0,0,0,0.4);
    display: block;
}

.spv2-photo {
    object-fit: cover;
}

.spv2-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.5), rgba(14, 116, 144, 0.5));
    color: #e2e8f0;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
}

.spv2-hero-info {
    min-width: 0;
    flex: 1;
}

.spv2-hero-name {
    font-size: 26px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.2;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.spv2-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.spv2-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(30, 41, 59, 0.6);
    color: #cbd5e1;
    font-size: 12.5px;
    white-space: nowrap;
}

.spv2-chip--kyu {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    font-weight: 600;
}

/* ── Stats row ───────────────────────────────────────────── */
.spv2-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.spv2-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(99, 102, 241, 0.28);
    background: rgba(15, 23, 42, 0.55);
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
}

.spv2-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.spv2-stat-icon {
    font-size: 22px;
    line-height: 1;
}

.spv2-stat-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
}

.spv2-stat-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* color accents per stat */
.spv2-stat--trainings {
    border-color: rgba(59, 130, 246, 0.4);
    background: linear-gradient(160deg, rgba(37, 99, 235, 0.18), rgba(15, 23, 42, 0.55));
}
.spv2-stat--trainings .spv2-stat-value { color: #60a5fa; }

.spv2-stat--camps {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(160deg, rgba(5, 150, 105, 0.18), rgba(15, 23, 42, 0.55));
}
.spv2-stat--camps .spv2-stat-value { color: #34d399; }

.spv2-stat--attest {
    border-color: rgba(168, 85, 247, 0.4);
    background: linear-gradient(160deg, rgba(124, 58, 237, 0.18), rgba(15, 23, 42, 0.55));
}
.spv2-stat--attest .spv2-stat-value { color: #c084fc; }

.spv2-stat--tournaments {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(160deg, rgba(217, 119, 6, 0.18), rgba(15, 23, 42, 0.55));
}
.spv2-stat--tournaments .spv2-stat-value { color: #fbbf24; }

/* ── Details grid ────────────────────────────────────────── */
.spv2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.spv2-card {
    border: 1px solid rgba(99, 102, 241, 0.22);
    background: rgba(15, 23, 42, 0.5);
    border-radius: 14px;
    padding: 16px;
}

.spv2-card-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    padding-bottom: 10px;
}

.spv2-card-icon {
    font-size: 16px;
}

/* ── Tables ──────────────────────────────────────────────── */
.spv2-table {
    width: 100%;
    border-collapse: collapse;
}

.spv2-table th,
.spv2-table td {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

.spv2-table tbody tr:last-child th,
.spv2-table tbody tr:last-child td {
    border-bottom: 0;
}

.spv2-table th {
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    width: 38%;
    white-space: nowrap;
}

.spv2-table td {
    color: #e2e8f0;
}

.spv2-table tbody tr:hover td,
.spv2-table tbody tr:hover th {
    background: rgba(99, 102, 241, 0.07);
}

.spv2-table--compact .spv2-td-date {
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
}

.spv2-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.spv2-table--compact th {
    width: auto;
    background: rgba(30, 41, 59, 0.5);
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.spv2-table--compact td {
    font-size: 12.5px;
}

/* ── Medal badges ────────────────────────────────────────── */
.spv2-medal {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.6);
    white-space: nowrap;
}

.spv2-medal--gold {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(251, 191, 36, 0.15));
    border-color: rgba(234, 179, 8, 0.6);
    color: #fde047;
}

.spv2-medal--silver {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.25), rgba(203, 213, 225, 0.15));
    border-color: rgba(148, 163, 184, 0.6);
    color: #e2e8f0;
}

.spv2-medal--bronze {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.25), rgba(217, 119, 6, 0.15));
    border-color: rgba(180, 83, 9, 0.6);
    color: #fdba74;
}

/* ── Empty state & footer ────────────────────────────────── */
.spv2-empty {
    color: #475569;
    font-size: 13px;
    padding: 20px 0;
    text-align: center;
}

.spv2-footer {
    color: #334155;
    font-size: 11px;
    text-align: right;
    padding-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   parent_child_overview  (.pco-*)
   ═══════════════════════════════════════════════════════════ */
.pco-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── child switcher ─────────────────────────────────────── */
.pco-child-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 0 2px;
}

.pco-child-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--border, #e2e8f0);
    background: #fff;
    color: var(--muted, #64748b);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .14s, border-color .14s, color .14s;
    cursor: pointer;
}

.pco-child-tab:hover {
    border-color: var(--accent, #059669);
    color: var(--accent, #059669);
    background: var(--accent-bg, #ecfdf5);
}

.pco-child-tab--active {
    background: var(--accent-grd, linear-gradient(135deg,#059669,#34d399));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(5,150,105,.3);
}

/* ── profile card ───────────────────────────────────────── */
.pco-profile-card {
    background: #fff;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 4px 16px rgba(15,23,42,.06),
        inset 0 1px 0 rgba(255,255,255,.8);
}

.pco-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 24px 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-bottom: 1px solid var(--border, #e2e8f0);
}

/* avatar */
.pco-avatar {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow:
        0 0 0 3px var(--accent, #059669),
        0 4px 16px rgba(5,150,105,.25);
    display: block;
}

.pco-avatar-placeholder {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent, #059669), #34d399);
    border: 3px solid #fff;
    box-shadow:
        0 0 0 3px var(--accent, #059669),
        0 4px 16px rgba(5,150,105,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}

.pco-profile-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pco-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text, #0f172a);
    line-height: 1.2;
}

.pco-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pco-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 11px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    font-size: .75rem;
    font-weight: 600;
    color: var(--text, #0f172a);
    white-space: nowrap;
}

.pco-chip--kyu {
    background: linear-gradient(135deg, #fef3c7, #fef9c3);
    border-color: #fde68a;
    color: #92400e;
}

.pco-chip--group {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.pco-chip--city {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

/* info table inside profile card */
.pco-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .83rem;
}

.pco-info-table tr:not(:last-child) td,
.pco-info-table tr:not(:last-child) th {
    border-bottom: 1px solid #f1f5f9;
}

.pco-info-table th {
    width: 44%;
    padding: 9px 16px 9px 24px;
    text-align: left;
    font-weight: 600;
    color: var(--muted, #64748b);
    white-space: nowrap;
    background: #fafafa;
}

.pco-info-table td {
    padding: 9px 16px 9px 0;
    color: var(--text, #0f172a);
    font-weight: 500;
}

.pco-info-table td .pco-val-empty {
    color: #cbd5e1;
    font-style: italic;
}

/* ── metrics grid ───────────────────────────────────────── */
.pco-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.pco-metric {
    background: #fff;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 14px;
    padding: 14px 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    transition: transform .14s, box-shadow .14s;
}

.pco-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15,23,42,.08);
}

.pco-metric-icon { font-size: 22px; line-height: 1; }

.pco-metric-val {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.5px;
}

.pco-metric-lbl {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted, #64748b);
}

.pco-metric--trainings { border-color: #bfdbfe; background: #eff6ff; }
.pco-metric--trainings .pco-metric-val { color: #1d4ed8; }

.pco-metric--camps { border-color: #bbf7d0; background: #f0fdf4; }
.pco-metric--camps .pco-metric-val { color: #166534; }

.pco-metric--attest { border-color: #fde68a; background: #fffbeb; }
.pco-metric--attest .pco-metric-val { color: #92400e; }

.pco-metric--tournaments { border-color: #e9d5ff; background: #faf5ff; }
.pco-metric--tournaments .pco-metric-val { color: #6d28d9; }

/* ── progress KPI ────────────────────────────────────────── */
.pco-kpi-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.pco-kpi {
    background: #fff;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow .15s;
}

.pco-kpi:hover { box-shadow: 0 4px 14px rgba(15,23,42,.07); }

.pco-kpi-icon-wrap {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.pco-kpi-icon-wrap--attend { background: #eff6ff; }
.pco-kpi-icon-wrap--hw     { background: #fffbeb; }
.pco-kpi-icon-wrap--tourn  { background: #faf5ff; }
.pco-kpi-icon-wrap--events { background: #ecfdf5; }

.pco-kpi-body { flex: 1; min-width: 0; }

.pco-kpi-val {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.5px;
}

.pco-kpi-val--attend  { color: #2563eb; }
.pco-kpi-val--hw      { color: #d97706; }
.pco-kpi-val--tourn   { color: #7c3aed; }
.pco-kpi-val--events  { color: #059669; }

.pco-kpi-lbl {
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted, #64748b);
    margin-top: 2px;
}

/* progress bar */
.pco-progress-bar-wrap {
    margin-top: 6px;
    height: 5px;
    border-radius: 99px;
    background: #f1f5f9;
    overflow: hidden;
}

.pco-progress-bar {
    height: 100%;
    border-radius: 99px;
    transition: width .5s ease;
}

.pco-progress-bar--attend { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.pco-progress-bar--hw     { background: linear-gradient(90deg, #d97706, #fbbf24); }

/* ── section heading ─────────────────────────────────────── */
.pco-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted, #64748b);
    padding: 0 2px;
}

.pco-section-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #e2e8f0);
}

/* ── charts ──────────────────────────────────────────────── */
.pco-chart-card {
    background: #fff;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 16px;
    padding: 16px 18px 14px;
    display: flex;
    flex-direction: column;
    height: 220px;
}

.pco-chart-title {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text, #0f172a);
    margin-bottom: 10px;
    letter-spacing: .01em;
}

.pco-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── achievements ────────────────────────────────────────── */
.pco-achievement-card {
    background: #fff;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
}

.pco-achievement-card-head {
    padding: 12px 18px;
    font-size: .8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
}

.pco-ach-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

.pco-ach-table th {
    padding: 8px 14px;
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted, #64748b);
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.pco-ach-table td {
    padding: 8px 14px;
    border-bottom: 1px solid #f8fafc;
    color: var(--text, #0f172a);
    vertical-align: middle;
}

.pco-ach-table tr:last-child td { border-bottom: none; }

.pco-ach-table tr:hover td { background: #f8fafc; }

.pco-medal {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}

.pco-medal--gold   { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.pco-medal--silver { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.pco-medal--bronze { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.pco-medal--part   { background: #f8fafc; color: #94a3b8; border: 1px solid #e2e8f0; }

.pco-ach-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--muted, #94a3b8);
    font-size: .82rem;
}

/* ── homework plans ──────────────────────────────────────── */
.pco-plans-card {
    background: #fff;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
}

.pco-plans-head {
    padding: 12px 18px;
    font-size: .8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
}

.pco-plans-stat {
    font-size: .73rem;
    font-weight: 600;
    color: var(--muted, #64748b);
    background: #f1f5f9;
    border-radius: 999px;
    padding: 2px 10px;
}

.pco-plan-list { display: flex; flex-direction: column; }

.pco-plan-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 18px;
    border-bottom: 1px solid #f8fafc;
    transition: background .12s;
}

.pco-plan-item:last-child { border-bottom: none; }
.pco-plan-item:hover { background: #f8fafc; }

.pco-plan-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent, #059669);
    margin-top: 5px;
}

.pco-plan-body { flex: 1; min-width: 0; }

.pco-plan-date {
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted, #64748b);
    margin-bottom: 2px;
}

.pco-plan-text {
    font-size: .82rem;
    color: var(--text, #0f172a);
    line-height: 1.45;
}

/* ── footer ──────────────────────────────────────────────── */
.pco-footer {
    font-size: .72rem;
    color: #cbd5e1;
    text-align: right;
    padding: 2px 0 4px;
}

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .pco-profile-header { flex-direction: column; align-items: center; text-align: center; }
    .pco-chips { justify-content: center; }
    .pco-metrics { grid-template-columns: repeat(2, 1fr); }
    .pco-kpi-row { grid-template-columns: 1fr; }
    .pco-charts-row { grid-template-columns: 1fr; }
    .pco-avatar, .pco-avatar-placeholder { width: 72px; height: 72px; }
    .pco-avatar-placeholder { font-size: 26px; }
}

@media (max-width: 420px) {
    .pco-metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .spv2-hero {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .spv2-hero-chips {
        justify-content: center;
    }

    .spv2-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .spv2-hero-name {
        font-size: 20px;
    }
}