/* Foundation (fonts, vars, nav, footer) provided by /css/base.css */

/* ── Main ── */
main { padding-bottom: 2rem; }

/* ── Breadcrumb ── */
.breadcrumb { padding: 1.25rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: #a78bfa; }
.breadcrumb span { margin: 0 0.4rem; }

/* ── Hero ── */
.hero-section { padding: 2rem 0 2.5rem; text-align: center; }
.hero-section h1 { font-size: 2.5rem; margin-bottom: 0.5rem; background: var(--gradient-purple); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-section .subtitle { color: var(--text-secondary); font-size: 1.05rem; max-width: 640px; margin: 0 auto; }

/* ── Layout ── */
.sim-layout { display: grid; grid-template-columns: 340px 1fr; gap: 1.5rem; }
@media (max-width: 960px) {
    .sim-layout { grid-template-columns: 1fr; }
}

/* ── Panels ── */
.panel { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 1.5rem; }
.panel-title { font-size: 1.1rem; margin-bottom: 1rem; color: var(--text-primary); display: flex; align-items: center; gap: 0.5rem; }
.panel-title .icon { font-size: 1.2rem; }

/* ── Input Panel ── */
.deck-textarea { width: 100%; min-height: 200px; background: var(--bg-dark); border: 1px solid var(--card-border); border-radius: 8px; padding: 0.75rem; color: var(--text-primary); font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.85rem; resize: vertical; line-height: 1.5; }
.deck-textarea:focus { outline: none; border-color: #a855f7; box-shadow: 0 0 0 2px rgba(168,85,247,0.2); }
.deck-textarea::placeholder { color: var(--text-muted); }

.format-row { display: flex; gap: 0.75rem; margin-bottom: 1rem; align-items: center; }
.format-label { font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; }
.format-select { background: var(--bg-dark); border: 1px solid var(--card-border); border-radius: 6px; padding: 0.4rem 0.6rem; color: var(--text-primary); font-size: 0.85rem; cursor: pointer; flex: 1; }
.format-select:focus { outline: none; border-color: #a855f7; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.65rem 1.25rem; border: none; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background-color 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s; font-family: 'Inter', sans-serif; }
.btn-primary { background: var(--gradient-purple); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(168,85,247,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text-secondary); border: 1px solid var(--card-border); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn-danger { background: rgba(220,38,38,0.15); color: #f87171; border: 1px solid rgba(220,38,38,0.3); }
.btn-danger:hover { background: rgba(220,38,38,0.25); }
.btn-success { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.btn-success:hover { background: rgba(34,197,94,0.25); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn-row { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.btn-full { width: 100%; }

/* ── Deck Stats ── */
.deck-stats { margin-top: 1rem; padding: 0.75rem; background: rgba(168,85,247,0.06); border: 1px solid rgba(168,85,247,0.15); border-radius: 8px; display: none; }
.deck-stats.visible { display: block; }
.deck-stats-title { font-size: 0.8rem; color: #a78bfa; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.stat-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.2rem 0; }
.stat-row .label { color: var(--text-secondary); }
.stat-row .value { color: var(--text-primary); font-weight: 600; }
.card-breakdown { margin-top: 0.5rem; max-height: 160px; overflow-y: auto; }
.card-breakdown::-webkit-scrollbar { width: 4px; }
.card-breakdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.breakdown-item { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 0.15rem 0; }
.breakdown-item .name { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 0.5rem; }
.breakdown-item .count { color: var(--text-muted); font-weight: 500; flex-shrink: 0; }

/* ── Hand Display Area ── */
.hand-area { min-height: 400px; display: flex; flex-direction: column; }
.hand-status { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.hand-status-text { font-size: 0.95rem; color: var(--text-secondary); }
.hand-status-text strong { color: var(--text-primary); }
.mulligan-badge { display: inline-block; padding: 0.2rem 0.6rem; background: rgba(168,85,247,0.15); border: 1px solid rgba(168,85,247,0.3); border-radius: 20px; font-size: 0.75rem; color: #c084fc; font-weight: 600; }

.hand-controls { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }

/* ── Card Grid / Fan ── */
.hand-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; padding: 1rem 0; }
.hand-card { position: relative; width: 170px; border-radius: 10px; overflow: hidden; cursor: pointer; transition: transform 0.3s, box-shadow 0.3s; box-shadow: var(--shadow-md); }
.hand-card:hover { transform: translateY(-12px) scale(1.04); box-shadow: 0 12px 24px rgba(0,0,0,0.6), 0 0 20px var(--card-hover-glow); z-index: 10; }
.hand-card img { width: 100%; display: block; border-radius: 10px; }
.hand-card.selected { outline: 3px solid #f87171; outline-offset: 2px; opacity: 0.6; }
.hand-card.selected::after { content: 'BOTTOM'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(220,38,38,0.85); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 0.3rem 0.75rem; border-radius: 4px; letter-spacing: 0.05em; }

/* ── Placeholder Card ── */
.card-placeholder { width: 170px; height: 237px; background: linear-gradient(145deg, #252525 0%, #1a1a1a 100%); border: 2px solid var(--card-border); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; text-align: center; transition: border-color 0.2s, background-color 0.2s; cursor: pointer; }
.card-placeholder:hover { transform: translateY(-12px) scale(1.04); border-color: rgba(168,85,247,0.4); }
.card-placeholder.selected { outline: 3px solid #f87171; outline-offset: 2px; opacity: 0.6; }
.card-placeholder.selected::after { content: 'BOTTOM'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(220,38,38,0.85); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 0.3rem 0.75rem; border-radius: 4px; letter-spacing: 0.05em; }
.card-placeholder .card-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.4; }
.card-placeholder .card-name { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; word-break: break-word; }

/* ── Hand Stats ── */
.hand-stats { margin-top: 1.25rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.75rem; }
.hand-stat-card { background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); border-radius: 8px; padding: 0.75rem; text-align: center; }
.hand-stat-value { font-size: 1.5rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; background: var(--gradient-purple); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hand-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.15rem; }

/* ── Mulligan Bottom Picker ── */
.bottom-picker-bar { background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.2); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem; display: none; }
.bottom-picker-bar.visible { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.bottom-picker-text { font-size: 0.85rem; color: #fca5a5; }
.bottom-picker-text strong { color: #f87171; }

/* ── Empty State ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3rem 1rem; flex: 1; }
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state .title { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state .desc { font-size: 0.85rem; color: var(--text-muted); max-width: 320px; }

/* ── Loading Spinner ── */
.loading-card { width: 170px; height: 237px; background: linear-gradient(145deg, #252525 0%, #1a1a1a 100%); border: 1px solid var(--card-border); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(168,85,247,0.2); border-top-color: #a855f7; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero-section h1 { font-size: 1.75rem; }
    .hero-section .subtitle { font-size: 0.9rem; }
    .sim-layout { grid-template-columns: 1fr; }
    .hand-card, .card-placeholder, .loading-card { width: 130px; }
    .card-placeholder { height: 181px; }
    .loading-card { height: 181px; }
    .hand-grid { gap: 0.5rem; }
    .hand-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .hand-card, .card-placeholder, .loading-card { width: 105px; }
    .card-placeholder { height: 146px; }
    .loading-card { height: 146px; }
    .card-placeholder .card-icon { font-size: 1.5rem; }
    .card-placeholder .card-name { font-size: 0.7rem; }
}

/* ── Tool Guide / Educational Content ── */
.tool-guide { max-width: 800px; margin: 3rem auto; padding: 0 1.5rem; }
.tool-guide h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; color: #e5e7eb; margin: 2.5rem 0 1rem; border-bottom: 1px solid rgba(168,85,247,0.2); padding-bottom: 0.5rem; }
.tool-guide h3 { font-size: 1.15rem; color: #d1d5db; margin: 1.5rem 0 0.75rem; }
.tool-guide p, .tool-guide li { color: #9ca3af; line-height: 1.7; margin-bottom: 1rem; }
.tool-guide a { color: #a855f7; text-decoration: none; }
.tool-guide a:hover { text-decoration: underline; }
.guide-card-img { border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.guide-card-right { float: right; margin: 0 0 1.25rem 1.5rem; }
@media (max-width: 600px) {
    .guide-card-right { float: none; display: block; margin: 0 auto 1.25rem; }
}
.faq-section { margin-top: 1.5rem; }
.faq-item { border: 1px solid #2a2a2e; border-radius: 8px; margin-bottom: 0.75rem; overflow: hidden; }
.faq-q { padding: 1rem 1.25rem; cursor: pointer; font-weight: 600; color: #e5e7eb; display: flex; justify-content: space-between; align-items: center; background: #1a1a1e; }
.faq-q::after { content: '+'; font-size: 1.25rem; color: #a855f7; transition: transform 0.2s; }
.faq-item.open .faq-q::after { content: '\2212'; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.faq-item.open .faq-a { max-height: 800px; padding: 0 1.25rem 1rem; }
.faq-a p { margin: 0.5rem 0; }
.related-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.related-links a { display: inline-block; padding: 0.5rem 1rem; background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.2); border-radius: 6px; color: #a855f7; font-size: 0.9rem; transition: background-color 0.2s, border-color 0.2s; }
.related-links a:hover { background: rgba(168,85,247,0.2); border-color: rgba(168,85,247,0.4); text-decoration: none; }
/* Card images in guide content */
.tool-guide img { max-width: 265px; border-radius: 12px; margin: 1rem 0; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.tool-guide .card-examples { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; }
.tool-guide .card-examples img { max-width: 220px; }
@media (max-width: 640px) { .tool-guide img { max-width: 200px; } .tool-guide .card-examples img { max-width: 160px; } }
