:root { 
    --c-prim: #0078d4; 
    --c-sec: #005a9e;
    --c-bg: #f0f2f5; 
    --c-card: #ffffff;
    --c-text: #323130;
    --c-success: #107c10;
    --c-error: #a4262c;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --radius: 12px;
}

body { 
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
    background: var(--c-bg); 
    margin: 0; 
    padding: 15px; 
    color: var(--c-text);
    min-height: 100vh;
    display: block; 
    box-sizing: border-box;
}


.main-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    max-width: 1600px;
    margin: 20px auto;
}

.ad-zone {
    display: flex;
    justify-content: center;
    align-items: center;
}


.side-ad {
    width: 160px;
    height: 600px; 
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.side-ad .ad-placeholder {
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 5px;
}

.ad-placeholder {
    background-color: #e1e1e1;
    border: 2px dashed #bbb;
    color: #888;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    font-weight: bold;
    border-radius: 8px;
    text-align: center;
    box-sizing: border-box;
    font-size: 0.9rem;
}
.bottom-ad {
    width: 100%;
    max-width: 970px;
    height: 90px; 
    margin-top: 20px;
    flex-basis: 100%;
}



.app-container { 
    flex: 1;                  /* Toma el espacio del centro de forma inteligente */
    min-width: 320px;         /* Evita que se aplaste demasiado en pantallas chicas */
    max-width: 1000px; 
    background: var(--c-card); 
    padding: 25px; 
    border-radius: var(--radius); 
    box-shadow: var(--shadow); 
    box-sizing: border-box;
    /* Eliminamos width: 100% y flex-shrink: 0 */
}


.menu-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.app-logo {
    max-height: 80px;
    width: auto;
}

.menu-header h1 {
    color: var(--c-prim);
    margin: 0;
    text-align: center;
    font-size: 1.8rem;
    line-height: 1.2;
}

.welcome-text {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #605e5c;
    text-align: center;
}

.menu-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 15px; 
    margin-top: 20px; 
    align-items: stretch; 
}


.mode-btn { 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px 20px; 
    font-size: 1.2rem; 
    line-height: 1.2; 
    border-radius: var(--radius);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    
 
    transition: all 0.3s ease; 
    
    min-height: 100px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    

    background-color: var(--c-prim);
    color: white;
    border: none;
}

.mode-btn:active { 
    transform: scale(0.95); 
}

.mode-btn:not(.btn-outline):not(.btn-download):not(.btn-history):hover {
    background-color: var(--c-sec) !important;
    transform: translateY(-3px); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.mode-btn small { 
    display: block;
    margin-top: 5px;
    font-size: 0.85rem; 
    font-weight: normal; 
    opacity: 0.9;
}

.btn-outline { 
    background: white !important; 
    color: var(--c-prim) !important; 
    border: 2px solid var(--c-prim) !important; 
}

.btn-outline:hover { 
    background-color: var(--c-prim) !important; 
    color: white !important; 
}

.btn-download { background-color: #107c10 !important; color: white !important; }
.btn-download:hover { 
    background-color: #0d620d !important; 
    transform: translateY(-3px);
}
.btn-history { 
    background-color: #ffb900 !important; 
    color: #323130 !important; 
    transition: all 0.3s ease !important;
}

.btn-history:hover { 
    background-color: #e6a700 !important; 
    color: #000000 !important; 
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}


.header-quiz { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f2f1;
}

#info-bar { font-weight: 700; color: var(--c-prim); font-size: 1.1rem;}
#timer-display { font-size: 1.3rem; font-weight: 700; color: var(--c-text); font-variant-numeric: tabular-nums;}

.img-box { 
    width: 100%; 
    text-align: center; 
    margin-bottom: 25px; 
    display: none; 
    background: #faf9f8;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #edebe9;
}
.img-box img { 
    max-width: 100%; 
    max-height: 300px; 
    border-radius: 4px;
}

.q-text { font-size: 1.3rem; font-weight: 600; margin-bottom: 30px; line-height: 1.5; }
.opt-list { list-style: none; padding: 0; }
.opt-item { 
    padding: 18px 20px; 
    border: 2px solid #e1dfdd; 
    margin-bottom: 15px; 
    cursor: pointer; 
    border-radius: 8px; 
    transition: all 0.2s; 
    background: #fff;
    font-size: 1.1rem;
}
.opt-item:hover { background: #f8f9fa; border-color: var(--c-prim); }
.correct { background: #dff6dd !important; border-color: var(--c-success) !important; color: var(--c-success); font-weight: bold; }
.wrong { background: #fde7e9 !important; border-color: var(--c-error) !important; color: var(--c-error); font-weight: bold; }

.footer { 
    margin-top: 30px; 
    padding-top: 20px; 
    border-top: 1px solid #edebe9; 
    display: flex; 
    justify-content: space-around; 
    font-size: 1.1rem;
}
.score-item { font-weight: 700; }
.score-item.hit { color: var(--c-success); }
.score-item.miss { color: var(--c-error); }


.history-container {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
    border: 1px solid #e1dfdd;
    border-radius: 8px;
    background: #faf9f8;
}

.history-item {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    padding: 12px;
    border-bottom: 1px solid #edebe9;
    font-size: 0.9rem;
    text-align: left;
}

.history-header { background: #f3f2f1; font-weight: bold; position: sticky; top: 0; }

.status-approved { color: var(--c-success); font-weight: bold; }
.status-failed { color: var(--c-error); font-weight: bold; }

.res-box { text-align: center; padding: 20px 0; }
.big-score { font-size: 5rem; font-weight: 800; color: var(--c-prim); margin: 10px 0; }
.feedback-text { font-size: 1.6rem; font-weight: 700; margin: 15px 0; }


.btn { 
    padding: 12px 25px; 
    background: var(--c-prim); 
    color: white; 
    border: none; 
    cursor: pointer; 
    font-size: 1rem; 
    border-radius: var(--radius); 
    font-weight: 600;
}
.btn-secondary { background: #605e5c; }
.result-actions { display: flex; flex-direction: column; gap: 10px; justify-content: center; }


.main-footer {
    flex-basis: 100%;
    background-color: #f8f9fa; 
    padding: 10px 0; 
    margin-top: 25px; 
    border-top: 1px solid #e1dfdd;
    text-align: center;
    color: #605e5c;
}

.footer-content p {
    font-size: 0.75rem; 
    margin: 2px 0; 
    line-height: 1.2;
}

.disclaimer {
    font-size: 0.65rem !important; 
    opacity: 0.6;
}


@media (min-width: 768px) {
    body { padding: 30px; }
    .menu-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
    .result-actions { flex-direction: row; }
    .menu-header { flex-direction: row; justify-content: center; gap: 20px; }
}

@media (max-width: 1024px) {
    .side-ad { display: none; }
}

@media (max-width: 600px) {
    .history-item { font-size: 0.75rem; grid-template-columns: 1.2fr 0.8fr 0.8fr; }
    .history-item span:last-child { display: none; }
}

.hidden { display: none !important; }


@media screen and (max-width: 768px) {
    input, select, textarea { font-size: 16px !important; }
}

