/* Sidebar */
.sidebar {
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.brand-header {
    display: flex;
    flex-direction: column;
}

.logo {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1f1f1f;
    margin-bottom: 4px;
}

.system-text {
    font-family: 'Chakra Petch', monospace;
    font-size: 0.75rem;
    display: flex;
    gap: 8px;
}

.mode-select {
    background: transparent;
    border: 1px solid #c2c2c2;
    color: #5e5e5e;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
    outline: none;
}
.mode-select:focus, .mode-select:hover {
    border-color: #1f1f1f;
    color: #1f1f1f;
}

.status-panel, .log-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.turn-indicator {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.turn-badge {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    background: #f5f5f5;
    color: #9e9e9e;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.turn-badge.active {
    color: white;
}

.turn-badge.active.p1-badge { 
    background: var(--p1-color); 
    box-shadow: 0 4px 12px rgba(11, 87, 208, 0.3);
}
.turn-badge.active.p2-badge { 
    background: var(--p2-color); 
    box-shadow: 0 4px 12px rgba(179, 38, 30, 0.3);
}

.ap-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ap-dots {
    display: flex;
    gap: 8px;
}

.ap-dot {
    width: 24px;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    transition: background 0.2s;
}

.ap-dot.active {
    background: #1f1f1f;
}

.game-info {
    font-size: 0.9rem;
    color: #424242;
    min-height: 4rem;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #eeeeee;
}

.log-panel {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 0.85rem;
    padding: 16px 16px 16px 32px;
    position: relative;
}

.log-entry {
    position: relative;
    padding: 10px 14px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #eeeeee;
    color: #424242;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-entry::before {
    content: '';
    position: absolute;
    top: 50%; left: -21px;
    width: 10px; height: 10px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: #bdbdbd;
    border: 2px solid var(--panel-bg);
    z-index: 2;
}

.log-entry::after {
    content: '';
    position: absolute;
    top: 50%; left: -17px;
    width: 2px;
    height: calc(100% + 12px);
    background: #e0e0e0;
    z-index: 1;
}
.log-entry:last-child::after { display: none; }

.log-entry.log-p1 { border-left: 3px solid var(--p1-color); }
.log-entry.log-p1::before { background: var(--p1-color); }

.log-entry.log-p2 { border-left: 3px solid var(--p2-color); }
.log-entry.log-p2::before { background: var(--p2-color); }

.log-entry.log-sys {
    background: #f8f9fa;
    border-color: #e0e0e0;
    font-weight: 600;
}
.log-entry.log-sys::before { background: #757575; }

.log-label {
    font-size: 0.8rem;
    font-weight: 800;
    font-family: var(--font-header);
    color: var(--text-dark);
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    flex-shrink: 0;
    user-select: none;
}
.log-p1 .log-label { background: rgba(11, 87, 208, 0.1); color: var(--p1-color); }
.log-p2 .log-label { background: rgba(179, 38, 30, 0.1); color: var(--p2-color); }
.log-sys .log-label { background: #616161; color: #fff; }

.log-text {
    flex: 1;
}

/* Tactical Button Hover Effect */
.btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    margin-top: 16px;
    font-size: 0.95rem;
    overflow: hidden;
}

.btn::before, .btn::after {
    content: '';
    position: absolute;
    width: 10px; height: 10px;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    pointer-events: none;
}
.btn::before { top: 4px; left: 4px; border-right: none; border-bottom: none; transform: translate(-4px, -4px); }
.btn::after { bottom: 4px; right: 4px; border-left: none; border-top: none; transform: translate(4px, 4px); }

.btn:hover::before, .btn:hover::after {
    transform: translate(0, 0);
}

.btn.primary { background: #1f1f1f; color: #ffffff; }
.btn.primary:hover { background: #000000; transform: translateY(-1px); }
.btn.primary:hover::before, .btn.primary:hover::after { border-color: rgba(255,255,255,0.5); }

.btn.secondary { background: #e0e0e0; color: #1f1f1f; }
.btn.secondary:hover { background: #d5d5d5; }
.btn.secondary:hover::before, .btn.secondary:hover::after { border-color: rgba(0,0,0,0.3); }

.btn.outline { background: #ffffff; border: 1px solid #c2c2c2; color: #1f1f1f; }
.btn.outline:hover { background: #f5f5f5; }
.btn.outline:hover::before, .btn.outline:hover::after { border-color: rgba(0,0,0,0.3); }

.hidden {
    display: none !important;
}

/* Modal overlays */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: var(--panel-bg);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.modal-content h2 {
    font-size: 1.6rem;
    margin-bottom: 16px;
    color: #1f1f1f;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* Rules Modal Specific */
.rules-content {
    max-width: 650px;
    padding: 32px;
    text-align: left;
}
.rules-content h2 {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}
.rules-text {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 16px;
    color: #424242;
    line-height: 1.7;
    font-size: 0.95rem;
}
.rules-text p {
    margin-bottom: 16px;
}
.rules-text hr {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

/* Rules Modal Premium Tab Styling */
#rules-modal .modal-content {
    background: rgba(18, 18, 18, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #fff;
    max-width: 620px;
    width: 92%;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
}
#rules-modal h2 {
    color: #fff !important;
    margin-bottom: 16px;
    font-size: 1.5rem;
    font-family: var(--font-header);
    text-align: center;
    border-bottom: none;
    padding-bottom: 0;
}
.rules-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}
.rules-tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Noto Sans JP', sans-serif;
    word-break: auto-phrase;
    overflow-wrap: anywhere;
    line-break: strict;
    text-align: center;
    hyphens: none;
}
.rules-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}
.rules-tab-btn.active {
    color: #00e5ff;
    border-bottom-color: #00e5ff;
    background: rgba(0, 229, 255, 0.05);
}
.rules-tab-content {
    display: none;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 8px;
    text-align: left;
}
.rules-tab-content.active {
    display: block;
}
.rules-tab-content::-webkit-scrollbar {
    width: 6px;
}
.rules-tab-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}
.rules-tab-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.rules-tab-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Rule Cards */
.rule-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.rule-card h3 {
    font-size: 1.05rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-header);
    color: #fff !important;
}
.rule-card h3 .material-symbols-outlined {
    font-size: 1.25rem;
}
.rule-card p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8) !important;
    line-height: 1.6;
    margin-bottom: 8px !important;
}
.rule-card p:last-child {
    margin-bottom: 0 !important;
}
.rule-card ul {
    padding-left: 20px;
    margin-bottom: 8px;
}
.rule-card li {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 6px;
}
.rule-card li:last-child {
    margin-bottom: 0;
}

/* Badges and Highlights */
.rule-badge-inline {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.05em;
}
.badge-ap { background: rgba(0, 229, 255, 0.15); color: #00e5ff; border: 1px solid rgba(0, 229, 255, 0.3); }
.badge-free { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

.step-list {
    list-style: none;
    padding: 0;
}
.step-item {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
}
.step-item:last-child {
    margin-bottom: 0;
}
.step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #00e5ff;
    color: #0c0f12;
    font-weight: bold;
    font-family: 'Chakra Petch', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.step-body {
    flex: 1;
}
.step-title {
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: #fff;
}
.step-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}
.rule-highlight {
    color: #f59e0b;
    font-weight: bold;
}
.rule-subtext {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* REPLAY CONTROLS PANEL */
#replay-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(18, 18, 18, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    width: max-content;
    max-width: 95vw;
    box-sizing: border-box;
}

.replay-btn-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: center;
}

.replay-slider-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
}

#replay-frame-counter {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Chakra Petch', sans-serif;
    white-space: nowrap;
}

#replay-frame-slider {
    width: 100%;
    max-width: 280px;
    accent-color: #00e5ff;
    cursor: pointer;
}

.replay-nav-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 0 !important;
    padding: 7px 10px !important;
    font-size: 0.75rem !important;
    height: 34px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    white-space: nowrap;
}

.replay-nav-btn::before,
.replay-nav-btn::after {
    display: none !important;
}

.replay-nav-btn.outline {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #e0e0e0 !important;
}

.replay-nav-btn.outline:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.32) !important;
    color: #fff !important;
}

.replay-nav-btn.primary {
    background: linear-gradient(135deg, #0b57d0, #00e5ff) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.25) !important;
}

.replay-nav-btn.primary:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
}

.replay-exit-btn {
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    color: #ff5252 !important;
}

.replay-exit-btn:hover {
    background: rgba(239, 68, 68, 0.28) !important;
    color: #fff !important;
    border-color: rgba(239, 68, 68, 0.55) !important;
}

.replay-nav-btn .material-symbols-outlined,
.replay-exit-btn .material-symbols-outlined {
    font-size: 1.1rem !important;
    line-height: 1 !important;
}

.replay-divider {
    display: inline-block;
    height: 22px;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 2px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* === Quick Reference Panel === */
.quick-ref-panel {
    margin-top: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
}
.quick-ref-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.04em;
    text-align: left;
}
.quick-ref-header:hover { background: rgba(255,255,255,0.05); }
.quick-ref-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.25s;
    display: inline-block;
}
.quick-ref-panel.collapsed .quick-ref-arrow { transform: rotate(180deg); }
.quick-ref-body {
    padding: 0 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: max-height 0.3s ease;
    overflow: hidden;
    max-height: 500px;
}
.quick-ref-panel.collapsed .quick-ref-body {
    max-height: 0;
    padding: 0;
}
.quick-ref-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
}
.qr-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1.4; }
.qr-text { font-size: 0.75rem; line-height: 1.4; color: #e0e0e0; }
.qr-text strong { color: #fff; display: inline-block; margin-right: 4px; }
.qr-cost {
    display: inline-block;
    padding: 0 5px;
    border-radius: 4px;
    background: rgba(0,229,255,0.15);
    color: #00e5ff;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 2px;
    vertical-align: middle;
}
.qr-cost.free {
    background: rgba(16,185,129,0.15);
    color: #10b981;
}
.qr-desc { color: var(--text-light); font-size: 0.72rem; }

#mobile-quick-ref-panel {
    background: #1a1c1e;
    border-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}
#mobile-quick-ref-panel .quick-ref-header {
    color: #ffffff;
}
#mobile-quick-ref-panel .qr-text {
    color: #ffffff;
}
#mobile-quick-ref-panel .qr-desc {
    color: #b0b0b0;
}
#mobile-quick-ref-panel .quick-ref-item {
    background: rgba(255, 255, 255, 0.04);
}

/* === Beginner Mode === */
.beginner-mode-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
}
.beginner-mode-label {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 0.03em;
}
.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #444;
    border-radius: 22px;
    transition: background 0.25s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    left: 3px;
    top: 3px;
    transition: transform 0.25s;
}
.toggle-switch input:checked + .toggle-slider { background: #00e5ff; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

.beginner-hint-box {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0,229,255,0.25);
    background: rgba(0,229,255,0.05);
    font-size: 0.8rem;
    line-height: 1.55;
    color: #e0e0e0;
    animation: fadeInHint 0.3s ease;
}
@keyframes fadeInHint {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.beginner-hint-content .hint-icon {
    margin-right: 4px;
}
.beginner-hint-content strong {
    color: #00e5ff;
}

/* === Practice Mode === */
.btn-practice-lobby {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    background: linear-gradient(135deg, #065f46, #10b981);
    color: #fff;
    border: none;
    font-weight: 700;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-practice-lobby:hover { opacity: 0.9; transform: translateY(-1px); }

.practice-stage-content {
    max-width: 420px;
    width: 92%;
    padding: 28px 24px;
    border-radius: 16px;
}
.practice-modal-title {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 8px;
    font-family: var(--font-header);
    color: #10b981;
}
.practice-modal-desc {
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}
.practice-stage-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* Practice Stage Selection Card - Adjusted to dark style for contrast */
.practice-stage-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1c1e;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.practice-stage-card:hover { 
    background: #25282c; 
    border-color: rgba(16,185,129,0.5); 
}
.practice-stage-card.cleared { 
    border-color: #10b981; 
    background: #112b1d; 
}
.stage-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(16,185,129,0.15);
    color: #10b981;
    font-weight: 900;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--font-header);
}
.practice-stage-card.cleared .stage-num { background: #10b981; color: #fff; }
.stage-info { flex: 1; }
.stage-title { font-weight: 700; font-size: 0.9rem; color: #fff; }
.stage-desc { font-size: 0.75rem; color: var(--text-light); margin-top: 2px; }
.stage-status { font-size: 1.1rem; }
.practice-back-btn { margin-top: 0; }

.practice-clear-content {
    max-width: 340px;
    width: 88%;
    padding: 32px 24px;
    border-radius: 16px;
    text-align: center;
}
.practice-clear-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.practice-clear-title {
    font-size: 1.5rem;
    font-family: var(--font-header);
    color: #10b981;
    margin-bottom: 8px;
}
.practice-clear-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 20px;
}
.practice-clear-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.practice-clear-actions .btn { margin-top: 0; }

/* Practice Banner - repositioned to top: -45px to prevent covering the grid cells (y=6 / row 0) */
.practice-banner {
    position: absolute;
    top: -45px;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(6,95,70,0.95);
    border: 1px solid rgba(16,185,129,0.4);
    border-bottom: none;
    backdrop-filter: blur(8px);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    border-radius: 8px 8px 0 0;
}
.practice-banner-exit {
    margin-left: auto;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.7);
    padding: 2px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    transition: background 0.15s;
    white-space: nowrap;
}
.practice-banner-exit:hover { background: rgba(255,255,255,0.1); }

.practice-banner-help {
    margin-left: 8px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}
.practice-banner-help:hover {
    background: rgba(255,255,255,0.32);
    border-color: rgba(255,255,255,0.5);
}

/* Responsive SP Overrides for UI components */
@media (max-width: 950px) {
    .app-container {
        flex-direction: column !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        gap: 6px;
        padding: 8px !important;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .sidebar {
        display: none !important;
    }

    .replay-btn-label {
        display: none !important;
    }

    .mobile-hud {
        display: flex !important;
    }
    .mobile-hud.hidden {
        display: none !important;
    }
    .mobile-footer {
        display: flex !important;
        position: fixed !important;
        bottom: 8px !important;
        left: 8px !important;
        width: calc(100% - 16px) !important;
        box-sizing: border-box !important;
        z-index: 99 !important;
        padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    }
    .mobile-footer.hidden {
        display: none !important;
    }
    
    .btn-hud {
        padding: 6px 12px;
        border-radius: 6px;
        background: rgba(255,255,255,0.05) !important;
        transition: background 0.2s;
    }
    .btn-hud:hover, .btn-hud:active {
        background: rgba(255,255,255,0.15) !important;
    }

    .hud-ap-dot {
        font-size: 1.1rem;
        margin-left: 2px;
        vertical-align: middle;
        transition: all 0.3s ease;
    }

    /* Floating Practice Banner on mobile so it is out of the way of the vertical pitch */
    .practice-banner {
        position: fixed;
        top: 8px;
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
        border-radius: 8px;
        border: 1px solid rgba(16, 185, 129, 0.45);
        background: rgba(6, 95, 70, 0.98);
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
        z-index: 1000;
        padding: 6px 10px !important;
    }

    .practice-banner .practice-btn-label {
        display: none !important;
    }

    .practice-banner .exit-icon-mobile {
        display: inline-block !important;
    }

    .practice-banner-help,
    .practice-banner-exit {
        padding: 0 !important;
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
    }

}

@media (max-width: 600px) {
    #replay-controls {
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        padding: 8px 10px !important;
        gap: 6px !important;
        border-radius: 12px !important;
        max-width: 98vw !important;
        width: calc(100vw - 12px) !important;
    }

    .replay-btn-row {
        gap: 4px !important;
        width: 100%;
    }

    .replay-nav-btn {
        padding: 6px 6px !important;
        height: 36px !important;
        font-size: 0.65rem !important;
        border-radius: 6px !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: 60px !important;
    }

    .replay-btn-label {
        display: none !important;
    }

    .replay-nav-btn .material-symbols-outlined,
    .replay-exit-btn .material-symbols-outlined {
        font-size: 1rem !important;
    }

    #replay-frame-slider {
        max-width: 100% !important;
    }

    #replay-frame-counter {
        font-size: 0.65rem !important;
    }
}

/* X (formerly Twitter) share button style */
.btn-x-share {
    background: #000000 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    font-weight: 600;
    width: 100%;
}
.btn-x-share:hover {
    background: #141414 !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px);
}

/* Practice Guide Modal Specific */
.practice-guide-content {
    animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.practice-guide-content div strong {
    color: #00e5ff;
}

#btn-practice-guide-start:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Mobile: reduce padding for practice guide modal */
@media (max-width: 600px) {
    .practice-guide-content h2#practice-guide-title {
        font-size: 1.1rem !important;
    }
    #practice-guide-steps {
        font-size: 0.85rem !important;
    }
}
