:root {
    --primary: #0bc2cf;
    --primary-dark: #008ea1;
    --secondary: #3a3a3a;
    --bg-light: #f4f7f8;
    --card-bg: #ffffff;
    --text-main: #3a3a3a;
    --text-muted: #6b7280;
    --accent: #ed5565;
    --success: #8cc152;
    --radius: 12px;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: #0bc2cf;
    /* Rich Animated Gradient Background */
    background: linear-gradient(-45deg, #0bc2cf, #31aae0, #9a49aa, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 18px;
    display: flex;
    flex-direction: column;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.navbar {
    padding: 1rem 0;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1001;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Titan One', sans-serif;
    font-size: 2rem;
    color: var(--primary);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.container {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.main-layout {
    display: flex;
    justify-content: center;
}

.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section.left-panel {
    width: 100%;
}

.pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.pack-card {
    background: var(--white);
    border: 3px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.27);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.05);
}

.pack-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.pack-card.selected {
    border-color: var(--primary);
    background: rgba(11, 194, 207, 0.05);
    box-shadow: 0 0 0 4px rgba(11, 194, 207, 0.2);
}

.pack-card h4 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--text-dark);
}

.pack-cost {
    font-size: 1rem;
    color: var(--text-medium);
    font-weight: 700;
}

.pack-icon-placeholder {
    width: 60px;
    height: 60px;
    background: var(--beige);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

h3 {
    font-family: 'Titan One', sans-serif;
    margin-bottom: 10px;
    font-size: 2.8rem;
    color: var(--secondary);

    line-height: 1.2;
}

.input-group {
    margin-bottom: 2rem;
}

label {
    display: block;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

.checkbox-group span {
    font-size: 1.4rem;
}

input,
select {
    width: 100%;
    padding: 1.2rem;
    background: #f8fafc;
    border: 3px solid #e2e8f0;
    border-radius: 8px;
    color: var(--text-main);
    outline: none;
    font-size: 1.3rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}

input:focus,
select:focus {
    border-color: var(--primary);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    margin-bottom: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 8px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 8px;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.btn-primary {
    width: 100%;
    padding: 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-bottom: 6px solid var(--primary-dark);
    border-radius: 8px;
    font-weight: 900;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.1s;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.1);
    width: auto;
}

.btn-primary:active {
    transform: translateY(3px);
    border-bottom-width: 3px;
}

/* Modal / Popup Results */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-content {
    background: var(--white);
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    border-radius: 8px;
    padding: 1rem 2.5rem;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 5px solid var(--primary);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-tabs {
    display: inline-flex;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 8px;
    gap: 0.5rem;
    margin-top: 1rem;
}

.res-tab-btn {
    background: transparent;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-muted);
}

.res-tab-btn.active {
    background: var(--primary);
    color: var(--white);
}

/* Results Bottom Section (50/50 Split) */
.results-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.summary-column {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 3px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.summary-grid-vertical {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.summary-box {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 1.3rem;
}

.chart-column {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 3px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.mini-select {
    padding: 0.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-weight: 800;
    width: auto;
}

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

/* Blook Grid */
.blook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
}

.blook-item {
    background: var(--white);
    border: 3px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 10px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.1s;
}

.blook-item:hover {
    transform: scale(1.05);
}

.blook-icon {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    padding: 0;
    position: relative;
    flex-shrink: 0;
}

.blook-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rarity-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    border-radius: 0 0 8px 8px;
}

.info h4 {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 1.8rem;
}

.info p {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.info p span {
    font-size: 1.4rem;
}

.summary-column h4,
.chart-header h4,
.chart-header select {
    font-size: 1.5rem;
}

.info span {
    color: var(--primary);
    font-weight: 800;
}

/* Pages: Trackers & Strategy */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h2 {
    font-family: 'Titan One', sans-serif;
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.strategies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.tracker-result {
    margin-top: 1.5rem;
    padding: 1.2rem;
    border-radius: 8px;
    background: #f1f5f9;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

/* Rarity Colors */
.uncommon {
    background: #8cc152;
}

.rare {
    background: #4a89dc;
}

.epic {
    background: #967adc;
}

.legendary {
    background: #f6bb42;
}

.chroma {
    background: #da4453;
}


.blook-name {
    font-size: 1.8rem;
    font-weight: 700;
}

.blook-chance {
    font-size: 1.4rem;
    color: #3bafda;
    font-weight: 700;
}

@media (max-width: 768px) {
    .dis_flexwrap {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .dis_flexwrap .input-group {
        width: 100% !important;
        margin-bottom: 1rem;
    }

    .dis_flexwrap button {
        width: 100% !important;
    }

    .container {
        padding: 0 15px;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .page-title {
        font-size: 2.2rem;
    }

    .card {
        padding: 1.5rem;
    }

    .blook-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .blook-item {
        padding: 10px;
    }

    .info h4 {
        font-size: 1.4rem;
    }

    .results-top-row {
        grid-template-columns: 1fr;
    }

    .navbar .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem;
    }

    .nav-menu {
        display: none;
    }

    .nav-menu.active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--purple);
        flex-direction: column;
        padding: 1rem;
        z-index: 1000;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
    }

    .pack-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .pack-card {
        padding: 1rem;
    }

    .pack-card h4 {
        font-size: 1rem;
        word-break: break-word;
    }

    /* Grids across the site */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr 1fr"],
    .calculator-grid,
    .strategies-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .page-title {
        font-size: 2rem !important;
        padding: 0 0.5rem;
    }

    .page-subtitle {
        font-size: 1.1rem !important;
        padding: 0 1rem;
    }

    .card,
    .content-card {
        padding: 1.25rem !important;
        width: 100% !important;
        max-width: none !important;
    }

    .btn {
        font-size: 1.2rem !important;
    }

    .tool-tabs {
        flex-direction: column;
        width: 100%;
    }

    .tool-tabs button {
        width: 100% !important;
        min-width: 0 !important;
    }
}

footer {
    padding: 4rem 1.5rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 700;
}

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

:root {
    /* Blooket Brand Colors */
    --cyan: #00C9DB;
    --cyan-hover: #00B0C0;
    --purple: #9a49aa;
    --purple-dark: #7a3888;
    --cream: #FAF8F5;
    --beige: #F5F3EF;
    --sky-blue: #A8D8EA;
    --white: #ffffff;
    --black: #000000;
    --text-dark: #2C3E50;
    --text-medium: #5A6C7D;
    --text-light: #8899A6;
    --border-light: #E8E6E3;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --shadow-color-strong: rgba(0, 0, 0, 0.15);

    /* Mapped Theme Colors */
    --primary-color: var(--cyan);
    --primary-hover: var(--cyan-hover);
    --secondary-color: var(--purple);
    --background-color: var(--cream);
    --surface-color: var(--white);
    --border-color: var(--border-light);
    --text-primary: var(--text-dark);
    --text-secondary: var(--text-medium);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow: 0 2px 8px 0 var(--shadow-color);
    --shadow-lg: 0 8px 24px 0 var(--shadow-color-strong);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0bc2cf;
    background-image: linear-gradient(180deg, #31aae0, #bbddff);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(15deg);
    opacity: 0.1;
    background-image: url('https://ac.blooket.com/@codeblooket/blooket-frontend-components/v0.2.36/assets/BlookCheckers-e975c505.png');
    background-size: 550px;
    background-repeat: repeat;
    width: 200%;
    height: 200%;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
.site-header {
    background-color: #9a49aa;
    box-shadow: 0 -6px rgba(0, 0, 0, 0.2) inset;
    top: 0;
    z-index: 1000;
    padding-bottom: 6px;
}

.navbar {
    padding: 1rem 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

.logo-text {
    color: white;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--cyan);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--cyan);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 1rem 0;
}

.page-header {
    text-align: center;
    margin-bottom: 1rem;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.content-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.content-card h2 {
    color: var(--text-primary);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.content-card h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.content-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 10px;
}

.content-card ul,
.content-card ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.content-card li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    letter-spacing: 0.3px;
}

.btn-primary {
    background-color: #9a49aa;
    color: white;
    box-shadow: 0 -6px rgba(0, 0, 0, 0.2) inset;
    padding-bottom: 1rem;
}

.btn-primary:hover {
    background-color: #b563c7;
    transform: translateY(-2px);

}

.btn-secondary {
    background-color: #9a49aa;
    color: white;
    border: 2px solid var(--purple-dark);
    box-shadow: 0 -6px rgba(0, 0, 0, 0.2) inset;
    padding-bottom: 1rem;
}

.btn-secondary:hover {
    background-color: #b563c7;
    transform: translateY(-2px);

}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: var(--surface-color);
    color: var(--text-primary);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 201, 219, 0.15);
    background-color: var(--white);
}

.form-textarea {
    resize: vertical;
    min-height: 150px;
}

/* Footer with Waves */
.site-footer {
    background-color: transparent;
    border-top: none;
    padding: 0;
    margin-top: auto;
    position: relative;
}

.waves {
    width: 100%;
    position: relative;
    height: 100px;
    overflow: hidden;
}

.waves svg {
    width: 100%;
    height: 100%;
}

.footer-wrapper {
    background-color: #1671e9;
    position: relative;
    z-index: 3;
}

.footer-content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7.5%;
    padding: 3rem 2rem;
    background-color: #1671e9;
    z-index: 2;
    position: relative;
}

.menu-list {
    min-width: 150px;
}

.menu-title {
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    margin-top: 0;
}

.menu-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-bottom: 0.75rem;
}

.menu-item a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.menu-item a:hover {
    color: white;
}

.copyright-text {
    margin: 0;
    padding: 3rem 0;
    color: white;
    background-color: #1671e9;
    font-size: 0.875rem;
    text-align: center;
    position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--background-color);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
        padding: 0.75rem 0;
    }

    .nav-link::after {
        display: none;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1.125rem;
    }

    .content-card {
        padding: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* FAQ Styling - Modern Accordion */
.faq-item {
    margin-bottom: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--cyan);
    box-shadow: 0 4px 12px rgba(154, 73, 170, 0.15);
}

.faq-question {
    color: white;
    padding: 1.25rem 3.5rem 1.25rem 1.5rem;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: color 0.2s ease;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.faq-question:hover {
    color: var(--cyan);
}

.faq-question::after {
    content: '▼';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    content: '▲';
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: var(--white);
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.8;
    padding: 0rem 1.5rem 0 1.5rem;
}

.faq-answer p:last-child {
    padding-bottom: 1.5rem;
}

.faq-answer a {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 600;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

/* Kids UI / Animations */
.floating-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 10;
    pointer-events: none;
}

.floating-icon {
    position: absolute;
    opacity: 0.15;
    animation: floatUp 15s linear infinite;
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
}

@keyframes floatUp {
    0% {
        transform: translateY(110vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.2;
    }

    90% {
        opacity: 0.2;
    }

    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Hover Effects for Cards */
.card,
.content-card,
.blook-card {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.27), box-shadow 0.3s ease;
}

.card:hover,
.content-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.blook-card:hover {
    transform: scale(1.1) rotate(2deg);
    z-index: 10;
}

/* Rarity Icon in Text */
.inline-rarity-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 5px;
    border-radius: 4px;
}

/* =========================================
   KID-FRIENDLY & ANIMATION ENHANCEMENTS
   ========================================= */

/* Rainbow Title Animation */
.page-title {
    /* background: linear-gradient(90deg, #ff4d4d, #f9cb28, #4dff4d, #4da6ff, #9933ff);
    background-size: 200% auto;
    -webkit-background-clip: text; */
    /* background-clip: text; */
    /* color: transparent; */
    animation: shine 4s linear infinite;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
    /* Subtle shadow behind text? No, clip hides it. */
    /* Fallback for old browsers if needed, but modern support is good */
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Card Entrance Animations */
.content-card,
.card {
    opacity: 0;
    animation: slideUpEntrance 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.content-card:nth-child(1) {
    animation-delay: 0.1s;
}

.content-card:nth-child(2) {
    animation-delay: 0.2s;
}

.content-card:nth-child(3) {
    animation-delay: 0.3s;
}

.content-card:nth-child(4) {
    animation-delay: 0.4s;
}

.content-card:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes slideUpEntrance {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Button & Interactive Bounce */
.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.btn-primary:active,
.btn-secondary:active {
    transform: translateY(-1px) scale(0.95);
}

/* Pulse Animation for Primary Actions */
#calculate-btn,
#simulate-btn {
    animation: softPulse 2s infinite;
}

@keyframes softPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 137, 220, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(74, 137, 220, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 137, 220, 0);
    }
}

/* =========================================
   ENHANCED POPUP / MODAL STYLES
   ========================================= */

/* Bouncy Entrance Animation */
@keyframes modalPop {
    0% {
        transform: scale(0.5) translateY(100px);
        opacity: 0;
    }

    70% {
        transform: scale(1.05) translateY(-10px);
        opacity: 1;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

#results-modal.active .modal-content {
    animation: modalPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.27) forwards;
}

/* To ensure animation triggers, we might need JS to toggle a class or just rely on display block. 
   If display:none -> block, animation works if on the element. */
.modal-content {
    animation: modalPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.27) forwards;

    /* Fun Styling */
    border: 6px solid #4a89dc;
    /* Blooket Blue */
    border-radius: 30px;
    box-shadow: 0 0 0 10px rgba(74, 137, 220, 0.3), 0 25px 50px rgba(0, 0, 0, 0.4);
    overflow: visible;
    /* Show the close button bounding box if it pops out */
}

/* Rainbow Glow Border Option */
.modal-content {
    position: relative;
    background-clip: padding-box;
    /* Ensure border is visible */
    border: 6px solid transparent;
    /* Transparent for gradient? No, solid color is better for kids style. */
    border-color: #3bafda;
}

/* Big Fun Close Button */
.close-modal {
    position: absolute;
    top: -20px;
    right: -20px;
    background: #da4453;
    /* Red */
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 100;
    opacity: 1;
}

.close-modal:hover {
    transform: scale(1.15) rotate(180deg);
    background: #e9573f;
    box-shadow: 0 8px 20px rgba(233, 87, 63, 0.4);
}

.close-modal:active {
    transform: scale(0.9);
}

/* Modal Backdrop Blur */
.modal-overlay {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.6);
}

/* =========================================
   SCROLLING FIX FOR MODAL
   ========================================= */

/* Make the modal a flex container so header stays fixed and body scrolls */
#results-modal.active .modal-content,
.modal-content {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    /* Increase safety margin */
}

.results-header {
    flex-shrink: 0;
    /* Header won't shrink */
}

#modal-results-body {
    flex: 1;
    /* Takes remaining space */
    overflow-y: auto;
    /* Scrollable */
    min-height: 0;
    /* Firefox flex fix */
    padding: 1rem;
    padding-right: 0.5rem;
    /* Avoid scrollbar overlap */

    /* Smooth Scroll */
    scroll-behavior: smooth;
}

/* Custom Kid-Friendly Scrollbar */
#modal-results-body::-webkit-scrollbar {
    width: 12px;
}

#modal-results-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#modal-results-body::-webkit-scrollbar-thumb {
    background: #4a89dc;
    border-radius: 10px;
    border: 3px solid #f1f1f1;
}

#modal-results-body::-webkit-scrollbar-thumb:hover {
    background: #3bafda;
}

/* Ensure grid doesn't break layout */
.results-bottom-row {
    margin-bottom: 2rem;
}

/* =========================================
   CSS-BASED RARITY ICONS (Reliable & Sharp)
   ========================================= */
.rarity-icon-css {
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    vertical-align: text-bottom;
    position: relative;
    top: -1px;
}

/* Uncommon: Triangle (Green) */
.rarity-icon-css.uncommon {
    background-color: #8cc152;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* Rare: Diamond (Blue) */
.rarity-icon-css.rare {
    background-color: #4a89dc;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transform: scale(0.9);
}

/* Epic: Pentagon (Red) */
.rarity-icon-css.epic {
    background-color: #da4453;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

/* Legendary: Star (Gold) */
.rarity-icon-css.legendary {
    background-color: #f6bb42;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Chroma: Star (Teal) + Spin */
.rarity-icon-css.chroma {
    background-color: #0bc2cf;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: softPulse 2s infinite;
    /* Don't spin, might be distracting to read. Pulse is nice. */
}

/* Mystical: Hexagon (Purple) */
.rarity-icon-css.mystical {
    background-color: #967adc;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}