:root {
    --bg-color: #0B0E14;
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --accent-1: #38BDF8;
    --accent-2: #818CF8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0 20px 20px;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: drift 20s infinite alternate ease-in-out;
}

.glow-1 {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, var(--accent-1) 0%, transparent 70%);
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 0;
}

.header-inner {
    position: relative;
    height: 300px;
    overflow: hidden;
    border-radius: 12px;
}

/* Logo image — fills the fixed-height container */
.header-logo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 1;
    border-radius: 12px;
    pointer-events: none;
}

/* Tagline — floats over the logo image, anchored to the bottom */
.header-tagline {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.08em;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 1);
}

.top-disclosure {
    position: absolute;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    z-index: 10;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

@media (max-width: 600px) {
    .header-tagline,
    .top-disclosure {
        white-space: normal;
        text-align: center;
        width: 90%;
        left: 5%;
        transform: none;
    }

    .header-tagline {
        font-size: 0.85rem;
        bottom: 18%;
        letter-spacing: 0.03em;
    }

    .top-disclosure {
        font-size: 0.6rem;
        bottom: 4%;
    }
}

.app-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    max-width: 1300px;
    margin: 0 auto;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.controls {
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: 1px solid var(--glass-border);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

select:focus,
select:hover {
    border-color: var(--accent-2);
    outline: none;
}

.radio-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1rem;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}

.radio-label:hover {
    background: rgba(0, 0, 0, 0.4);
}

.radio-label input[type="radio"] {
    accent-color: var(--accent-1);
    transform: scale(1.2);
}

/* CUSTOM DROPDOWN */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-select-trigger:hover,
.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--accent-2);
}

.custom-select-trigger svg {
    transition: transform 0.3s ease;
}

.custom-select-wrapper.open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 18, 25, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    max-height: 350px;
}

.custom-select-wrapper.open .custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-search-container {
    padding: 12px;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    background: rgba(15, 18, 25, 0.95);
    border-radius: 12px 12px 0 0;
}

#custom-tablet-search {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    outline: none;
}

#custom-tablet-search:focus {
    border-color: var(--accent-1);
}

.custom-select-options {
    overflow-y: auto;
    padding: 8px;
}

.custom-option {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.95rem;
}

.custom-option:hover,
.custom-option.selected {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-1);
}

.btn-rotate {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(0, 240, 255, 0.08);
    color: var(--accent-1);
    border: 1px solid var(--accent-1);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.03em;
}

.btn-rotate:hover {
    background: rgba(0, 240, 255, 0.18);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.light-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.btn-light {
    padding: 9px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-light.active {
    background: rgba(255, 200, 50, 0.15);
    border-color: rgba(255, 200, 50, 0.6);
    color: #ffd060;
    box-shadow: 0 0 10px rgba(255, 200, 50, 0.2);
}

/* Glare overlay — sits on top of the comic image inside the screen */
.glare-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.5s ease, background 0.5s ease;
    z-index: 2;
}

.stats-panel {
    margin-top: 10px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
    display: grid;
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-item span.label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-item span.value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-1);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.stars {
    display: inline-flex;
    gap: 1px;
    font-size: 1rem;
    line-height: 1;
}

.star {
    display: inline-block;
}

.star-full {
    color: #FFB800;
}

.star-empty {
    color: rgba(255, 184, 0, 0.22);
}

.star-half {
    position: relative;
    color: rgba(255, 184, 0, 0.22);
}

.star-half .star-bg {
    display: block;
}

.star-half .star-fg {
    position: absolute;
    inset: 0;
    width: 50%;
    overflow: hidden;
    color: #FFB800;
}

/* ── Info icon (ⓘ) + tooltip ─────────────────────────────────── */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-style: normal;
    color: var(--accent-2);
    opacity: 0.7;
    cursor: help;
    position: relative;
    vertical-align: middle;
    transition: opacity 0.2s ease;
    /* Ensure tooltip is positioned relative to the icon */
    line-height: 1;
}

.info-icon:hover {
    opacity: 1;
}

/* Tooltip bubble */
.info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    padding: 10px 14px;
    background: rgba(10, 12, 20, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 400;
    font-family: 'Outfit', sans-serif;
    line-height: 1.5;
    white-space: pre-line;
    /* respects \n in tooltip text */
    text-transform: none;
    letter-spacing: normal;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 200;
}

/* Small arrow pointing down */
.info-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--glass-border);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    z-index: 201;
}

.info-icon:hover::after,
.info-icon:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.leaderboard-panel {
    margin-top: 10px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-panel h3 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.leaderboard-item .metric-info {
    display: flex;
    flex-direction: column;
}

.leaderboard-item .metric-info span.metric {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}



.leaderboard-item .metric-info span.winner {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.leaderboard-item .score {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-1);
}

.leaderboard-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(56, 189, 248, 0.4);
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.leaderboard-link:hover {
    color: var(--accent-1);
    text-decoration-color: var(--accent-1);
}

.viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: auto;
    padding: 20px 20px 40px;
    position: relative;
    min-width: 0;
}

/* TABLET FÍSICO */
.tablet-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    /* Frame is always the right scaled size — no overflow */
    justify-content: center;
    width: 100%;
    overflow: visible;
}

.tablet-frame {
    background: #1a1a24;
    border-radius: 28px;
    box-shadow:
        0 40px 80px -20px rgba(0, 0, 0, 0.8),
        inset 0 0 0 1px #2a2a35,
        0 0 0 1px #000;
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1),
        height 0.6s cubic-bezier(0.25, 1, 0.5, 1),
        padding 0.6s cubic-bezier(0.25, 1, 0.5, 1),
        border-radius 0.4s ease,
        box-shadow 0.6s ease;
    display: flex;
    align-items: stretch;
    position: relative;
    margin: 0 auto;
    overflow: visible;
    box-sizing: border-box;
}

.tablet-frame::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -15px;
    width: 4px;
    height: 50px;
    background: #111;
    border-radius: 0 4px 4px 0;
    transform: translateY(-50%);
}

.screen {
    width: 100%;
    height: 100%;
    background: #05050A;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.screen.overlay-mode {
    overflow: visible;
    /* Permite que o livro saia das margens */
}

/* Guias Visuais do Tablet em Overlay Mode */
.screen.overlay-mode::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--accent-1);
    /* Área exata do Ecrã */
    border-radius: 16px;
    pointer-events: none;
    z-index: 50;
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.2);
}

.screen.overlay-mode::after {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    /* Casing exterior do Tablet */
    border-radius: 28px;
    pointer-events: none;
    z-index: 50;
}

#comic-page {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    /* Only animate size and brightness, NOT position (prevents snap-to-center bug) */
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1),
        height 0.6s cubic-bezier(0.25, 1, 0.5, 1),
        filter 0.6s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: block;
    max-width: none;
}

.dimensions-label {
    margin-top: 80px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dimensions-label span {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.dimensions-label .vs {
    background: transparent;
    border: none;
    font-style: italic;
    opacity: 0.5;
    padding: 0;
}

.scale-indicator {
    margin-top: 10px;
    font-size: 0.78rem;
    color: rgba(255, 115, 0, 0.7);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.02em;
    text-align: center;
}

.scale-indicator.scale-accurate {
    color: #4aff8c;
}

/* RESPONSIVE - TABLET / MOBILE */
@media (max-width: 900px) {
    header {
        padding: 20px 20px 10px;
        margin-bottom: 16px;
    }

    .comictab-logo {
        /* Force a minimum height so the SVG text stays legible on narrow screens */
        min-height: 70px;
    }

    .app-container {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 0 16px 30px;
    }

    .app-container.home-mode .viewer {
        order: -1;
    }

    .glass-panel {
        padding: 20px;
        border-radius: 16px;
    }

    .controls {
        gap: 16px;
    }

    /* Dropdown máximo em mobile */
    .custom-select-dropdown {
        max-height: 220px;
    }

    /* Viewer não tem altura mínima em mobile */
    .viewer {
        min-height: auto;
        padding: 16px 12px 24px;
    }

    /* Tablet frame is now scaled dynamically by JS */

    .dimensions-label {
        margin-top: 20px;
        flex-wrap: wrap;
        justify-content: center;
        font-size: 0.75rem;
        gap: 8px;
    }

    /* Leaderboard grid compacto */
    .leaderboard-item {
        padding: 8px 12px;
    }

    .leaderboard-item .metric-info span.winner {
        font-size: 0.82rem;
    }

    .stat-item span.value {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.6rem;
    }

    /* Tablet frame is now scaled dynamically by JS */

    .app-container {
        padding: 0 10px 20px;
    }
}

/* ── Multi-View System ────────────────────────────────────────── */
.view-panel {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.view-panel.active {
    display: flex;
}

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

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

.view-title {
    margin-top: 0;
    margin-bottom: 30px;
    color: var(--accent-1);
    font-size: 1.8rem;
    text-align: center;
}

.simulator-tablet-name {
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.btn-back {
    align-self: flex-start;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-back:hover {
    color: var(--text-primary);
    border-color: var(--accent-1);
    background: rgba(255, 255, 255, 0.1);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 800px;
}

.category-card {
    background: transparent;
    padding: 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    aspect-ratio: 5/7;
    /* Ajustado para acompanhar o prolongamento vertical do tablet */
    max-width: 250px;
    width: 100%;
    margin: 0 auto;
}

.cat-svg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.5));
    transition: all 0.3s ease;
}

.cat-tablet-body {
    fill: #ffffff;
    stroke: #1a1a24;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.cat-tablet-screen {
    fill: #e5e7eb;
    stroke: #1a1a24;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.cat-svg-fill {
    fill: #333333;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.05);
}

.category-card:hover .cat-svg {
    filter: drop-shadow(0 25px 40px rgba(255, 255, 255, 0.2));
}

.category-card:hover .cat-tablet-body {
    stroke: var(--accent-1);
}

.category-card:hover .cat-tablet-screen {
    stroke: var(--accent-1);
    fill: #f3f4f6;
}

.cat-img-bg {
    position: absolute;
    z-index: 1;
    /* Alinhado com o ecrã do SVG */
    top: 15.6%;
    bottom: 15.6%;
    left: 21.6%;
    right: 21.6%;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.category-card:hover .cat-img-bg {
    opacity: 0.9;
    transform: scale(1.05);
}

.cat-content {
    position: absolute;
    z-index: 2;
    top: 15.4%;
    bottom: 15.4%;
    left: 21.5%;
    right: 21.5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px);
}

.category-card h3 {
    margin: 0;
    font-size: 1.15rem;
    /* Menor para caber perfeitamente no ecrã limitado */
    font-weight: 700;
    color: #1f2937;
    line-height: 1.1;
    word-wrap: break-word;
}

.category-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #4b5563;
}

.dropdown-empty-state {
    padding: 16px 12px;
    text-align: center;
}

.dropdown-empty-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.dropdown-empty-body {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 0;
}

.missing-tablet-hint {
    margin-top: 32px;
    max-width: 520px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
    padding: 16px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.missing-tablet-hint strong {
    color: var(--text-primary);
}

.mosaic-empty-state {
    width: 100%;
    text-align: center;
    padding: 32px 20px;
}

.mosaic-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 10px;
}

.mosaic-empty-body {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0;
}

.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    width: 100%;
}

.mosaic-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.mosaic-card:hover {
    border-color: var(--accent-1);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mosaic-icon {
    width: 60px;
    height: 80px;
    border-radius: 4px;
    background: #1a1a24;
    border: 1px solid #333;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.mosaic-icon::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: #05050A;
    border-radius: 2px;
}

.mosaic-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.affiliate-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.buy-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #ff9900 0%, #ffb31a 100%);
    color: #000 !important;
    text-decoration: none !important;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
}

.buy-button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 153, 0, 0.5);
    background: linear-gradient(135deg, #ffb31a 0%, #ffcc33 100%);
}

.buy-button span {
    font-size: 1.2rem;
}

.mosaic-brand {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mosaic-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mosaic-stat {
    font-size: 0.8rem;
    color: var(--accent-1);
    margin-top: 4px;
}

/* ── Footer & Modals ────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--glass-border);
}

.footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.footer-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
}

.footer-link:hover {
    color: var(--accent-1);
    text-decoration: underline;
}

.footer-sep {
    color: var(--text-secondary);
    opacity: 0.5;
}

.ct-verified-origin {}

.footer-copy {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.7;
}

.amazon-disclosure {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.5;
    margin: 15px auto 5px auto;
    max-width: 600px;
    line-height: 1.4;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: rgba(15, 18, 25, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0 10px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-box h2 {
    color: var(--accent-1);
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 1.8rem;
}

.modal-box h3 {
    color: var(--accent-2);
    font-size: 1.2rem;
    margin: 24px 0 12px;
}

.modal-box p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 1rem;
}

.modal-box strong {
    color: var(--text-primary);
}

.modal-mission {
    font-size: 1.1rem !important;
    color: var(--accent-1) !important;
    font-weight: 600;
    margin-top: 24px;
    text-align: center;
    padding: 15px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 12px;
}

.modal-link {
    color: var(--accent-1);
    text-decoration: none;
    font-weight: 600;
}

.modal-link:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .modal-box {
        padding: 30px 20px;
    }
}

/* ── Comparison Mode ─────────────────────────────────────────── */
.btn-compare {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(129, 140, 248, 0.08);
    color: var(--accent-2);
    border: 1px solid rgba(129, 140, 248, 0.3);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.03em;
}

.btn-compare:hover {
    background: rgba(129, 140, 248, 0.18);
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.3);
}

.btn-compare.active {
    background: rgba(129, 140, 248, 0.2);
    border-color: var(--accent-2);
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.3);
}

#custom-tablet2-search {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    outline: none;
}

#custom-tablet2-search:focus {
    border-color: var(--accent-2);
}

.comparison-twins {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.comparison-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.comp-tablet-name {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    min-height: 2.6em;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

#comp-comic-a,
#comp-comic-b {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1),
        height 0.6s cubic-bezier(0.25, 1, 0.5, 1),
        filter 0.6s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: block;
    max-width: none;
}

#comparison-stats-table {
    width: 100%;
    margin-top: 24px;
}

.comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.comp-table th,
.comp-table td {
    padding: 10px 14px;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

.comp-table th {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 12px;
}

.comp-table td:first-child {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
}

.comp-winner {
    color: #4ade80;
    font-weight: 700;
}

.comp-affiliate-row {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.comp-affiliate-col {
    flex: 1;
}

.comp-affiliate-col .buy-button {
    font-size: 0.8rem;
    padding: 10px 12px;
    gap: 6px;
}

@media (max-width: 700px) {
    .comparison-twins {
        flex-direction: column;
        align-items: center;
    }

    .comparison-col {
        width: 100%;
    }

    .comp-affiliate-row {
        flex-direction: column;
    }
}