/* ============================================
   TRUE MAGIC FIND — SkyBlock Drop Calculator
   Modern Dark Theme
   ============================================ */

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

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: #161638;
    --bg-card-hover: #1c1c45;
    --bg-input: #0d0d24;
    --border: #2a2a5a;
    --border-glow: #6c5ce7;
    
    --text-primary: #e8e8f0;
    --text-secondary: #9090b8;
    --text-muted: #606088;
    
    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);
    
    --gold: #ffaa00;
    --gold-glow: rgba(255, 170, 0, 0.3);
    --green: #00d166;
    --green-glow: rgba(0, 209, 102, 0.2);
    --red: #ff4757;
    --blue: #45b7ff;
    --legendary: #ffaa00;
    --epic: #aa00ff;
    --rare: #5555ff;
    --uncommon: #55ff55;
    --common: #aaaaaa;
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);
}

html {
    scroll-behavior: smooth;
}

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

/* hide the live API items section until needed */
.api-section {
    display: none;
}

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

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-secondary);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh) scale(1);
    }
}

/* === Header === */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px var(--green-glow));
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 8px var(--green-glow)); }
    50% { filter: drop-shadow(0 0 16px var(--green)); }
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 4px;
}

.player-lookup {
    flex: 0 1 360px;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group.compact input {
    flex: 1;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #7c6cf0);
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

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

.btn-accent {
    background: linear-gradient(135deg, var(--gold), #e69500);
    color: #1a1a00;
    box-shadow: 0 2px 12px var(--gold-glow);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--gold-glow);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    margin-top: 8px;
}

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

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

/* === Inputs === */
input[type="text"],
input[type="number"],
select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
}

input:focus, select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="number"] {
    font-family: var(--font-mono);
    font-weight: 600;
}

/* disabled controls should look muted and show unavailability */
input:disabled,
select:disabled,
input[type="range"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239090b8'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* === Range Slider === */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    outline: none;
    margin: 12px 0 4px;
    border: 1px solid var(--border);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-container {
    padding: 0 2px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0 2px;
}

/* === Player Info Bar === */
.player-info {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(0, 209, 102, 0.1));
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    position: relative;
    z-index: 50;
}

.player-info-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.player-head {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--accent-primary);
    image-rendering: pixelated;
}

.player-details {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    flex: 1;
}

.player-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gold);
}

.player-stat {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-stat strong {
    color: var(--green);
    font-family: var(--font-mono);
}

/* === Main Content === */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    position: relative;
    z-index: 1;
}

/* === Sections === */
.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(108, 92, 231, 0.3);
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--accent-secondary);
}

/* === Calculator Section === */
.calculator-section {
    margin-bottom: 48px;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.label-icon {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.label-icon img {
    width: 1.2em;
    height: 1.2em;
    object-fit: contain;
    margin-right: 0.25em;
}

.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.input-with-suffix input {
    padding-right: 50px;
}

.input-with-suffix .suffix {
    position: absolute;
    right: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-secondary);
    font-family: var(--font-mono);
}

.base-chance-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chance-prefix {
    font-weight: 700;
    color: var(--accent-secondary);
    white-space: nowrap;
    font-size: 0.95rem;
}

.hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.compact-form {
    margin-top: 12px;
}

.compact-form label {
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.compact-form input {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* === Results === */
.results-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.results-content {
    animation: fadeIn 0.4s ease;
}

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

.result-main {
    text-align: center;
    padding: 20px 0;
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.result-value {
    font-size: 2.8rem;
    font-weight: 800;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, var(--green), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.result-ratio {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--gold);
    margin-top: 4px;
}

.result-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.result-item {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-item.price-highlight {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.1), rgba(255, 170, 0, 0.05));
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.result-item.profit-highlight {
    background: linear-gradient(135deg, rgba(0, 209, 102, 0.1), rgba(0, 209, 102, 0.05));
    border: 1px solid rgba(0, 209, 102, 0.3);
}

.result-item-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.result-item-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.result-item.price-highlight .result-item-value {
    color: var(--gold);
}

.result-item.profit-highlight .result-item-value {
    color: var(--green);
}

.result-section h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* === Kills Table === */
.kills-table {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.kills-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 10px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.kills-row:last-child {
    border-bottom: none;
}

.kills-header {
    background: var(--bg-input);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kills-row:not(.kills-header) span:first-child {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-secondary);
}

.kills-row:not(.kills-header) span:last-child {
    font-family: var(--font-mono);
    font-weight: 600;
    text-align: right;
}

/* === Chance Bar === */
.chance-bar-container {
    margin-top: 8px;
}

.chance-bar {
    height: 24px;
    background: var(--bg-input);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

.chance-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--accent-primary));
    border-radius: 12px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2px;
    position: relative;
}

.chance-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.chance-bar-label {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-family: var(--font-mono);
}

/* === Items Section === */
.items-section, .api-section {
    margin-bottom: 48px;
}

.items-controls, .api-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    border: none;
    background: transparent;
    padding: 10px 0;
}

.search-box input:focus {
    box-shadow: none;
}

.search-icon {
    font-size: 0.9rem;
    opacity: 0.5;
}

/* === Filter Tabs === */
.filter-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-main);
}

.filter-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* === Items Grid === */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 14px;
}

.item-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    image-rendering: pixelated;
    border: 1px solid var(--border);
    overflow: hidden;
}

.item-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-name.legendary { color: var(--legendary); }
.item-name.epic { color: var(--epic); }
.item-name.rare { color: var(--rare); }
.item-name.uncommon { color: var(--uncommon); }
.item-name.common { color: var(--common); }

.item-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.item-chance {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--accent-secondary);
}

.item-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-slayer { background: rgba(255, 71, 87, 0.2); color: var(--red); }
.tag-dungeon { background: rgba(69, 183, 255, 0.2); color: var(--blue); }
.tag-mining { background: rgba(255, 170, 0, 0.2); color: var(--gold); }
.tag-fishing { background: rgba(0, 209, 102, 0.2); color: var(--green); }
.tag-combat { background: rgba(162, 155, 254, 0.2); color: var(--accent-secondary); }
.tag-pet { background: rgba(170, 0, 255, 0.2); color: var(--epic); }

/* === Google Search Button === */
.item-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.google-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(66, 133, 244, 0.15);
    border: 1px solid rgba(66, 133, 244, 0.35);
    color: #8ab4f8;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    flex-shrink: 0;
}

.item-card:hover .google-search-btn {
    opacity: 1;
}

.google-search-btn:hover {
    background: rgba(66, 133, 244, 0.35) !important;
    border-color: rgba(66, 133, 244, 0.7) !important;
    color: #fff !important;
}

/* === Donate Button === */
.donate-wrapper {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.donate-text {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.donate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 8px;
    background: linear-gradient(135deg, #003087, #009cde);
    color: #fff;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.15);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 4px 15px rgba(0, 144, 210, 0.25);
}

.donate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(0, 144, 210, 0.45);
    opacity: 0.92;
}

.paypal-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* === Dungeon Card (Fixed Rate) === */
.dungeon-card {
    border: 1px solid rgba(69, 183, 255, 0.25) !important;
}

.dungeon-card:hover {
    border-color: rgba(69, 183, 255, 0.5) !important;
}

.dungeon-fixed-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--blue);
    margin-bottom: 4px;
    opacity: 0.85;
}

.dungeon-floor-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.floor-select {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid rgba(69, 183, 255, 0.3);
    background: var(--bg-input);
    color: var(--blue);
    cursor: pointer;
    outline: none;
    min-width: 100px;
}

.floor-select:hover,
.floor-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 6px rgba(69, 183, 255, 0.3);
}

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

.dungeon-rate {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    white-space: nowrap;
}

/* === Loading === */
.items-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

/* === Footer === */
.footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
}

.footer-sub {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    margin-top: 4px;
    color: var(--text-muted);
    opacity: 0.6;
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 14px 24px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* === Utility === */
.hidden {
    display: none !important;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* === Responsive === */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .logo {
        justify-content: center;
    }
    
    .player-lookup {
        flex: 1 1 100%;
    }
    
    .player-info-content {
        flex-direction: column;
        text-align: center;
    }
    
    .player-details {
        justify-content: center;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
}

/* === No results === */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* === API item cards === */
.api-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-item-card:hover {
    border-color: var(--gold);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--gold-glow);
}

.api-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.api-item-name {
    font-weight: 600;
    font-size: 0.85rem;
    flex: 1;
}

.api-item-name.LEGENDARY { color: var(--legendary); }
.api-item-name.EPIC { color: var(--epic); }
.api-item-name.RARE { color: var(--rare); }
.api-item-name.UNCOMMON { color: var(--uncommon); }
.api-item-name.COMMON { color: var(--common); }
.api-item-name.MYTHIC { color: #ff55ff; }
.api-item-name.DIVINE { color: #55ffff; }
.api-item-name.SPECIAL { color: #ff5555; }
.api-item-name.VERY_SPECIAL { color: #ff5555; }

/* ============================================
   LANDING PAGE STYLES
   ============================================ */

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(108, 92, 231, 0.1);
}

.nav-link.active {
    color: var(--accent-primary);
}

.nav-kofi {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(0, 209, 102, 0.1)) !important;
    border: 1px solid rgba(108, 92, 231, 0.3);
    color: var(--accent-primary) !important;
}

.nav-kofi:hover {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.4), rgba(0, 209, 102, 0.2)) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

/* Landing Page Layout */
.landing-main {
    padding: 0;
}

.calculator-main {
    padding: 32px 24px;
}

.player-lookup-bar {
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    position: relative;
    z-index: 50;
}

.player-lookup-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--green), var(--accent-secondary), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    display: inline-flex;
    width: auto;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.magic-find-display {
    width: 280px;
    height: 280px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    box-shadow: 0 20px 60px var(--accent-glow);
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.mf-value {
    font-size: 4.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.magic-find-display span {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}

/* Features Section */
.features-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
}

.features-section h2 {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 48px;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    border: none;
    padding: 0;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* How It Works Section */
.how-it-works {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.05), rgba(0, 209, 102, 0.05));
    border-radius: var(--radius-xl);
    margin: 40px auto;
}

.how-it-works h2 {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 48px;
    color: var(--text-primary);
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    box-shadow: 0 8px 24px var(--accent-glow);
}

.step h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.step p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Stats Section */
.stats-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
}

.stats-section h2 {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 48px;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-box {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-secondary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Testimonials Section */
.testimonials-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
}

.testimonials-section h2 {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 48px;
    color: var(--text-primary);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.testimonial {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.3s ease;
}

.testimonial:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.testimonial-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
    font-style: italic;
}

.testimonial-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* CTA Section */
.cta-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
    text-align: center;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(0, 209, 102, 0.1));
    border-radius: var(--radius-xl);
    margin: 40px auto;
}

.cta-section h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.cta-section p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* === Trending Items Section === */
.trending-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, rgba(0, 209, 102, 0.08), rgba(108, 92, 231, 0.08));
    border-radius: var(--radius-xl);
    margin: 40px auto;
}

.trending-section h2 {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1rem;
}

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

.trending-item {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(0, 209, 102, 0.05));
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.trending-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.trending-item:hover::before {
    left: 100%;
}

.trending-item:hover {
    border-color: var(--accent-secondary);
    box-shadow: 0 12px 40px rgba(0, 209, 102, 0.2);
    transform: translateY(-8px);
}

.item-rarity {
    font-size: 2rem;
    margin-bottom: 12px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

.item-rarity.rare {
    animation-delay: 0s;
}

.item-rarity.mythic {
    animation-delay: 0.5s;
}

.item-rarity.epic {
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.trending-item h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.item-rate {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    font-weight: 600;
}

/* === FAQ Section === */
.faq-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
}

.faq-section h2 {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 48px;
    color: var(--text-primary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.faq-card {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(0, 209, 102, 0.04));
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.faq-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    transition: height 0.3s ease;
}

.faq-card:hover::before {
    height: 100%;
}

.faq-card:hover {
    border-color: var(--accent-secondary);
    box-shadow: 0 12px 40px rgba(108, 92, 231, 0.2);
    transform: translateX(6px);
}

.faq-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    border: none;
    padding: 0;
}

.faq-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* === Support Section === */
.support-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(0, 209, 102, 0.08));
    border-radius: var(--radius-xl);
    margin: 40px auto;
    text-align: center;
}

.support-section h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.support-section p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.support-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

#kofiframe {
    animation: slideUp 0.6s ease-out;
}

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

/* === Animations === */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.stat-box {
    animation: fadeInUp 0.5s ease-out;
}

.stat-box:nth-child(2) { animation-delay: 0.1s; }
.stat-box:nth-child(3) { animation-delay: 0.2s; }
.stat-box:nth-child(4) { animation-delay: 0.3s; }

.feature-card {
    animation: fadeInUp 0.5s ease-out;
}

.feature-card:nth-child(1) { animation-delay: 0s; }
.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.2s; }
.feature-card:nth-child(4) { animation-delay: 0.3s; }

.step {
    animation: fadeInUp 0.5s ease-out;
}

.step:nth-child(1) { animation-delay: 0s; }
.step:nth-child(2) { animation-delay: 0.1s; }
.step:nth-child(3) { animation-delay: 0.2s; }

.testimonial {
    animation: fadeInUp 0.5s ease-out;
}

.testimonial:nth-child(1) { animation-delay: 0s; }
.testimonial:nth-child(2) { animation-delay: 0.1s; }
.testimonial:nth-child(3) { animation-delay: 0.2s; }
.testimonial:nth-child(4) { animation-delay: 0.3s; }

.trending-item {
    animation: fadeInUp 0.5s ease-out;
}

.trending-item:nth-child(1) { animation-delay: 0s; }
.trending-item:nth-child(2) { animation-delay: 0.1s; }
.trending-item:nth-child(3) { animation-delay: 0.2s; }
.trending-item:nth-child(4) { animation-delay: 0.3s; }

.faq-card {
    animation: fadeInUp 0.5s ease-out;
}

.faq-card:nth-child(1) { animation-delay: 0s; }
.faq-card:nth-child(2) { animation-delay: 0.1s; }
.faq-card:nth-child(3) { animation-delay: 0.2s; }
.faq-card:nth-child(4) { animation-delay: 0.3s; }

/* Responsive Landing */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 48px 24px;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-visual {
        display: none;
    }
    
    .features-section,
    .how-it-works,
    .stats-section,
    .testimonials-section,
    .cta-section,
    .trending-section,
    .faq-section,
    .support-section {
        padding: 48px 24px;
    }
    
    .features-section h2,
    .how-it-works h2,
    .stats-section h2,
    .testimonials-section h2,
    .cta-section h2,
    .trending-section h2,
    .faq-section h2,
    .support-section h2 {
        font-size: 1.8rem;
    }
    
    .nav-menu {
        gap: 8px;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .trending-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    #kofiframe {
        height: auto;
    }
}
