/* --- Global Styles --- */
body {
    background-color: #f8fafc;
    margin: 0;
    padding: 30px 15px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
}

.rtg-container {
    width: 100%;
    max-width: 950px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* --- Header --- */
.rtg-header {
    background: #ffffff;
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}
.rtg-header h2 { margin: 0; color: #1e293b; font-size: 26px; font-weight: 800; }
.rtg-header p { margin: 8px 0 0; color: #64748b; font-size: 14px; }

/* --- Input Area --- */
.rtg-body { padding: 30px; }
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 10px; color: #475569; text-transform: uppercase; letter-spacing: 0.5px; }

textarea {
    width: 100%; height: 160px; padding: 12px; border: 1px solid #e2e8f0;
    border-radius: 10px; font-size: 15px; box-sizing: border-box;
    font-family: inherit; background-color: #fbfcfe; transition: 0.2s;
}
textarea:focus { outline: none; border-color: #ff0000; background-color: #fff; box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.1); }

/* --- Settings --- */
.rtg-settings { display: flex; gap: 20px; margin: 25px 0; align-items: flex-end; flex-wrap: wrap; }
.setting-item { flex: 1; min-width: 150px; }
select, input[type="number"] { width: 100%; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 15px; }

.checkbox-container { display: flex; align-items: center; cursor: pointer; font-size: 14px; font-weight: 600; color: #475569; gap: 10px; margin-bottom: 8px; }

/* --- Buttons --- */
.btn-primary {
    width: 100%; background: #ff0000; color: white; border: none; padding: 16px;
    border-radius: 10px; font-weight: 700; font-size: 16px; cursor: pointer; transition: 0.3s;
}
.btn-primary:hover { background: #732d91; transform: translateY(-1px); }

/* --- Results Cards (Grid) --- */
#results-area { padding: 30px; background: #fdfdfd; border-top: 1px solid #f1f5f9; }
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }

#results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.team-card {
    background: aliceblue; border-radius: 12px; border: 1px solid #edf2f7;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); overflow: hidden;
}

.team-card-header {
    padding: 15px 20px; border-bottom: 1px solid #f1f5f9;
    display: flex; align-items: baseline; gap: 8px;
}
.team-card-header h4 { margin: 0; color: #ff0000; font-size: 18px; font-weight: 800; }
.team-member-count { color: #94a3b8; font-size: 13px; }

.team-list { list-style: none; margin: 0; padding: 0; }
.team-member-item {
    padding: 12px 20px; font-size: 15px; color: #334155;
    border-bottom: 1px solid #f8fafc; display: flex; justify-content: space-between; align-items: center;
}
.team-member-item:last-child { border-bottom: none; }

/* Leader Badge */
.is-leader { background-color: #faf5ff; font-weight: 700; color: #0e1a35; }
.leader-badge { background: #ff0000; color: white; font-size: 10px; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; }

/* Action Buttons */
.action-buttons { display: flex; gap: 8px; }
.btn-secondary { background: #fff; border: 1px solid #e2e8f0; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-success { color: #10b981; border-color: #10b981; }

@media (max-width: 600px) { .input-grid { grid-template-columns: 1fr; } .rtg-settings { flex-direction: column; } }