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

body {
    font-family: 'Courier New', monospace;
    background: #1a1a1a;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    color: #e0e0e0;
}

/* Mechanical background pattern */
.mechanical-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px
        );
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #2a2a2a;
    border-radius: 0;
    box-shadow:
        0 0 0 3px #444,
        0 0 0 6px #333,
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
    z-index: 1;
    border: 2px solid #555;
}

/* Header with industrial look */
header {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    color: #f5f5f5;
    padding: 40px 30px;
    text-align: center;
    border-bottom: 4px solid #ff9800;
    position: relative;
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.3);
}

.header-bolts {
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 0 50px;
}

.bolt {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #666 0%, #444 50%, #222 100%);
    border-radius: 50%;
    border: 2px solid #333;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
}

.bolt::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 2px;
    background: #222;
}

.bolt::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    width: 10px;
    height: 2px;
    background: #222;
}

header h1 {
    font-size: 3em;
    margin-bottom: 5px;
    letter-spacing: 8px;
    text-shadow:
        2px 2px 0 #000,
        0 0 10px rgba(255, 152, 0, 0.5);
    font-weight: 900;
    color: #ff9800;
}

.subtitle {
    font-size: 0.9em;
    letter-spacing: 4px;
    color: #bbb;
    margin-bottom: 10px;
    font-weight: bold;
}

header p {
    font-size: 1em;
    opacity: 0.8;
    letter-spacing: 1px;
}

/* Industrial tabs */
.tabs {
    display: flex;
    background: #1a1a1a;
    border-bottom: 3px solid #444;
}

.tab-btn {
    flex: 1;
    padding: 18px;
    border: none;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 700;
    color: #999;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    border-right: 2px solid #333;
    position: relative;
    text-transform: uppercase;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-icon {
    font-size: 1.2em;
    margin-right: 8px;
}

.tab-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #ff9800;
    transform: scaleX(0);
    transition: transform 0.3s;
}

.tab-btn:hover {
    background: linear-gradient(180deg, #333 0%, #222 100%);
    color: #ff9800;
}

.tab-btn.active {
    background: #2a2a2a;
    color: #ff9800;
    border-bottom: 3px solid #ff9800;
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.3);
}

.tab-btn.active::before {
    transform: scaleX(1);
}

.section {
    display: none;
    padding: 30px;
    background: #2a2a2a;
}

.section.active {
    display: block;
}

/* Engine grid */
.engine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

/* Engine cards with metal plate look */
.engine-card {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border: 3px solid #555;
    padding: 0;
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.engine-card::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #666 0%, #444 50%, #222 100%);
    border-radius: 50%;
    border: 1px solid #333;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.engine-card::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #666 0%, #444 50%, #222 100%);
    border-radius: 50%;
    border: 1px solid #333;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.engine-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(255, 152, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    border-color: #ff9800;
}

.card-header {
    background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: 20px 25px;
    border-bottom: 2px solid #ff9800;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    color: #ff9800;
    font-size: 1.2em;
    text-align: left;
    letter-spacing: 2px;
    font-weight: 900;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.expand-icon {
    color: #ff9800;
    font-size: 1.2em;
    transition: transform 0.3s;
}

.engine-card.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Visual container */
.visual {
    background: #1a1a1a;
    padding: 25px;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    border-bottom: 2px solid #333;
}

.engine-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Basic info section */
.basic-info {
    padding: 20px 25px;
    background: #2a2a2a;
    border-bottom: 1px solid #444;
}

.basic-info p {
    margin-bottom: 12px;
    line-height: 1.7;
    color: #ccc;
    font-size: 0.95em;
}

.basic-info strong {
    color: #ff9800;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Details section (expandable) */
.details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    background: #222;
}

.engine-card.expanded .details {
    max-height: 3000px;
    transition: max-height 0.7s ease-in;
}

.detail-section {
    padding: 20px 25px;
    border-bottom: 1px solid #333;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    color: #ff9800;
    margin-bottom: 15px;
    font-size: 1.1em;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-left: 4px solid #ff9800;
    padding-left: 12px;
}

.detail-section ul {
    list-style: none;
    padding-left: 0;
}

.detail-section li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
    color: #bbb;
}

.detail-section li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #ff9800;
    font-weight: bold;
}

.detail-section li strong {
    color: #fff;
    font-weight: bold;
}

.detail-section ol {
    padding-left: 20px;
    counter-reset: item;
    list-style: none;
}

.detail-section ol li {
    counter-increment: item;
    margin-bottom: 12px;
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
    color: #bbb;
}

.detail-section ol li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    background: #ff9800;
    color: #000;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85em;
}

.detail-section p {
    line-height: 1.7;
    color: #bbb;
    margin-top: 10px;
}

/* Subtypes */
.subtype {
    background: #1a1a1a;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 3px solid #666;
    transition: all 0.3s;
}

.subtype:hover {
    border-left-color: #ff9800;
    background: #252525;
}

.subtype h4 {
    color: #ff9800;
    margin-bottom: 8px;
    font-size: 1em;
    font-weight: bold;
}

.subtype p {
    color: #aaa;
    font-size: 0.9em;
    line-height: 1.6;
    margin: 0;
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    background: #1a1a1a;
    padding: 30px;
    border: 3px solid #555;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.quiz-progress {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: #333;
    border: 2px solid #555;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9800 0%, #ff6b00 100%);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

#question-counter {
    color: #ff9800;
    font-weight: bold;
    font-size: 1em;
    min-width: 80px;
    text-align: right;
}

#question-container {
    text-align: center;
}

#question-text {
    font-size: 1.4em;
    color: #fff;
    margin-bottom: 30px;
    line-height: 1.5;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.option-btn {
    padding: 18px 25px;
    font-size: 1.05em;
    border: 3px solid #555;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #ff9800;
    transform: scaleY(0);
    transition: transform 0.3s;
}

.option-btn:hover {
    background: linear-gradient(135deg, #333 0%, #222 100%);
    border-color: #ff9800;
    transform: translateX(8px);
    box-shadow: -4px 0 0 #ff9800;
}

.option-btn:hover::before {
    transform: scaleY(1);
}

.option-btn.correct {
    background: linear-gradient(135deg, #2d5016 0%, #1a3009 100%);
    border-color: #4caf50;
    color: #a5d6a7;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

.option-btn.incorrect {
    background: linear-gradient(135deg, #5c1a1a 0%, #3a0a0a 100%);
    border-color: #e74c3c;
    color: #ffcdd2;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* Results */
#result-container {
    text-align: center;
    padding: 40px;
}

.result-badge {
    margin-bottom: 30px;
}

.badge-icon {
    font-size: 5em;
    margin-bottom: 15px;
}

#result-title {
    color: #ff9800;
    font-size: 2.2em;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#score-text {
    font-size: 1.6em;
    margin-bottom: 25px;
    color: #fff;
    line-height: 1.6;
}

.result-details {
    background: #222;
    padding: 20px;
    border: 2px solid #444;
    margin-bottom: 30px;
    text-align: left;
    color: #bbb;
}

.restart-btn {
    padding: 18px 50px;
    font-size: 1.2em;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #000;
    border: 3px solid #ff9800;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 900;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(255, 152, 0, 0.3);
}

.restart-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(255, 152, 0, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
        letter-spacing: 4px;
    }

    .subtitle {
        font-size: 0.7em;
        letter-spacing: 2px;
    }

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

    .section {
        padding: 15px;
    }

    .quiz-container {
        padding: 20px;
    }

    #question-text {
        font-size: 1.2em;
    }

    .tab-btn {
        font-size: 0.9em;
        padding: 15px 10px;
    }

    .tab-icon {
        font-size: 1em;
    }
}

@media (max-width: 500px) {
    .engine-grid {
        grid-template-columns: 1fr;
    }

    .card-header h2 {
        font-size: 1em;
    }
}
