* {
    box-sizing: border-box;
}

html {
    scroll-behavior: instant;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background: linear-gradient(to bottom, #160a06 0%, #351606 140px, #2d130b 140px, #101010 100%);
    color: #f6ead2;
}

.site-shell {
    width: min(1000px, 92%);
    margin: 40px auto;
    background:
        linear-gradient(rgba(18, 8, 5, 0.55), rgba(18, 8, 5, 0.55)),
        url("../images/stone-bg.jpg");
    background-size: cover;
    background-position: center;
    border: 2px solid #3a2417;
    box-shadow:
        0 0 0 2px #70492e inset,
        0 20px 50px rgba(195, 40, 40, 0.55);
}

/* Header and navigation */

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 203, 128, 0.18);
}

.logo-wrap {
    flex: 0 0 190px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-wrap img {
    width: 175px;
    max-width: 100%;
    height: auto;
    display: block;
}

.main-nav {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: stretch;
    background: linear-gradient(to bottom, rgba(16, 16, 16, 0.88), rgba(34, 20, 12, 0.88));
    border: 1px solid #4c2f1e;
    box-shadow: 0 0 0 1px #84532d inset;
}

.main-nav a {
    color: #f7edd8;
    text-decoration: none;
    text-align: center;
    padding: 16px 10px;
    font-weight: 700;
    white-space: nowrap;
    border-right: 1px solid rgba(211, 168, 107, 0.22);
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.main-nav a:last-child {
    border-right: none;
}

.main-nav a:hover {
    background: rgba(194, 114, 45, 0.12);
    color: #ffdc9b;
}

/* Main panels */

.panel {
    text-align: center;
    padding: 26px 30px 34px;
    border-top: 1px solid rgba(255, 203, 128, 0.18);
    border-bottom: 1px solid rgba(255, 203, 128, 0.18);
    background: rgba(44, 21, 10, 0.28);
}

.hero {
    padding-top: 8px;
    padding-bottom: 54px;
}

.hero h1,
.planner h2 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #fff2d8;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

.hero p,
.planner p {
    margin: 0 auto 24px;
    max-width: 780px;
    font-size: 1.2rem;
    line-height: 1.5;
    color: #f3dfba;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.cta-button {
    display: inline-block;
    text-decoration: none;
    color: #fff1d5;
    font-weight: 700;
    font-size: 1.5rem;
    padding: 14px 28px;
    background: linear-gradient(to bottom, #a32f13, #71200e);
    border: 2px solid #e18a32;
    box-shadow:
        0 0 0 2px #44140d inset,
        0 6px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.cta-button:hover {
    transform: translateY(-2px) scale(1.03);
    filter: brightness(1.08);
    box-shadow:
        0 0 0 2px #4f1208 inset,
        0 10px 20px rgba(0, 0, 0, 0.5);
}

/* Home page cards */

.card-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 34px;
    padding: 42px 34px 36px;
}

.guide-card {
    text-decoration: none;
    color: inherit;
    background: linear-gradient(to bottom, rgba(49, 26, 15, 0.92), rgba(30, 16, 10, 0.96));
    border: 2px solid #6d4a31;
    box-shadow:
        0 0 0 2px #2e1b10 inset,
        0 10px 22px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.guide-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        0 0 0 2px #2e1b10 inset,
        0 16px 28px rgba(0, 0, 0, 0.48);
    filter: brightness(1.05);
}

.card-image,
.card-images {
    background: #1c120d;
    border-bottom: 2px solid #7a5332;
    height: 230px;
    overflow: hidden;
    position: static;
}

.card-image img,
.card-images img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    display: block;
    position: static;
    object-fit: cover;
}

.card-content {
    padding: 18px 14px 22px;
}

.card-content h2 {
    margin: 0 0 12px;
    font-size: 1.9rem;
    line-height: 1.15;
    color: #fff1d6;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.card-content p {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.45;
    color: #f2dfbf;
}

/* Divider */

.divider {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 6px 0 0;
}

.divider::before,
.divider::after {
    content: "";
    height: 4px;
    background: linear-gradient(to right, #6c2f16, #c68233, #6c2f16);
    flex: 1;
}

.gem {
    width: 34px;
    height: 34px;
    margin: 0 14px;
    background: linear-gradient(135deg, #fff2a1, #f39b20, #9d310c);
    transform: rotate(45deg);
    border: 2px solid #7a3c1b;
    box-shadow: 0 0 0 2px #2b140c inset, 0 0 14px rgba(255, 177, 41, 0.4);
    flex-shrink: 0;
}

/* Planner */

.planner {
    padding-top: 28px;
    padding-bottom: 34px;
}

.planner-image-wrap {
    max-width: 760px;
    margin: 24px auto 22px;
    border: 2px solid #6d4a31;
    box-shadow: 0 0 0 2px #2e1b10 inset;
    background: rgba(24, 12, 8, 0.75);
    overflow: hidden;
}

.planner-image-wrap img {
    display: block;
    width: 100%;
    height: auto;
}

/* Footer */

.footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    padding: 26px 28px 30px;
    background: rgba(19, 9, 6, 0.7);
    border-top: 1px solid rgba(255, 198, 120, 0.18);
}

.footer p {
    margin: 0;
    max-width: 760px;
    font-size: 1rem;
    line-height: 1.6;
    color: #f0dfc2;
}

.footer-icons {
    display: flex;
    gap: 10px;
}

.footer-icons a {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    text-decoration: none;
    color: #f7e7cb;
    font-size: 1.5rem;
    background: linear-gradient(to bottom, #3f2c20, #201611);
    border: 2px solid #6d4a31;
    box-shadow: 0 0 0 2px #2d1a11 inset;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.footer-icons a:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

/* Guide pages */

.guide-page {
    padding: 42px 34px 36px;
}

.guide-text-card {
    display: block;
    margin-bottom: 28px;
}

.guide-text-card:hover {
    transform: none;
    filter: brightness(1.03);
}

.guide-text-card .card-content {
    padding: 26px 28px;
}

.guide-text-card h3 {
    margin: 22px 0 8px;
    color: #ffdc9b;
    font-size: 1.45rem;
}

.guide-text-card h4 {
    margin: 18px 0 8px;
    color: #f8d28d;
    font-size: 1.2rem;
}

.guide-text-card p + p {
    margin-top: 14px;
}

.guide-text-card ul,
.guide-text-card ol,
.toc-list {
    margin: 16px 0 0;
    padding-left: 24px;
    color: #f2dfbf;
    font-size: 1.1rem;
    line-height: 1.6;
}

.guide-text-card li {
    margin-bottom: 8px;
}

.guide-text-card a {
    color: #ffdc9b;
}

.guide-text-card a:hover {
    color: #fff1d6;
}

.toc-list {
    columns: 2;
}

.toc-list li {
    break-inside: avoid;
}

/* Highlight boxes */

.guide-warning {
    margin: 22px 0;
    padding: 18px 20px;
    background: rgba(113, 32, 14, 0.35);
    border-left: 5px solid #e18a32;
    box-shadow: 0 0 0 1px rgba(255, 220, 155, 0.18) inset;
}

.guide-warning h3 {
    margin-top: 0;
}

.build-link {
    margin: 22px 0;
    padding: 18px 20px;
    background: rgba(24, 12, 8, 0.75);
    border: 2px solid #6d4a31;
    box-shadow: 0 0 0 2px #2e1b10 inset;
}

.build-link h3 {
    margin-top: 0;
}

.build-link a {
    display: inline-block;
    margin-top: 8px;
    color: #ffdc9b;
    font-weight: 700;
}

.build-link a:hover {
    color: #fff1d6;
}

/* Code boxes and tables */

.code-box {
    margin: 16px 0;
    padding: 12px 16px;
    background: rgba(10, 6, 4, 0.8);
    border: 1px solid #6d4a31;
    color: #ffdc9b;
    font-weight: 700;
    overflow-x: auto;
}

.code-box p {
    white-space: nowrap;
}

.table-wrap {
    overflow-x: auto;
    margin: 18px 0;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    color: #f2dfbf;
    background: rgba(24, 12, 8, 0.75);
    border: 2px solid #6d4a31;
}

.table-wrap th,
.table-wrap td {
    border: 1px solid rgba(255, 220, 155, 0.25);
    padding: 10px;
    text-align: left;
}

.table-wrap th {
    color: #ffdc9b;
    background: rgba(113, 32, 14, 0.35);
}

/* Checklist page */

.checklist-group {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    margin-bottom: 24px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(24, 12, 8, 0.65);
    border: 1px solid rgba(255, 220, 155, 0.25);
    color: #f2dfbf;
    line-height: 1.45;
    cursor: pointer;
}

.checklist-item:hover {
    background: rgba(113, 32, 14, 0.28);
    border-color: rgba(255, 220, 155, 0.45);
}

.checklist-item input {
    margin-top: 4px;
    transform: scale(1.25);
    accent-color: #e18a32;
    flex-shrink: 0;
    cursor: pointer;
}

.checklist-item span {
    display: block;
}

.checklist-item strong {
    color: #ffdc9b;
}

.checklist-note {
    margin-top: 18px;
    padding: 14px 16px;
    background: rgba(113, 32, 14, 0.25);
    border-left: 4px solid #e18a32;
    box-shadow: 0 0 0 1px rgba(255, 220, 155, 0.15) inset;
}

.checklist-note p {
    margin: 0;
}

/* Master checklist items */

.achievement-master {
    background: rgba(113, 32, 14, 0.45);
    border: 2px solid #e18a32;
}

.achievement-master strong {
    color: #fff1d6;
}

/* General checklist tables */

.check-table .check-cell,
.pet-check-table .check-cell {
    width: 70px;
    text-align: center;
    vertical-align: middle;
}

.check-table input[type="checkbox"],
.pet-check-table input[type="checkbox"] {
    transform: scale(1.2);
    accent-color: #e18a32;
    cursor: pointer;
}

.check-table td,
.check-table th,
.pet-check-table td,
.pet-check-table th {
    vertical-align: middle;
}

.guide-text-card ul label {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.guide-text-card ul input[type="checkbox"] {
    margin-top: 4px;
    transform: scale(1.15);
    accent-color: #e18a32;
    cursor: pointer;
}

/* Optimizer page */

.optimizer-hero {
    padding-top: 34px;
    padding-bottom: 34px;
}

.optimizer-page {
    display: grid;
    gap: 28px;
}

.optimizer-card {
    color: inherit;
}

.optimizer-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.optimizer-form label,
.optimizer-form legend {
    color: #ffdc9b;
    font-weight: 700;
    font-size: 1.05rem;
}

.optimizer-form input[type="number"],
.optimizer-form select {
    width: 100%;
    padding: 12px 14px;
    color: #f6ead2;
    background: rgba(10, 6, 4, 0.85);
    border: 2px solid #6d4a31;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
}

.optimizer-form input[type="number"]:focus,
.optimizer-form select:focus {
    outline: none;
    border-color: #e18a32;
    box-shadow: 0 0 0 2px rgba(225, 138, 50, 0.25);
}

.optimizer-form fieldset {
    display: grid;
    gap: 10px;
    margin: 10px 0 4px;
    padding: 16px;
    border: 2px solid #6d4a31;
    background: rgba(24, 12, 8, 0.65);
}

.optimizer-check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f2dfbf;
    cursor: pointer;
}

.optimizer-check input {
    transform: scale(1.2);
    accent-color: #e18a32;
    cursor: pointer;
}

.optimizer-button {
    width: fit-content;
    margin-top: 8px;
    border-radius: 0;
    cursor: pointer;
    font-family: Georgia, "Times New Roman", serif;
}

#results h3 {
    margin: 20px 0 8px;
    color: #ffdc9b;
}

#results p {
    margin-bottom: 12px;
}

.result-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.result-box {
    padding: 16px;
    background: rgba(24, 12, 8, 0.75);
    border: 2px solid #6d4a31;
    box-shadow: 0 0 0 2px #2e1b10 inset;
}

.result-box strong {
    color: #ffdc9b;
}

/* Large desktop layout */

@media (min-width: 1200px) {
    .site-shell {
        width: min(1550px, 94%);
    }

    .topbar {
        flex-direction: row;
        align-items: center;
        gap: 28px;
        padding: 22px 28px;
    }

    .logo-wrap {
        flex: 0 0 220px;
    }

    .logo-wrap img {
        width: 190px;
    }

    .main-nav {
        grid-template-columns: repeat(6, 1fr);
    }

    .main-nav a {
        font-size: 0.95rem;
        padding: 17px 10px;
        white-space: nowrap;
    }

    .hero {
        padding: 34px 48px 60px;
    }

    .hero h1 {
        font-size: clamp(2.5rem, 3vw, 3.8rem);
    }

    .hero p {
        max-width: 950px;
        font-size: 1.25rem;
    }

    .card-section {
        grid-template-columns: repeat(3, 1fr);
        gap: 52px;
        padding: 64px 72px 58px;
    }

    .card-image,
    .card-images {
        height: 300px;
    }

    .card-content {
        padding: 24px 24px 30px;
    }

    .card-content h2 {
        font-size: 2.1rem;
    }

    .card-content p {
        font-size: 1.2rem;
    }

    .guide-page {
        padding: 60px 72px 54px;
    }

    .planner-image-wrap {
        max-width: 1200px;
    }
}

/* Medium screens: tablets, Surface Pro, small laptops */

@media (min-width: 701px) and (max-width: 1199px) {
    .site-shell {
        width: min(1050px, 88%);
        margin: 32px auto;
    }

    .topbar {
        flex-direction: column;
        align-items: center;
        gap: 18px;
        padding: 22px 24px;
    }

    .logo-wrap {
        flex: none;
    }

    .logo-wrap img {
        width: 165px;
    }

    .main-nav {
        width: 100%;
        grid-template-columns: repeat(2, 1fr);
    }

    .main-nav a {
        padding: 14px 10px;
        font-size: 0.95rem;
        white-space: normal;
        line-height: 1.25;
        border-right: 1px solid rgba(211, 168, 107, 0.22);
        border-bottom: 1px solid rgba(211, 168, 107, 0.22);
    }

    .main-nav a:nth-child(2n) {
        border-right: none;
    }

    .main-nav a:nth-last-child(-n + 2) {
        border-bottom: none;
    }

    .hero {
        padding: 26px 30px 46px;
    }

    .hero h1 {
        font-size: clamp(2rem, 4vw, 2.7rem);
    }

    .hero p {
        max-width: 720px;
        font-size: 1.1rem;
    }

    .card-section {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
        padding: 44px 38px 40px;
    }

    .card-image,
    .card-images {
        height: 210px;
    }

    .card-image img,
    .card-images img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .card-content {
        padding: 18px 16px 22px;
    }

    .card-content h2 {
        font-size: 1.55rem;
    }

    .card-content p {
        font-size: 1.05rem;
    }

    .guide-page {
        padding: 42px 38px;
    }

    .planner-image-wrap {
        max-width: 850px;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Phone layout */

@media (max-width: 700px) {
    body {
        background: linear-gradient(to bottom, #160a06 0%, #351606 100px, #101010 100%);
    }

    .site-shell {
        width: 100%;
        margin: 0;
        border-left: none;
        border-right: none;
    }

    .topbar {
        flex-direction: column;
        align-items: center;
        padding: 16px 12px 8px;
        gap: 14px;
    }

    .logo-wrap {
        flex: none;
    }

    .logo-wrap img {
        width: 190px;
    }

    .main-nav {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .main-nav a {
        width: 100%;
        padding: 13px 12px;
        border-right: none;
        border-bottom: 1px solid rgba(211, 168, 107, 0.22);
        white-space: normal;
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    .panel {
        padding: 24px 18px 30px;
    }

    .hero {
        padding-top: 16px;
        padding-bottom: 38px;
    }

    .hero h1,
    .planner h2 {
        font-size: clamp(1.8rem, 9vw, 2.4rem);
    }

    .hero p,
    .planner p {
        font-size: 1.05rem;
    }

    .cta-button {
        width: 100%;
        max-width: 340px;
        font-size: 1.15rem;
        padding: 13px 18px;
    }

    .optimizer-button {
        width: 100%;
    }

    .card-section {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 30px 18px;
    }

    .guide-card:hover {
        transform: none;
    }

    .card-image,
    .card-images {
        height: auto;
    }

    .card-image img,
    .card-images img {
        width: 100%;
        height: auto;
        max-width: 100%;
        position: static;
        display: block;
        object-fit: contain;
    }

    .card-content h2 {
        font-size: 1.55rem;
    }

    .card-content p {
        font-size: 1.05rem;
    }

    .guide-page {
        padding: 28px 16px;
    }

    .guide-text-card {
        margin-bottom: 22px;
    }

    .guide-text-card .card-content {
        padding: 22px 18px;
    }

    .guide-text-card h3 {
        font-size: 1.25rem;
    }

    .guide-text-card ul,
    .guide-text-card ol,
    .toc-list {
        font-size: 1rem;
        padding-left: 20px;
    }

    .toc-list {
        columns: 1;
    }

    .build-link,
    .guide-warning {
        padding: 16px;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px 18px;
    }

    .footer-icons {
        width: 100%;
        justify-content: center;
    }

    .footer-icons a {
        width: 48px;
        height: 48px;
    }

    .gem {
        width: 28px;
        height: 28px;
        margin: 0 10px;
    }
}

/* Very small phones */

@media (max-width: 420px) {
    .logo-wrap img {
        width: 165px;
    }

    .hero h1,
    .planner h2 {
        font-size: 1.65rem;
    }

    .guide-page {
        padding: 24px 12px;
    }

    .guide-text-card .card-content {
        padding: 18px 14px;
    }

    .card-section {
        padding: 24px 12px;
    }

    .main-nav a {
        font-size: 0.95rem;
    }
}

/* Back to top button */

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 52px;
    height: 52px;
    border: 2px solid #e18a32;
    background: linear-gradient(to bottom, #a32f13, #71200e);
    color: #fff1d5;
    font-size: 1.8rem;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    box-shadow:
        0 0 0 2px #44140d inset,
        0 6px 14px rgba(0, 0, 0, 0.45);
    transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    filter: brightness(1.1);
    transform: translateY(-3px);
}

@media (max-width: 700px) {
    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 46px;
        height: 46px;
        font-size: 1.5rem;
    }
}
/* Hero roster section */

.hero-roster-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 14px;
}

.hero-slot {
    display: grid;
    gap: 10px;
    padding: 16px;
    background: rgba(10, 6, 4, 0.55);
    border: 2px solid #6d4a31;
    box-shadow: 0 0 0 2px #2e1b10 inset;
}

.hero-slot h3 {
    margin: 0 0 6px;
    color: #fff1d6;
    font-size: 1.25rem;
}

.hero-slot label {
    margin-top: 4px;
}

.hero-slot input,
.hero-slot select {
    width: 100%;
    padding: 10px 12px;
    color: #f6ead2;
    background: rgba(10, 6, 4, 0.85);
    border: 2px solid #6d4a31;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.95rem;
}

.hero-slot input:focus,
.hero-slot select:focus {
    outline: none;
    border-color: #e18a32;
    box-shadow: 0 0 0 2px rgba(225, 138, 50, 0.25);
}

@media (max-width: 1000px) {
    .hero-roster-grid {
        grid-template-columns: 1fr;
    }
}
.hero-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.remove-hero-button {
    padding: 6px 10px;
    color: #fff1d5;
    background: linear-gradient(to bottom, #71200e, #3f1208);
    border: 1px solid #e18a32;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    cursor: pointer;
}

.remove-hero-button:hover {
    filter: brightness(1.12);
}