:root {
    --retro-teal: #7dd3d3;
    --retro-teal-dark: #5ab5b5;
    --retro-orange: #ff8844;
    --retro-orange-dark: #e67034;
    --retro-cream: #f5e6c8;
    --retro-brown: #3d2b1f;
    --background-dark: #0f1612;
    --terminal-bg: #1a211c;
    --text-color: var(--retro-teal);
    --border-color: var(--retro-teal-dark);
    --highlight-color: var(--retro-orange);
}

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

body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: var(--background-dark);
    color: var(--text-color);
    line-height: 1.5;
    padding: 15px;
    font-size: 14px;
    background-image:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px);
}

#terminal {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--terminal-bg);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(109, 181, 181, 0.3);
    position: relative;
}

#terminal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 2px,
        transparent 2px,
        transparent 4px
    );
    pointer-events: none;
    border-radius: 5px;
}

.banner-logo {
    display: block;
    max-width: 700px;
    height: auto;
    margin: 0 auto 20px auto;
    filter: drop-shadow(0 0 5px var(--retro-teal));
}

header h1 {
    font-size: 3em;
    text-align: center;
    color: var(--highlight-color);
    text-shadow: 0 0 10px var(--highlight-color), 0 0 20px var(--highlight-color);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

header p {
    text-align: center;
    color: var(--text-color);
    font-size: 0.95em;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.controls {
    margin-bottom: 20px;
}

.control-group {
    margin-bottom: 15px;
}

.wizard-container {
    position: relative;
    margin-bottom: 15px;
    min-height: 120px;
}

.wizard-step {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.wizard-step.active {
    display: block;
}

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

.wizard-nav {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.wizard-prev,
.wizard-next {
    padding: 16px 20px;
    font-size: 1em;
    width: auto;
    font-weight: bold;
}

.wizard-prev {
    background: #8b0000;
    border-color: #a52a2a;
    flex: 0 0 30%;
    font-size: 0.9em;
}

.wizard-prev:hover:not(:disabled) {
    background: #a52a2a;
    border-color: #cd5c5c;
    box-shadow: 0 0 20px rgba(165, 42, 42, 0.6);
}

.wizard-next {
    flex: 1;
}

.control-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--highlight-color);
    font-size: 0.85em;
    font-weight: bold;
}

.control-group select,
.control-group input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    background: var(--background-dark);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group input[type="number"] {
    cursor: text;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--background-dark);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: move;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.checkbox-label.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.drag-handle {
    color: var(--border-color);
    font-size: 0.9em;
    cursor: grab;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.checkbox-label:hover {
    border-color: var(--highlight-color);
    box-shadow: 0 0 10px rgba(255, 177, 61, 0.3);
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--highlight-color);
}

.checkbox-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.checkbox-label:has(input[type="checkbox"]:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-label span {
    color: var(--text-color);
    font-size: 0.85em;
}

.control-group select:hover:not(:disabled) {
    border-color: var(--highlight-color);
    box-shadow: 0 0 10px rgba(255, 177, 61, 0.3);
}

.control-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-group select:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 15px rgba(255, 177, 61, 0.5);
}

button {
    width: 100%;
    padding: 10px;
    background: var(--retro-teal-dark);
    color: var(--retro-cream);
    border: 2px solid var(--retro-teal);
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

button:hover:not(:disabled) {
    background: var(--highlight-color);
    border-color: var(--highlight-color);
    box-shadow: 0 0 20px rgba(255, 177, 61, 0.6);
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

button:active:not(:disabled) {
    transform: translateY(0);
}

#build-output {
    min-height: 200px;
    padding: 20px;
    background: var(--background-dark);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-top: 20px;
}

#build-output p {
    margin: 10px 0;
    animation: blink 1.5s ease-in-out infinite;
}

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

.error {
    color: #ff4444 !important;
    font-weight: bold;
}

/* Build Output Styles */
.build-output-container {
    color: var(--text-color);
}

.top-sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .top-sections-grid {
        grid-template-columns: 1fr;
    }
}

.build-title {
    font-size: 2.5em;
    color: var(--highlight-color);
    text-shadow: 0 0 10px var(--highlight-color);
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.build-subtitle {
    text-align: center;
    color: var(--pip-boy-amber);
    font-size: 1.2em;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.build-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(17, 26, 17, 0.6);
    border: 2px solid var(--border-color);
    border-radius: 6px;
}

.build-section h3 {
    color: var(--highlight-color);
    font-size: 1.8em;
    margin-bottom: 15px;
    text-shadow: 0 0 5px var(--highlight-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.special-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.special-stat {
    padding: 15px 10px;
    background: var(--background-dark);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 1.2em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.special-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 5px var(--retro-teal));
}

.special-stat strong {
    color: var(--highlight-color);
    font-size: 1.5em;
    font-weight: bold;
}

.special-stat .points {
    color: var(--text-color);
    font-size: 1.3em;
    font-weight: bold;
}

.special-total {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 177, 61, 0.1);
    border: 2px solid var(--highlight-color);
    border-radius: 4px;
    text-align: center;
    font-size: 1.1em;
    color: var(--pip-boy-amber);
}

.perk-category {
    margin: 15px 0;
}

.perk-category h4 {
    color: var(--pip-boy-amber);
    font-size: 1.4em;
    margin-bottom: 10px;
}

.perk-category ul {
    list-style: none;
    padding-left: 20px;
}

.perk-category li {
    margin: 8px 0;
    padding: 10px;
    background: var(--background-dark);
    border-left: 4px solid var(--border-color);
    transition: all 0.2s ease;
}

.perk-category li:hover {
    border-left-color: var(--highlight-color);
    background: rgba(109, 181, 181, 0.05);
    transform: translateX(5px);
}

.perk-category li.ghoul-perk {
    border-left-color: var(--highlight-color);
    background: rgba(255, 177, 61, 0.1);
}

.perk-category li strong {
    color: var(--highlight-color);
}

.weapon-details p {
    margin: 10px 0;
    padding-left: 10px;
}

.weapon-details strong {
    color: var(--pip-boy-amber);
    display: inline-block;
    min-width: 120px;
}

.build-section ul, .build-section ol {
    padding-left: 30px;
    margin-top: 10px;
}

.build-section li {
    margin: 8px 0;
    padding: 5px 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--highlight-color);
}

/* Perk Card Styling - Column Layout */
.perks-columns-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
    margin-top: 20px;
    overflow: visible;
}

.perk-special-column {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: visible;
    background: rgba(17, 26, 17, 0.3);
    transition: all 0.3s ease;
}

/* Expanded SPECIAL column - full overlay */
.perk-special-column.column-expanded {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw !important;
    max-width: 800px !important;
    max-height: 85vh !important;
    z-index: 10000 !important;
    border-color: var(--highlight-color);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 100px var(--highlight-color);
    overflow-y: auto;
    background: var(--terminal-bg);
}

.perk-special-column.column-expanded .perk-column-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--background-dark);
    border-bottom-color: var(--highlight-color);
    cursor: pointer;
}

.perk-special-column.column-expanded .perk-cards-column {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 20px;
}

.perk-column-header {
    background: var(--background-dark);
    padding: 15px 10px;
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.perk-column-header:hover {
    background: rgba(255, 177, 61, 0.1);
    border-bottom-color: var(--highlight-color);
    box-shadow: 0 0 15px rgba(255, 177, 61, 0.3);
}

.special-header-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 5px var(--retro-teal));
}

.perk-column-header h4 {
    color: var(--highlight-color);
    font-size: 2em;
    margin: 0;
    font-weight: bold;
}

.card-count {
    color: var(--text-color);
    font-size: 0.9em;
}

.perk-cards-column {
    padding: 10px;
    flex-grow: 1;
    display: none;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
}

.perk-special-column.column-expanded .perk-cards-column {
    display: grid !important;
}

.no-perks {
    text-align: center;
    color: var(--border-color);
    padding: 20px;
    font-style: italic;
}

.perk-card {
    background: var(--terminal-bg);
    border: 3px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 0 10px rgba(109, 181, 181, 0.2);
    cursor: pointer;
    width: 100%;
    overflow: visible;
    min-height: 50px;
}

.perk-card-header {
    padding: 8px 12px;
    background: var(--background-dark);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 5px 5px 0 0;
}

.perk-card-title {
    font-weight: bold;
    color: var(--highlight-color);
    font-size: 0.9em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
}

.perk-card-cost {
    font-size: 0.85em;
    color: var(--text-color);
    white-space: nowrap;
    flex-shrink: 0;
}

.perk-card-body {
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 10px;
}

/* Hover effect - "pick me" glow */
.perk-card:hover:not(.expanded) {
    border-color: var(--highlight-color);
    box-shadow: 0 0 20px rgba(255, 177, 61, 0.5);
    transform: translateY(-2px);
}

/* Expanded state - modal-like full card */
.perk-card.expanded {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw !important;
    max-width: 500px !important;
    height: auto !important;
    max-height: 85vh !important;
    z-index: 10001 !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 100px var(--highlight-color);
    border-color: var(--highlight-color);
    background: var(--terminal-bg);
    overflow-y: auto;
}

.perk-card.expanded .perk-card-body {
    display: flex !important;
}

.perk-card.expanded .perk-card-header {
    background: var(--background-dark);
    border-bottom-color: var(--highlight-color);
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Backdrop overlay for expanded cards */
.card-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.card-backdrop.active {
    display: block;
}

.perk-card.ghoul-perk-card {
    border-color: var(--highlight-color);
    border-width: 4px;
    background: rgba(255, 136, 68, 0.15);
    box-shadow: 0 0 20px rgba(144, 238, 144, 0.8), 0 0 30px rgba(144, 238, 144, 0.6), inset 0 0 30px rgba(144, 238, 144, 0.2);
    position: relative;
}

.perk-card.ghoul-perk-card::before {
    content: "☢ GHOUL";
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--highlight-color);
    color: var(--background-dark);
    padding: 3px 8px;
    font-size: 0.7em;
    font-weight: bold;
    border-radius: 0 5px 0 8px;
    z-index: 10;
    box-shadow: 0 0 10px var(--highlight-color);
    letter-spacing: 1px;
}

.perk-card.ghoul-perk-card::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 8px;
    padding: 4px;
    background: linear-gradient(135deg, var(--highlight-color), var(--retro-orange-dark), #00ff00);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
}

.perk-card.ghoul-perk-card:hover {
    box-shadow: 0 0 30px rgba(144, 238, 144, 0.9), 0 0 40px rgba(144, 238, 144, 0.7), inset 0 0 40px rgba(144, 238, 144, 0.25);
}

.perk-card.ghoul-perk-card .perk-card-title {
    color: var(--highlight-color);
    text-shadow: 0 0 8px var(--highlight-color);
}

.perk-card.ghoul-perk-card .perk-name {
    color: var(--highlight-color);
    text-shadow: 0 0 8px var(--highlight-color);
}

.perk-card.legendary-perk-card {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.08);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    position: relative;
    width: 100%;
    min-height: 80px;
    height: auto;
}

.perk-card.legendary-perk-card:hover:not(.expanded) {
    border-color: #ffd700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    transform: translateY(-2px);
}

.perk-card.legendary-perk-card.expanded {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw !important;
    max-width: 500px !important;
    z-index: 10001 !important;
    border-color: #ffd700;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 100px rgba(255, 215, 0, 0.8);
}

.perk-card.legendary-perk-card .perk-card-title {
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
}

.perk-card.legendary-perk-card .perk-name {
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
}

.perk-card.legendary-perk-card .perk-icon {
    filter: drop-shadow(0 0 8px #ffd700);
}

.legendary-perks-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

@media (max-width: 1024px) {
    .legendary-perks-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .legendary-perks-container {
        grid-template-columns: 1fr;
    }
}

.legendary-slot {
    width: 100%;
    height: fit-content;
}

.locked-card {
    opacity: 0.5;
    filter: grayscale(0.7);
    background: var(--background-dark);
    border: 3px dashed var(--border-color);
    border-radius: 8px;
    min-height: 80px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.lock-icon {
    font-size: 1.5em;
    opacity: 0.5;
}

.perk-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 5px var(--retro-teal));
    align-self: center;
}

.perk-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perk-name {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--highlight-color);
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.perk-description {
    font-size: 0.85em;
    color: var(--text-color);
    text-align: center;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.perk-rank-stars {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.perk-star {
    font-size: 1.4em;
    transition: all 0.2s ease;
}

.perk-star.filled {
    color: var(--highlight-color);
    text-shadow: 0 0 5px var(--highlight-color);
}

.perk-star.empty {
    color: var(--border-color);
    opacity: 0.5;
}

.perk-rank-text {
    font-size: 0.95em;
    color: var(--pip-boy-amber);
    font-weight: bold;
    white-space: nowrap;
    text-align: center;
    flex-shrink: 0;
}

/* Progression Section */
.progression-section {
    background: rgba(255, 177, 61, 0.08);
    border: 3px solid var(--highlight-color);
}

.progression-list {
    list-style: none;
    padding-left: 0;
}

.progression-list li {
    padding: 10px;
    margin: 8px 0;
    background: var(--background-dark);
    border-left: 4px solid var(--highlight-color);
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 18px;
        padding: 12px;
        line-height: 1.6;
    }

    .banner-logo {
        max-width: 95%;
        margin-bottom: 25px;
    }

    header h1 {
        font-size: 2.5em;
        letter-spacing: 2px;
        margin-bottom: 15px;
    }

    header p {
        font-size: 1.3em;
        margin-bottom: 30px;
        line-height: 1.5;
    }

    /* Make wizard controls MUCH bigger */
    .control-group {
        margin-bottom: 20px;
    }

    .control-group label {
        font-size: 1.2em;
        margin-bottom: 12px;
        font-weight: bold;
    }

    .control-group select,
    .control-group input[type="number"] {
        padding: 18px 16px;
        font-size: 1.3em;
        border-width: 3px;
        min-height: 56px;
    }

    .wizard-prev,
    .wizard-next {
        padding: 22px 24px;
        font-size: 1.3em;
        min-height: 64px;
    }

    button {
        padding: 20px;
        font-size: 1.3em;
        min-height: 64px;
    }

    .checkbox-label {
        padding: 14px 18px;
        font-size: 1.15em;
        border-width: 3px;
        min-height: 52px;
    }

    .checkbox-label input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    .checkbox-label span {
        font-size: 1.15em;
    }

    /* Build output */
    .build-title {
        font-size: 2.2em;
        letter-spacing: 1px;
        margin-bottom: 20px;
        line-height: 1.3;
    }

    .build-subtitle {
        font-size: 1.4em;
        margin-bottom: 30px;
        line-height: 1.4;
    }

    .special-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 12px;
    }

    .special-icon {
        width: 48px;
        height: 48px;
    }

    .special-stat {
        padding: 16px 10px;
        font-size: 1.25em;
        border-width: 3px;
    }

    .special-stat strong {
        font-size: 1.6em;
    }

    .special-stat .points {
        font-size: 1.5em;
        font-weight: bold;
    }

    .special-total {
        font-size: 1.25em;
        padding: 20px;
        margin-top: 20px;
        line-height: 1.5;
    }

    /* Make perk columns stack on mobile */
    .perks-columns-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .perk-column-header {
        padding: 20px 16px;
    }

    .perk-column-header h4 {
        font-size: 2.5em;
    }

    .special-header-icon {
        width: 56px;
        height: 56px;
    }

    .card-count {
        font-size: 1.3em;
    }

    .perk-card {
        min-height: 60px;
    }

    .perk-card-header {
        padding: 16px 18px;
        min-height: 60px;
    }

    .perk-card-title {
        font-size: 1.2em;
        line-height: 1.3;
    }

    .perk-card-cost {
        font-size: 1.15em;
    }

    /* Mobile expanded cards take full width */
    .perk-card.expanded {
        width: 95vw !important;
        max-width: none !important;
        max-height: 90vh !important;
    }

    .perk-card.expanded .perk-icon {
        width: 64px;
        height: 64px;
    }

    .perk-card.expanded .perk-name {
        font-size: 1.5em;
        margin-bottom: 12px;
    }

    .perk-card.expanded .perk-description {
        font-size: 1.15em;
        line-height: 1.6;
    }

    .perk-rank-stars {
        gap: 6px;
    }

    .perk-star {
        font-size: 1.8em;
    }

    .perk-rank-text {
        font-size: 1.25em;
    }

    #terminal {
        padding: 12px;
    }

    .build-section {
        padding: 22px;
        margin: 30px 0;
        border-width: 3px;
    }

    .build-section h3 {
        font-size: 1.9em;
        margin-bottom: 20px;
        line-height: 1.3;
    }

    .build-section p,
    .build-section li {
        font-size: 1.2em;
        line-height: 1.7;
        margin: 10px 0;
    }

    .build-section ul,
    .build-section ol {
        padding-left: 30px;
    }

    .weapon-details p {
        margin: 14px 0;
        font-size: 1.2em;
    }

    .weapon-details strong {
        font-size: 1.2em;
    }

    /* Legendary cards on mobile */
    .legendary-perks-container {
        gap: 20px;
    }

    .legendary-slot {
        min-height: 100px;
    }

    .perk-card.legendary-perk-card,
    .locked-card {
        min-height: 100px;
        padding: 20px;
    }

    .perk-card.legendary-perk-card .perk-card-title {
        font-size: 1.25em;
    }

    .locked-card .perk-name {
        font-size: 1.2em;
    }

    .locked-card .perk-description {
        font-size: 1.1em;
    }

    .lock-icon {
        font-size: 2.5em;
    }

    /* Top sections grid on mobile */
    .top-sections-grid {
        gap: 25px;
    }
}
