body {
    font-family: monospace;
    background: white;
    color: black;
    margin: 0;
}

header {
    width: 100%;
    background: #f8f6f2;
    border-bottom: 2px solid #333;
}

.header-content {
    height: 140px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0 20px;
}

.header-content h1 {
    margin-right: 20px;
}

.stats-group {
    display: flex;
    gap: 15px;
}

.stat-item {
    position: relative;
    padding: 0 15px;
}

.stat-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -7px;
    top: 0;
    height: 100%;
    width: 1px;
    background: #ddd;
}

.stat-label {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.1em;
}

.stat-breakdown {
    font-size: 0.9em;
    color: #666;
}

#cycleDisplay {
    font-size: 1.1em;
    padding: 5px 10px;
    background: #333;
    color: white;
    cursor: pointer;
}

main {
    padding: 20px;
}

.modules-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 300px));
    gap: 0;
}

.module {
    width: 300px;
    padding: 5px 0px;
    margin: 0;
}

.chart-container {
    width: 300px;
    height: 125px;
    margin: 5px 0;
}

.module-title {
    font-weight: bold;
    margin-bottom: 5px;
    border-bottom: 1px solid #ccc;
}

.unlock-cost {
    font-size: 0.9em;
    color: #666;
    padding-left: 6px;
}

.module-locked {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.info-panel {
    padding: 0 5px;
}

.control-group {
    display: flex;
    gap: 3px;
    margin: 3px 0;
    padding: 0 5px;
}

button {
    font-family: monospace;
    padding: 3px 6px;
    background: white;
    border: 1px solid black;
    cursor: pointer;
}

/* Thumb-sized controls. Coarse only, so a mouse keeps the original spacing.
   16px on the input is what stops iOS zooming the page when it gets focus. */
@media (pointer: coarse) {
    button {
        min-height: 36px;
        padding: 6px 10px;
        font-size: 15px;
    }

    input {
        min-height: 36px;
        font-size: 16px;
        box-sizing: border-box;
    }

    #cycleDisplay {
        padding: 10px 12px;
    }
}

button:disabled,
.upgrade-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background: #f5f5f5;
}

.unlock-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.unlock-btn {
    width: 100%;
    text-align: left;
    padding: 3px 6px;
}

.unlock-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background: #f5f5f5;
}

.disabled-btn {
    opacity: 0.5;
    background: #f5f5f5;
    cursor: not-allowed;
}

input {
    font-family: monospace;
    padding: 3px;
    width: 80px;
    border: 1px solid black;
}

.upgrade-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.5;
    background: #f5f5f5;
}

.abilities-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 5px;
}

.ability-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ability-btn {
    width: 100%;
    text-align: left;
    padding: 3px 6px;
}

.ability-cost {
    font-size: 0.9em;
    color: #666;
    padding-left: 6px;
}

.career-title {
    min-height: 2.4em;
    display: block;
    margin: 5px 0;
}

.positive { color: green; }
.negative { color: red; }

@media screen and (max-width: 600px) {
    .header-content {
        height: auto;
        padding: 10px;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stats-group {
        flex-direction: column;
        gap: 10px;
    }

    .stat-item:not(:last-child)::after {
        display: none;
    }

    main {
        padding: 10px;
    }

    .modules-container {
        grid-template-columns: 1fr;
    }

    .module {
        width: 100%;
    }

    .chart-container {
        width: 100%;
    }
}

@media screen and (min-width: 601px) and (max-width: 900px) {
    .modules-container {
        grid-template-columns: repeat(2, minmax(300px, 1fr));
    }
}

@media screen and (min-width: 901px) and (max-width: 1200px) {
    .modules-container {
        grid-template-columns: repeat(3, minmax(300px, 1fr));
    }
}
