/* Namespace all styles */
.trg-wrap {
    font-family: 'Courier New', Courier, 'Lucida Sans Typewriter', 'Lucida Typewriter', monospace;
    background-color: #2c3e50;
    background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
    color: #ecf0f1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 15px;
    border: 4px solid #34495e;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    min-height: 400px;
    max-height: 90vh;
    overflow: hidden;
    font-weight: bold;
}

.trg-wrap * {
    box-sizing: border-box;
}

/* Loading */
.trg-loading {
    text-align: center;
    font-size: 24px;
    animation: blink 1s infinite;
}

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

/* Screens */
.trg-screen {
    text-align: center;
    width: 100%;
    animation: fadeIn 0.5s ease-out;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

.trg-results-screen {
    padding: 10px 5px;
}

.trg-screen-content {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 4px;
    border: 2px solid #555;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

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

/* Start Screen */
.trg-pixel-title {
    font-size: 2em;
    color: #d7df23;
    text-shadow: 4px 4px 0px #000;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.trg-pixel-subtitle {
    font-size: 1.2em;
    color: #f5f3ec;
    margin-bottom: 30px;
    text-shadow: 2px 2px 0px #000;
}

.trg-screen-title {
    color: #ffffff;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #000;
}

/* Buttons */
.trg-btn {
    background: #d7df23;
    border: none;
    border-bottom: 4px solid #b8c01e;
    color: #173821;
    padding: 12px 25px;
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.1s;
    display: inline-block;
    margin: 10px;
    font-weight: bold;
}

.trg-btn:hover {
    transform: translateY(2px);
    border-bottom-width: 2px;
    background: #e1e92b;
}

.trg-btn:active {
    transform: translateY(4px);
    border-bottom-width: 0px;
}

.trg-link-btn {
    background: none;
    border: none;
    color: #ccc;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    margin-top: 10px;
}

/* Forms */
.trg-form-group {
    margin-bottom: 20px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.trg-form-group label {
    display: block;
    margin-bottom: 5px;
    color: #bdc3c7;
}

.trg-wrap select, 
.trg-wrap input[type="text"],
.trg-wrap input[type="email"],
.trg-wrap input[type="tel"] {
    width: 100%;
    padding: 10px;
    background: #34495e;
    border: 2px solid #2c3e50;
    color: white;
    font-family: inherit;
    font-size: 1em;
}

/* Scenario */
.trg-scenario-screen {
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: 4px;
    overflow: visible;
    padding: 15px;
}

.trg-scenario-content {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 4px;
    border: 2px solid #555;
    width: 100%;
    max-width: 100%;
}

.trg-day-badge {
    background: #e67e22;
    color: white;
    padding: 5px 10px;
    font-size: 0.85em;
    display: inline-block;
    margin-bottom: 10px;
    border: 1px solid #f5f3ec;
}

.trg-narrative {
    font-size: 1em;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: left;
}

.trg-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trg-choice-btn {
    background: #34495e;
    border: 2px solid #7f8c8d;
    color: white;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9em;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.trg-choice-btn:hover {
    background: #2c3e50;
    border-color: #3498db;
}

.trg-choice-key {
    background: #d7df23;
    color: #173821;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 0.9em;
}

.trg-progress {
    margin-top: 15px;
    font-size: 0.85em;
    color: #95a5a6;
    text-align: center;
}

/* Results */
.trg-result-title {
    color: #2ecc71;
    font-size: 1.5em;
    text-shadow: 3px 3px 0px #000;
    margin-bottom: 10px;
    margin-top: 0;
}

.trg-result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 15px 0;
}

.trg-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border: 1px solid #7f8c8d;
    text-align: left;
}

.trg-card h3 {
    margin-top: 0;
    color: #d7df23;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.trg-big-text {
    font-size: 1em;
    color: #e74c3c;
    font-weight: bold;
    text-align: center;
    margin-top: 5px;
}

.trg-insights {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trg-insights li {
    margin-bottom: 6px;
    font-size: 0.75em;
    line-height: 1.3;
}

.trg-radar-container {
    margin: 10px auto;
    width: 100%;
    max-width: 250px;
    height: 250px;
    background: rgba(0,0,0,0.5);
    border: 2px solid #0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#trg-radar-chart {
    max-width: 100%;
    height: auto;
}

.trg-actions {
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
}

.trg-save-btn {
    font-size: 0.9em !important;
    padding: 10px 20px !important;
}

/* Modal */
.trg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 15px;
}

.trg-modal {
    background: #2c3e50;
    padding: 20px;
    border: 4px solid #d7df23;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    font-family: 'Courier New', Courier, 'Lucida Sans Typewriter', 'Lucida Typewriter', monospace;
    color: #ecf0f1;
    font-weight: 300;
}

.trg-modal form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trg-modal input[type="text"],
.trg-modal input[type="email"],
.trg-modal input[type="tel"],
.trg-modal input[type="number"] {
    width: 100%;
    padding: 10px;
    background: #34495e;
    border: 2px solid #7f8c8d;
    color: white;
    font-family: inherit;
    font-size: 1em;
    border-radius: 4px;
    box-sizing: border-box;
}

.trg-modal input::placeholder {
    color: #95a5a6;
}

.trg-modal input:focus {
    outline: none;
    border-color: #d7df23;
}

.trg-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    text-align: left;
    margin-top: 10px;
}

.trg-checkbox input {
    width: auto;
}

/* Tablet adjustments */
@media (min-width: 600px) {
    .trg-wrap {
        padding: 20px;
        max-height: 85vh;
    }

    .trg-pixel-title {
        font-size: 2.5em;
    }

    .trg-pixel-subtitle {
        font-size: 1.4em;
        margin-bottom: 40px;
    }

    .trg-result-title {
        font-size: 2em;
        margin-bottom: 15px;
    }

    .trg-result-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin: 20px 0;
    }
    
    .trg-risk-card {
        grid-column: 1 / -1;
    }

    .trg-card {
        padding: 12px;
    }

    .trg-card h3 {
        font-size: 1em;
    }

    .trg-insights li {
        font-size: 0.85em;
    }

    .trg-big-text {
        font-size: 1.2em;
    }

    .trg-radar-container {
        max-width: 280px;
        height: 280px;
        margin: 15px auto;
    }

    .trg-narrative {
        font-size: 1.1em;
    }

    .trg-choice-btn {
        padding: 15px;
        font-size: 1em;
    }

    .trg-choice-key {
        width: 30px;
        height: 30px;
        margin-right: 15px;
    }

    .trg-modal {
        padding: 30px;
    }

    .trg-modal form {
        gap: 12px;
    }

    .trg-save-btn {
        font-size: 1em !important;
        padding: 12px 25px !important;
    }
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .trg-wrap {
        aspect-ratio: auto;
        justify-content: flex-start;
        max-height: 80vh;
    }

    .trg-pixel-title {
        font-size: 3em;
    }

    .trg-pixel-subtitle {
        font-size: 1.5em;
    }

    .trg-screen-content {
        padding: 30px;
    }

    .trg-scenario-content {
        padding: 20px;
    }

    .trg-narrative {
        font-size: 1.2em;
        margin-bottom: 30px;
    }

    .trg-result-title {
        font-size: 2.5em;
    }

    .trg-card {
        padding: 15px;
    }

    .trg-card h3 {
        font-size: 1.2em;
    }

    .trg-insights li {
        font-size: 0.9em;
    }

    .trg-big-text {
        font-size: 1.5em;
    }

    .trg-radar-container {
        max-width: 300px;
        height: 300px;
    }

    .trg-btn {
        padding: 15px 30px;
        font-size: 1.2em;
    }

    .trg-save-btn {
        font-size: 1.2em !important;
        padding: 15px 30px !important;
    }
}