/* --- TNT Stack 4.0: Mobile Ready --- */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300&display=swap');

:root {
    --tnt-bg: #111;
    --tnt-gold: #c5a059;
    --tnt-text: #e0e0e0;
    --tnt-border: #333;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.tnt-decklist-container {
    background: var(--tnt-bg);
    color: var(--tnt-text);
    font-family: 'Merriweather', serif;
    border: 1px solid var(--tnt-border);
    margin: 3rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: fadeIn 0.5s ease-out;
}

/* Header */
.tnt-decklist-header {
    background: linear-gradient(90deg, #0f0f0f 0%, #1a1a1a 100%);
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--tnt-gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-left { display: flex; align-items: center; gap: 1rem; }
.header-icon { color: var(--tnt-gold); width: 24px; height: 24px; }
.header-text h3 {
    margin: 0;
    font-family: 'Cinzel', serif;
    color: var(--tnt-gold);
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.tnt-label { font-size: 0.7rem; color: #888; text-transform: uppercase; letter-spacing: 0.1em; }
.header-mana { text-align: right; }
.mana-label { display: block; font-size: 0.7rem; text-transform: uppercase; color: #888; }
.mana-value i.ms { font-size: 1.1em; margin-left: 2px; }

/* Body */
.tnt-decklist-body { padding: 2.5rem; }

/* Info Box */
.tnt-infobox {
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    border-left: 3px solid var(--tnt-gold);
}
.infobox-row { margin-bottom: 1rem; }
.infobox-row:last-child { margin-bottom: 0; }
.infobox-label {
    display: flex; align-items: center; gap: 8px;
    font-family: 'Cinzel', serif; font-size: 0.85rem; color: var(--tnt-gold); margin-bottom: 0.5rem;
}
.infobox-content { font-size: 0.95rem; line-height: 1.6; color: #ccc; }

/* Timeline */
.tnt-timeline { position: relative; padding-left: 10px; max-width: 900px; }
.tnt-timeline-step { display: flex; gap: 1.5rem; padding-bottom: 2rem; position: relative; }
.timeline-marker { display: flex; flex-direction: column; align-items: center; min-width: 40px; }
.marker-circle {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid var(--tnt-gold);
    background: #111;
    color: var(--tnt-gold);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cinzel', serif; font-weight: bold; font-size: 1.1rem;
    z-index: 2;
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.2);
}
.marker-circle.loop { border-style: dotted; color: #fff; border-color: #fff; }
.marker-line {
    flex: 1; width: 2px;
    background: linear-gradient(to bottom, var(--tnt-gold) 0%, rgba(197, 160, 89, 0.1) 100%);
    margin-top: 5px; min-height: 20px;
}
.tnt-timeline-step:last-child .marker-line { display: none; }
.timeline-content { flex: 1; padding-top: 5px; }

/* Badges & Links */
.zone-badge {
    display: inline-block;
    font-family: 'Cinzel', serif; font-size: 0.65rem;
    padding: 2px 8px; border-radius: 2px; border: 1px solid;
    margin-bottom: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.zone-hand { border-color: #3b82f6; color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.zone-battlefield { border-color: #22c55e; color: #22c55e; background: rgba(34, 197, 94, 0.1); }
.zone-graveyard { border-color: #a8a29e; color: #a8a29e; background: rgba(168, 162, 158, 0.1); }
.zone-stack { border-color: #f59e0b; color: #f59e0b; background: rgba(245, 158, 11, 0.1); }

.step-desc { font-size: 1rem; line-height: 1.6; color: #e0e0e0; }

.tnt-card-link {
    color: var(--tnt-gold);
    border-bottom: 1px dotted var(--tnt-gold);
    cursor: pointer; font-weight: normal; transition: all 0.2s;
}
.tnt-card-link:hover { color: #fff; border-bottom-style: solid; }

/* Results */
.tnt-results-box {
    margin-top: 1rem;
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    padding: 1.5rem; border-radius: 4px; max-width: 900px;
}
.tnt-results-box h4 { margin: 0 0 1rem 0; font-family: 'Cinzel', serif; color: #4ade80; }
.tnt-results-box ul { list-style: none; padding: 0; margin: 0; }
.tnt-results-box li { display: flex; align-items: center; gap: 10px; margin-bottom: 0.5rem; color: #ddd; }
.tnt-results-box i { color: #4ade80; width: 16px; }

/* Desktop Tooltip */
#tnt-card-tooltip {
    position: fixed; z-index: 999999;
    opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
    background: #000; width: 240px; border-radius: 12px;
    border: 2px solid var(--tnt-gold); box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    overflow: hidden;
}
#tnt-card-tooltip.visible { opacity: 1; }
#tnt-card-tooltip img { display: block; width: 100%; }

/* --- MOBILE SPECIFIC STYLES --- */
@media (max-width: 768px) {
    .tnt-decklist-body { padding: 1.5rem 1rem; }
    .tnt-timeline { padding-left: 0; }
    .tnt-timeline-step { gap: 1rem; }
    
    /* Smaller markers for mobile */
    .timeline-marker { min-width: 30px; }
    .marker-circle { width: 30px; height: 30px; font-size: 0.9rem; }
    
    /* Bigger text for readability */
    .step-desc { font-size: 1.05rem; }
    
    /* Hide desktop tooltip logic handled by JS */
    #tnt-card-tooltip { display: none !important; }
}

/* Mobile Modal */
.tnt-mobile-modal {
    display: none; /* Hidden by default */
    position: fixed; z-index: 100000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    justify-content: center; align-items: center;
}
.tnt-mobile-modal.visible { display: flex; }

.tnt-modal-content {
    position: relative;
    width: 90%; max-width: 350px;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tnt-modal-content img {
    width: 100%; height: auto;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.3);
    border: 2px solid var(--tnt-gold);
}
.tnt-modal-close {
    position: absolute; top: -40px; right: 0;
    color: #fff; font-size: 30px; font-weight: bold; cursor: pointer;
}