/* ============================================
   TUTORIAL MODAL STYLES - COMPREHENSIVE GAME GUIDE
   ============================================ */

/* Tutorial Panel - Larger for more content */
.tutorial-panel {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Header Buttons */
.header-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-tutorial {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-tutorial:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(147, 51, 234, 0.4));
    transform: translateY(-1px);
}

/* In-game Help Button */
.btn-help-ingame {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
}

.btn-help-ingame:hover {
    background: rgba(59, 130, 246, 0.6);
    transform: scale(1.1);
}

/* Tutorial Tabs - Scrollable for many tabs */
.tutorial-tabs {
    display: flex;
    gap: 0.4rem;
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tutorial-tabs::-webkit-scrollbar {
    height: 4px;
}

.tutorial-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.tutorial-tabs .tab-btn {
    flex-shrink: 0;
    padding: 0.6rem 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tutorial-tabs .tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tutorial-tabs .tab-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(147, 51, 234, 0.3));
    border-color: rgba(59, 130, 246, 0.5);
    color: #fff;
}

/* Tutorial Content */
.tutorial-content {
    padding: 0 1.5rem;
    min-height: 350px;
}

.tutorial-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tutorial-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   CONTROLS TAB - Arrow Keys Primary
   ============================================ */
.controls-diagram {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .controls-diagram {
        grid-template-columns: 1fr;
    }
}

.key-group {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.key-group h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.keys-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.key {
    width: 44px;
    height: 44px;
    background: linear-gradient(180deg, #3a3a4a 0%, #2a2a3a 100%);
    border: 2px solid #4a4a5a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 0 #1a1a2a, 0 6px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.1s ease;
}

.key:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1a1a2a, 0 3px 5px rgba(0, 0, 0, 0.3);
}

/* Arrow keys - Primary styling */
.key.arrow-key {
    background: linear-gradient(180deg, #4a5a6a 0%, #3a4a5a 100%);
    border-color: #5a6a7a;
    font-size: 1.2rem;
}

.key.wide {
    width: 56px;
}

.key.extra-wide {
    width: 80px;
    font-size: 0.85rem;
}

.or-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.curve-arrow {
    font-size: 1.5rem;
    color: var(--primary);
}

.key.curve-left {
    border-color: #f97316;
    box-shadow: 0 4px 0 #c2410c, 0 6px 10px rgba(249, 115, 22, 0.2);
}

.key.curve-right {
    border-color: #3b82f6;
    box-shadow: 0 4px 0 #1d4ed8, 0 6px 10px rgba(59, 130, 246, 0.2);
}

.key-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.key-desc.secondary {
    color: var(--text-muted);
    opacity: 0.7;
}

/* ============================================
   CURVE TAB
   ============================================ */
.curve-tutorial {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.curve-demo {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 600px) {
    .curve-demo {
        flex-direction: column;
    }
}

.demo-field {
    flex: 1;
    height: 160px;
    background: linear-gradient(135deg, #3d5c3d, #4a6b4a);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 2px solid #2a3a2a;
}

.demo-field::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.demo-player {
    position: absolute;
    left: 30%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: #e56e56;
    border: 3px solid #941e1e;
    border-radius: 50%;
    z-index: 2;
}

.demo-ball {
    position: absolute;
    left: 38%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 50%;
    z-index: 2;
}

.demo-path {
    position: absolute;
    left: 38%;
    top: 50%;
    width: 45%;
    height: 4px;
    transform-origin: left center;
}

.demo-path.straight {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%);
}

.demo-path.curved-left {
    background: transparent;
    border: none;
    height: 60px;
    border-top: 3px dashed #f97316;
    border-radius: 0 60px 0 0;
    transform: translateY(-100%) rotate(-5deg);
}

.demo-path.curved-right {
    background: transparent;
    border: none;
    height: 60px;
    border-bottom: 3px dashed #3b82f6;
    border-radius: 0 0 60px 0;
    transform: translateY(0%) rotate(5deg);
}

.demo-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.legend-item .line {
    width: 30px;
    height: 3px;
    border-radius: 2px;
}

.legend-item .line.straight {
    background: rgba(255, 255, 255, 0.5);
}

.legend-item .line.curved-l {
    background: #f97316;
}

.legend-item .line.curved-r {
    background: #3b82f6;
}

/* Curve Steps */
.curve-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

@media (max-width: 500px) {
    .curve-steps {
        flex-direction: column;
        gap: 1rem;
    }
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-num {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.step-text {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.key-inline {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Curve Tip */
.curve-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 1rem;
}

.curve-tip .tip-icon {
    font-size: 1.25rem;
}

.curve-tip p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   RANKS TAB
   ============================================ */
.ranks-overview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ranks-intro {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.ranks-intro h3 {
    font-size: 1.1rem;
    color: #fff;
    margin: 0 0 0.5rem 0;
}

.ranks-intro p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.ranks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.rank-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.rank-card:hover {
    background: rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

.rank-card .rank-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.rank-card .rank-info {
    display: flex;
    flex-direction: column;
}

.rank-card .rank-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.rank-card .rank-mmr {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Rank colors (tiers from ranks.js) */
.rank-card.bronze .rank-name { color: #C77B3B; }
.rank-card.silver .rank-name { color: #B9C4CF; }
.rank-card.gold .rank-name { color: #F2C230; }
.rank-card.platinum .rank-name { color: #58D3C5; }
.rank-card.diamond .rank-name { color: #6FA8FF; }
.rank-card.champion .rank-name { color: #B77CFF; }
.rank-card.grandchampion .rank-name { color: #FF4E5B; }
.rank-card.legend .rank-name { color: #FFFFFF; }
.rank-card .rank-divs {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.mmr-explanation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.mmr-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.mmr-box h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
}

.mmr-box .mmr-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.mmr-box .mmr-value.win { color: #22c55e; }
.mmr-box .mmr-value.loss { color: #ef4444; }

.mmr-box .mmr-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ============================================
   SHOP TAB
   ============================================ */
.shop-overview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.shop-intro {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.1), rgba(249, 115, 22, 0.1));
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 12px;
}

.shop-intro h3 {
    font-size: 1.1rem;
    color: #ffd700;
    margin: 0 0 0.5rem 0;
}

.shop-intro p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.coin-earn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.coin-card {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.coin-card h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
}

.coin-card .coin-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffd700;
}

.coin-card .coin-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.shop-items-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shop-items-preview h4 {
    font-size: 1rem;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shop-category {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.shop-item-preview {
    flex-shrink: 0;
    width: 120px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1rem 0.75rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.shop-item-preview:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.shop-item-preview .item-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.shop-item-preview .item-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.shop-item-preview .item-price {
    font-size: 0.75rem;
    color: #ffd700;
}

/* Rarity colors */
.shop-item-preview.common { border-color: rgba(156, 163, 175, 0.3); }
.shop-item-preview.rare { border-color: rgba(59, 130, 246, 0.3); }
.shop-item-preview.epic { border-color: rgba(168, 85, 247, 0.3); }
.shop-item-preview.legendary { border-color: rgba(234, 179, 8, 0.3); }

/* ============================================
   SEASON TAB
   ============================================ */
.season-overview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.season-intro {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
}

.season-intro h3 {
    font-size: 1.1rem;
    color: #a855f7;
    margin: 0 0 0.5rem 0;
}

.season-intro p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.season-rewards-preview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.season-reward-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    border-left: 4px solid;
}

.season-reward-row.gold { border-left-color: #ffd700; }
.season-reward-row.silver { border-left-color: #c0c0c0; }
.season-reward-row.bronze { border-left-color: #cd7f32; }
.season-reward-row.top10 { border-left-color: #a855f7; }
.season-reward-row.top50 { border-left-color: #3b82f6; }

.season-reward-row .reward-position {
    font-size: 1.25rem;
    width: 36px;
    text-align: center;
}

.season-reward-row .reward-info {
    flex: 1;
}

.season-reward-row .reward-info h5 {
    font-size: 0.9rem;
    color: #fff;
    margin: 0;
}

.season-reward-row .reward-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0 0;
}

.season-reward-row .reward-coins {
    font-size: 1rem;
    color: #ffd700;
    font-weight: 600;
}

/* ============================================
   TIPS TAB
   ============================================ */
.tips-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tip-card {
    display: flex;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.tip-card:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(5px);
}

.tip-card .tip-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    flex-shrink: 0;
}

.tip-card .tip-content h4 {
    font-size: 1rem;
    color: #fff;
    margin: 0 0 0.25rem 0;
}

.tip-card .tip-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.tip-card .tip-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary);
}

/* ============================================
   FOOTER
   ============================================ */
.tutorial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
}

.dont-show-again {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dont-show-again input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.dont-show-again:hover {
    color: var(--text-primary);
}

#btn-got-it {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}
