/* ============================================
   Dragon Tower Predictor - CSS Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #0f1523;
    --bg-card: #141b2d;
    --bg-card-hover: #1a2340;
    --bg-input: #0d1220;
    --border-color: #1e2a45;
    --border-glow: #6c3bff33;
    --text-primary: #e8eaf0;
    --text-secondary: #8892a8;
    --text-muted: #4a5568;
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-tertiary: #c084fc;
    --gradient-primary: linear-gradient(135deg, #7c3aed, #3b82f6);
    --gradient-accent: linear-gradient(135deg, #a855f7, #6366f1);
    --gradient-gold: linear-gradient(135deg, #f59e0b, #ef4444);
    --gradient-emerald: linear-gradient(135deg, #10b981, #059669);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --safe-tile: #10b981;
    --danger-tile: #ef4444;
    --neutral-tile: #1e2a45;
    --glow-purple: 0 0 30px rgba(124, 58, 237, 0.3);
    --glow-blue: 0 0 30px rgba(59, 130, 246, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

/* --- Particles Canvas --- */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Background Orbs --- */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: #10b981;
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

.orb-4 {
    width: 500px;
    height: 500px;
    background: #f59e0b;
    bottom: -200px;
    right: 20%;
    animation-delay: -15s;
    opacity: 0.08;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -30px) scale(1.05); }
    50% { transform: translate(-30px, 50px) scale(0.95); }
    75% { transform: translate(40px, 20px) scale(1.02); }
}

/* --- Header --- */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 32px;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-base);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
}

.logo-icon {
    font-size: 32px;
    animation: dragonPulse 3s ease-in-out infinite;
}

@keyframes dragonPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.5)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 16px rgba(124, 58, 237, 0.8)); }
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: rgba(124, 58, 237, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--success);
    font-family: var(--font-mono);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* --- Hero Section --- */
#hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 32px 80px;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-tertiary);
    margin-bottom: 24px;
    font-family: var(--font-mono);
}

.badge-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

.hero-title {
    font-family: var(--font-display);
    line-height: 1.1;
    margin-bottom: 20px;
}

.title-line {
    display: block;
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    color: var(--text-primary);
}

.title-gradient {
    display: block;
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 480px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 36px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-base);
}

.stat-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-purple);
    transform: translateY(-2px);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--gradient-primary);
    color: white;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.hero-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.6);
}

/* Hero Visual / Tower Preview */
.hero-visual {
    flex: 1;
    max-width: 500px;
    display: flex;
    justify-content: center;
}

.tower-preview {
    width: 300px;
    height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.tower-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, var(--bg-card));
    z-index: 2;
    pointer-events: none;
}

.tower-grid-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    height: 100%;
}

.preview-tile {
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    animation: previewPulse 3s ease-in-out infinite;
}

.preview-tile.safe {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.preview-tile.danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

@keyframes previewPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* --- Section Styles --- */
section {
    position: relative;
    z-index: 1;
    padding: 80px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--accent-primary);
    text-transform: uppercase;
    margin-bottom: 12px;
    padding: 4px 12px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 100px;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Predictor Container --- */
.predictor-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.input-panel {
    flex: 1 1 380px;
    max-width: 100%;
}

.tower-panel {
    flex: 1 1 400px;
    max-width: 100%;
    min-width: 0;
}

.results-panel {
    flex: 1 1 300px;
    max-width: 100%;
}

/* --- Panels --- */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-base);
}

.panel:hover {
    border-color: rgba(124, 58, 237, 0.3);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(124, 58, 237, 0.03);
}

.panel-icon {
    font-size: 20px;
}

.panel-header h3 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-primary);
    flex: 1;
}

.panel-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.confidence-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
}

.confidence-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-body {
    padding: 24px;
}

.panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

/* --- Input Groups --- */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    transition: var(--transition-fast);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.5;
}

.select-wrapper select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition-fast);
    outline: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%238892a8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.select-wrapper select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.select-wrapper select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* --- Row Selector --- */
.row-selector {
    display: flex;
    gap: 8px;
}

.row-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.row-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.row-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    flex: 1;
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-primary.loading .btn-loader {
    display: block;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-secondary {
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent-tertiary);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.btn-secondary:hover {
    background: rgba(124, 58, 237, 0.2);
}

.btn-secondary.active {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
    animation: autoPulse 1.5s ease-in-out infinite;
}

@keyframes autoPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* --- Tower Grid --- */
.tower-container {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tower-empty-state {
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
    animation: dragonPulse 3s ease-in-out infinite;
}

.tower-empty-state p {
    font-size: 14px;
    line-height: 1.6;
}

.tower-grid {
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    gap: 6px;
}

.tower-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    animation: rowSlideIn 0.4s ease-out both;
}

@keyframes rowSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tower-tile {
    flex: 1;
    max-width: 80px;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: default;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.tower-tile.neutral {
    background: var(--neutral-tile);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tower-tile.safe {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
    animation: safePulse 2s ease-in-out infinite;
}

.tower-tile.safe::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.3), transparent 70%);
}

.tower-tile.safe::after {
    content: '💎';
    position: relative;
    z-index: 1;
    font-size: 22px;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.8));
}

@keyframes safePulse {
    0%, 100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.4); }
}

.tower-tile.danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.tower-tile.danger::after {
    content: '💀';
    font-size: 16px;
    opacity: 0.4;
}

.tower-tile:hover {
    transform: scale(1.08);
}

/* --- Tower Footer Info --- */
.tower-footer {
    flex-wrap: wrap;
}

.prediction-info {
    display: flex;
    gap: 24px;
    width: 100%;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-tertiary);
}

/* --- Prediction Log --- */
.log-container {
    max-height: 500px;
    overflow-y: auto;
}

.log-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.log-entry {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
    animation: logFadeIn 0.3s ease-out;
}

@keyframes logFadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.log-entry:hover {
    background: rgba(124, 58, 237, 0.05);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.log-detail {
    font-size: 12px;
    color: var(--text-secondary);
}

.log-path {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--success);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.log-difficulty {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.log-difficulty.easy { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.log-difficulty.medium { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.log-difficulty.hard { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.log-difficulty.expert { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.log-difficulty.master { background: rgba(168, 85, 247, 0.15); color: var(--accent-secondary); }

/* --- Steps Grid --- */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-base);
}

.step-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: var(--glow-purple);
}

.step-card:hover::before {
    opacity: 1;
}

.step-number {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.15;
    position: absolute;
    top: 12px;
    right: 16px;
}

.step-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.step-card h3 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.step-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Features Grid --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: var(--glow-purple);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- Footer --- */
#main-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-color);
    padding: 40px 32px;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand .logo-icon {
    -webkit-text-fill-color: initial;
    font-size: 24px;
}

.footer-disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links a {
    color: var(--accent-tertiary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-sep {
    opacity: 0.3;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .predictor-container {
        grid-template-columns: 1fr 1fr;
    }
    .results-panel {
        grid-column: span 2;
    }
}

@media (max-width: 992px) {
    #hero {
        flex-direction: column;
        text-align: center;
        padding-top: 140px;
    }
    .hero-content {
        max-width: 100%;
    }
    .hero-desc {
        margin: 0 auto 32px;
    }
    .hero-stats {
        justify-content: center;
    }
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-visual {
        display: none;
    }
}

@media (max-width: 768px) {
    #main-header {
        padding: 12px 16px;
    }
    .nav-links {
        display: none;
    }
    .header-status {
        display: none;
    }
    section {
        padding: 60px 16px;
    }
    .predictor-container {
        flex-direction: column;
    }
    .input-panel, .tower-panel, .results-panel {
        flex: 1 1 100%;
        width: 100%;
    }
    .hero-stats {
        flex-direction: column;
        align-items: center;
    }
    .stat-card {
        width: 100%;
        align-items: center;
    }
    .steps-grid {
        grid-template-columns: 1fr;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .panel-footer {
        flex-direction: column;
    }
    .tower-tile {
        max-width: 60px;
    }
}

@media (max-width: 480px) {
    .hero-title .title-line {
        font-size: 28px;
    }
    .hero-title .title-gradient {
        font-size: 36px;
    }
    .tower-tile {
        max-width: 48px;
    }
}

/* --- Stake Style Tower --- */
.stake-tower {
    background: #0f212e;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.stake-tower-body {
    position: relative;
    padding: 0;
    overflow: hidden;
    background: #1a2c38;
}

.dungeon-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* Dungeon decorative elements */
.dungeon-chain {
    position: absolute;
    top: -20px;
    width: 4px;
    height: 120px;
    background: repeating-linear-gradient(
        to bottom,
        #111,
        #111 10px,
        #333 10px,
        #333 15px
    );
    opacity: 0.3;
}
.chain-left { left: 15%; }
.chain-right { right: 15%; }

.tower-castle {
    position: relative;
    z-index: 2;
    max-width: 400px;
    margin: 60px auto 30px;
    background: #2f4553;
    border-radius: 8px 8px 0 0;
    border: 4px solid #1a2c38;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.5), 0 10px 20px rgba(0,0,0,0.4);
}

.dragon-top {
    position: absolute;
    top: -65px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 80px;
    z-index: 3;
    animation: hoverDragon 4s ease-in-out infinite;
}

@keyframes hoverDragon {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

.stone-wall-top {
    display: flex;
    justify-content: space-between;
    height: 18px;
    background: #4a5a6c;
    border-bottom: 3px solid #3a4a5c;
    border-radius: 4px 4px 0 0;
}

.merlon {
    width: 10%;
    height: 100%;
    background: #5a6a7c;
    border-radius: 2px 2px 0 0;
    border-right: 1px solid #4a5a6c;
    border-left: 1px solid #6a7a8c;
}

.stake-grid-wrapper {
    padding: 12px;
    min-height: auto;
}

/* Override existing tile styles for stake theme */
.stake-tower .tower-tile {
    background: #213743;
    border: 2px solid #1a2c38;
    border-radius: 4px;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.05), inset 0 -2px 4px rgba(0,0,0,0.2);
    aspect-ratio: auto;
    height: 38px;
    max-width: 100%;
}

.stake-tower .tower-tile.safe {
    background: #00e701;
    border-color: #00b300;
    box-shadow: inset 0 2px 6px rgba(255,255,255,0.4), inset 0 -4px 6px rgba(0,0,0,0.2);
    animation: none;
}

.stake-tower .tower-tile.safe::before { 
    display: none; 
}

.stake-tower .tower-tile.safe::after {
    content: '🐉';
    font-size: 20px;
    filter: none;
}

.stake-tower .tower-tile.danger {
    background: #2f4553;
    border-color: #1a2c38;
    opacity: 0.5;
}

.row-numbers {
    display: flex;
    flex-direction: column-reverse;
    position: absolute;
    left: 10px;
    bottom: 30px;
    gap: 6px;
    z-index: 2;
}

.row-number {
    font-size: 11px;
    color: #879097;
    font-weight: bold;
    height: 38px;
    display: flex;
    align-items: center;
}
