/* Compact viewport-first redesign */
:root {
    --bg-body: #060914;
    --bg-panel: rgba(13, 20, 36, 0.8);
    --bg-card: rgba(13, 20, 36, 0.94);
    --border-subtle: rgba(148, 163, 184, 0.18);
    --text-primary: #f8fafc;
    --text-secondary: rgba(226, 232, 240, 0.76);
    --accent: #38bdf8;
    --accent-strong: #22d3ee;
    --danger: #f87171;
    --success: #34d399;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --transition: 220ms cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: 'Noto Sans JP', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.28), transparent 55%),
                radial-gradient(circle at 80% 15%, rgba(236, 72, 153, 0.25), transparent 45%),
                var(--bg-body);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 18px;
}

.viewport-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(24px, 5vw, 40px) 0;
}

.compact-header,
.compact-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
}

.brand__mark {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
}

.header-actions {
    display: inline-flex;
    gap: 12px;
}

.btn {
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: transform var(--transition), box-shadow var(--transition);
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-1px);
}

.btn-primary {
    border: none;
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.35);
}

.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline-secondary {
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(12, 20, 36, 0.3);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    border-color: rgba(56, 189, 248, 0.45);
    color: var(--accent);
}

.btn-ghost {
    background: rgba(12, 20, 36, 0.3);
    color: var(--text-secondary);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.btn-ghost svg {
    margin-right: 6px;
}

.compact-hero {
    display: grid;
    gap: clamp(20px, 4vw, 32px);
    text-align: center;
}

.compact-hero__title {
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 700;
    margin: 0;
}

.compact-hero__lead {
    color: var(--text-secondary);
    margin: 0 auto;
    max-width: 580px;
}

.badge--glass {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.3);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cta-group {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.quick-indicators {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.quick-indicator {
    min-width: 120px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: rgba(12, 20, 36, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.18);
    text-align: center;
}

.quick-indicator__value {
    display: block;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--accent);
}

.quick-indicator__label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.compact-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    padding-top: 18px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: inline-flex;
    gap: 16px;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--accent-strong);
}

/* Offcanvas */
.info-drawer {
    background: rgba(8, 13, 24, 0.95);
    color: var(--text-primary);
}

.info-drawer .offcanvas-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.info-drawer h6 {
    margin-top: 16px;
    font-size: 0.95rem;
    color: var(--accent);
}

.info-drawer ul {
    padding-left: 18px;
    color: var(--text-secondary);
}

/* Modal */
.modal-immersive .modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 0 24px 40px rgba(6, 9, 20, 0.6);
}

.modal-immersive .modal-header,
.modal-immersive .modal-footer {
    border-color: rgba(148, 163, 184, 0.15);
}

.modal-subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.players-form__list {
    display: grid;
    gap: 12px;
}

.player-input-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: rgba(12, 20, 36, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.player-number {
    min-width: 28px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.player-name {
    background: rgba(8, 13, 24, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: var(--text-primary);
}

.player-name:focus {
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.power-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.player-power {
    width: 120px;
    accent-color: var(--accent);
}

.power-value {
    font-weight: 600;
    color: var(--accent);
    min-width: 28px;
    text-align: right;
}

.power-unit {
    color: var(--text-secondary);
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.empty-state {
    display: grid;
    gap: 16px;
    text-align: center;
    color: var(--text-secondary);
    padding: 36px 0;
}

.empty-state__icon {
    color: rgba(148, 163, 184, 0.4);
}

/* Results */
.team-combination {
    background: rgba(12, 20, 36, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 16px;
}

.team-combination__header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.team-combination__delta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.team-row {
    display: grid;
    gap: 12px;
}

.team-card {
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.18);
    overflow: hidden;
    background: rgba(8, 13, 24, 0.6);
}

.team-a-header,
.team-b-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(59, 130, 246, 0.32));
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.team-b-header {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(56, 189, 248, 0.32));
}

.team-total-power {
    color: rgba(248, 250, 252, 0.85);
}

.team-details {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
}

.team-members {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
}

.team-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(12, 20, 36, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.team-member-power {
    color: var(--text-secondary);
    font-weight: 600;
}

.special-icon {
    width: 18px;
    height: 18px;
    margin-left: 6px;
}

.slider-with-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-with-value__display {
    min-width: 28px;
    text-align: right;
    color: var(--accent);
    font-weight: 600;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    .viewport-shell {
        padding: 24px 0;
    }

    .compact-header,
    .compact-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        text-align: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .btn-ghost span {
        display: none;
    }

    .cta-group {
        flex-direction: column;
    }

    .quick-indicator {
        flex: 1 1 45%;
    }

    .player-input-row {
        grid-template-columns: 1fr;
        position: relative;
    }

    .player-number {
        position: absolute;
        top: 10px;
        right: 16px;
    }

    .power-group {
        justify-content: space-between;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
} 