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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: #0f3460;
    color: white;
    padding: 40px;
    text-align: center;
    border-bottom: 3px solid #e94560;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 40px;
}

section {
    margin-bottom: 40px;
}

h2 {
    color: #0f3460;
    margin-bottom: 20px;
    font-size: 1.8em;
}

h3 {
    color: #16213e;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.set-display {
    background: white;
    margin-bottom: 40px;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.set-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.set-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(15, 52, 96, 0.1);
    padding: 5px;
    border: 2px solid #0f3460;
}

.set-title {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.set-header h2 {
    margin: 0;
    color: #0f3460;
}

.set-badge {
    background: #0f3460;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.set-badge.upcoming {
    background: #e94560;
}

.price-reference {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.ref-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ref-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
}

.ref-value {
    font-size: 1.2em;
    color: #16213e;
    font-weight: bold;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 1.1em;
    font-weight: 500;
}

.input-group input {
    padding: 12px 20px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    width: 150px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #e94560;
}

.calc-btn {
    background: #e94560;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
    background: #d63851;
}

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

.roi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.roi-card {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.roi-card h3 {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.roi-price {
    font-size: 1.3em;
    color: #16213e;
    font-weight: bold;
    margin: 5px 0;
}

.roi-value {
    font-size: 2em;
    font-weight: bold;
    margin: 10px 0 0 0;
}

.roi-value.positive {
    color: #10b981;
}

.roi-value.negative {
    color: #ef4444;
}

.roi-value.neutral {
    color: #666;
}

.profit-prob {
    font-size: 0.9em;
    color: #666;
    margin-top: 8px;
    font-weight: 500;
}

.value-table {
    margin-top: 30px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.value-table h3 {
    margin-bottom: 15px;
}

.value-table table {
    width: 100%;
    min-width: 100%;
}

.result-card {
    background: #f5f5f5;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #0f3460;
}

.big-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #0f3460;
    margin-top: 10px;
}

.sub-text {
    font-size: 0.9em;
    color: #666;
    margin-top: 8px;
}

.breakdown {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    table-layout: auto;
}

thead {
    background: #0f3460;
    color: white;
}

th, td {
    padding: 12px;
    text-align: left;
}

/* Row striping for data rows only */
.rarity-row:nth-child(odd) {
    background: #f5f5f5;
}

/* Hover effect only for rarity rows */
.rarity-row:hover {
    background: #e8e8e8;
}

/* No hover effect for details rows */
.details-row {
    background: transparent !important;
}

.details-row:hover {
    background: transparent !important;
}

.details-row td {
    padding: 0 !important;
    border: none !important;
}

.simulation {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
}

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

.stat {
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-weight: 600;
    color: #666;
}

.stat-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #0f3460;
}

.info-section {
    border-left: none !important;
    background: white;
    margin-bottom: 40px;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pull-rates {
    display: grid;
    gap: 12px;
}

.rate-item {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rarity-label {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    color: white;
    min-width: 100px;
    text-align: center;
}

.rarity-label.common {
    background: #9ca3af;
}

.rarity-label.uncommon {
    background: #10b981;
}

.rarity-label.rare {
    background: #3b82f6;
}

.rarity-label.epic {
    background: #8b5cf6;
}

.rarity-label.alt-art {
    background: #f59e0b;
}

.rarity-label.showcase {
    background: #ec4899;
}

.rarity-label.signed {
    background: #ef4444;
}

footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
    color: #666;
}

.disclaimer {
    font-size: 0.75em;
    color: #999;
    margin-top: 10px;
    font-style: italic;
    line-height: 1.4;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Ad Containers - Tasteful placement */
.ad-container {
    margin: 30px auto;
    padding: 20px 0;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
    max-width: 728px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-container::before {
    content: "Advertisement";
    position: absolute;
    top: -8px;
    font-size: 0.7em;
    color: #aaa;
    background: white;
    padding: 0 5px;
}

.ad-horizontal {
    position: relative;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
}

/* Ensure ads don't overflow on mobile */
.adsbygoogle {
    max-width: 100%;
    overflow: hidden;
}

/* Toggle button for card details */
.toggle-btn {
    background: none;
    border: none;
    color: #0f3460;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 3px;
    padding: 2px 4px;
    transition: transform 0.2s;
    display: inline-block;
    vertical-align: middle;
}

.toggle-btn:hover {
    transform: scale(1.2);
}

/* Card details content that appears in the expanded row */
.details-content {
    width: 100%;
    padding: 15px;
    background: #f9f9f9;
    border-top: 2px solid #0f3460;
    border-bottom: 2px solid #0f3460;
}

.card-details-wrapper {
    width: 100%;
}

.card-details-wrapper h4 {
    margin: 0 0 15px 0;
    color: #0f3460;
    font-size: 1.1em;
}

.card-details-scroll {
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    background: white;
    border-radius: 4px;
    padding: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-list-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.9em;
}

.card-list-table thead {
    background: #16213e;
    color: white;
}

.card-list-table th {
    padding: 8px;
    text-align: left;
    font-size: 0.85em;
    user-select: none;
}

.card-list-table th:hover {
    background: #0a2342;
}

.card-list-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #ddd;
}

.card-list-table tbody tr:hover {
    background: #e0e0e0;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    header h1 {
        font-size: 1.8em;
    }

    .result-cards {
        grid-template-columns: 1fr;
    }

    .input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group input {
        width: 100%;
    }

    /* Mobile table fixes - Main value table */
    .value-table {
        width: 100%;
        overflow-x: hidden;
        margin-top: 15px;
        padding: 0 10px;
    }

    .value-table table {
        width: 100%;
        min-width: 100%;
        table-layout: auto;
    }

    table {
        width: 100%;
        font-size: 1em;
    }

    th, td {
        padding: 10px 6px;
        font-size: 0.95em;
        white-space: normal;
    }

    /* Keep all columns visible with proper spacing */
    .value-table th,
    .value-table td {
        min-width: auto;
        text-align: left;
    }

    /* Adjust column widths for mobile - make them explicit */
    .value-table th:first-child,
    .value-table td:first-child {
        width: 35%;
        padding-right: 5px;
        white-space: normal;
        font-size: 0.95em;
    }

    .value-table th:nth-child(2),
    .value-table td:nth-child(2) {
        width: 22%;
        text-align: right;
        padding-right: 5px;
        font-size: 0.9em;
    }

    .value-table th:nth-child(3),
    .value-table td:nth-child(3) {
        width: 20%;
        text-align: center;
        padding-left: 2px;
        padding-right: 2px;
        font-size: 0.9em;
    }

    .value-table th:nth-child(4),
    .value-table td:nth-child(4) {
        width: 23%;
        text-align: right;
        padding-left: 5px;
        font-size: 0.9em;
    }

    /* ROI cards responsive */
    .roi-cards {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 0;
        padding: 10px;
    }

    .roi-card {
        border-radius: 4px;
    }

    /* Card details in expanded row on mobile */
    .details-content {
        padding: 10px;
        background: #f5f5f5;
    }

    .card-details-wrapper {
        width: 100%;
    }

    .card-details-wrapper h4 {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .card-details-scroll {
        max-height: 300px;
        padding: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .card-list-table {
        min-width: 400px;
        width: 100%;
        font-size: 0.95em;
        margin: 0;
    }

    .card-list-table th,
    .card-list-table td {
        padding: 10px 8px;
        font-size: 0.95em;
        white-space: nowrap;
    }

    /* Make first column (card name) wrap on mobile */
    .card-list-table td:first-child {
        white-space: normal;
        min-width: 120px;
    }

    /* Stack the set header on mobile */
    .set-header {
        flex-direction: column;
        text-align: center;
    }

    .set-logo {
        margin: 0 auto 15px;
    }

    .set-title {
        text-align: center;
    }

    /* Make the container full width on mobile */
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
        margin: 0;
    }

    header {
        border-radius: 0;
    }

    .set-display {
        border-radius: 0;
        margin-left: 0;
        margin-right: 0;
        padding: 15px;
    }

    main {
        padding: 0;
    }

    footer {
        border-radius: 0;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    /* Make main table text readable but KEEP ALL COLUMNS VISIBLE */
    .value-table {
        font-size: 0.9em;
    }

    .value-table table {
        width: 100%;
        table-layout: auto;
    }

    .value-table th,
    .value-table td {
        padding: 8px 4px;
        font-size: 0.88em;
        white-space: normal;
    }

    /* First column with rarity names and toggle */
    .value-table td:first-child {
        white-space: normal;
        font-size: 0.9em;
        font-weight: 600;
    }

    /* Ensure Expected Count column stays visible with compact display */
    .value-table th:nth-child(3),
    .value-table td:nth-child(3) {
        font-size: 0.85em;
        padding: 8px 2px;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
    }

    /* Keep all main table columns visible - DO NOT use display:none */
    .value-table th,
    .value-table td {
        display: table-cell !important;
    }

    /* Only hide columns in expanded card details for space */
    .card-list-table th:nth-child(4),
    .card-list-table td:nth-child(4) {
        display: none;
    }

    /* Make card details more compact on small screens */
    .details-content {
        padding: 8px;
        border-left: none;
        border-right: none;
    }

    .card-details-wrapper h4 {
        font-size: 0.9em;
        margin-bottom: 8px;
    }

    .card-details-scroll {
        max-height: 250px;
        padding: 5px;
    }

    .card-list-table {
        min-width: 350px;
        font-size: 0.9em;
    }

    .card-list-table th,
    .card-list-table td {
        padding: 8px 5px;
        font-size: 0.9em;
    }

    /* Mobile ad adjustments */
    .ad-container {
        margin: 20px 0;
        border-radius: 0;
        max-width: 100%;
        width: 100%;
        padding: 15px 10px;
    }

    .ad-horizontal {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
}
