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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    background-color: #000;
    color: #fff;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

h1 {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 10px;
}

.date-display {
    font-size: 12px;
    color: #888;
    margin-bottom: 15px;
}

.reset-btn {
    background: transparent;
    color: #888;
    border: 1px solid #333;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px; /* iOS touch target */
}

.reset-btn:hover {
    background: #333;
    color: #fff;
}

.reset-btn:active {
    background: #444;
    transform: scale(0.98);
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.person-card {
    background: #111;
    border: 1px solid #333;
    padding: 30px;
    text-align: center;
    border-radius: 4px;
}

.person-card h2 {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 20px;
    color: #fff;
}

.score {
    font-size: 36px;
    font-weight: 300;
    margin-bottom: 15px;
    color: #fff;
}

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

.progress-bar {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: #888;
    min-width: 30px;
}

.last-test {
    font-size: 11px;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

.test-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px; /* iOS touch target */
}

.test-btn:hover {
    background: #f0f0f0;
}

.test-btn:active {
    background: #e0e0e0;
    transform: scale(0.98);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: #111;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #333;
    border-radius: 4px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 400;
    margin: 0;
}

.close {
    color: #888;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.question {
    margin-bottom: 20px;
}

.question label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #fff;
}

.question select {
    width: 100%;
    padding: 10px;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 14px;
}

.question select:focus {
    outline: none;
    border-color: #666;
}

.modal-footer {
    margin-top: 30px;
    text-align: center;
}

.submit-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 12px 30px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px; /* iOS touch target */
}

.submit-btn:hover {
    background: #f0f0f0;
}

.submit-btn:active {
    background: #e0e0e0;
    transform: scale(0.98);
}

/* History Section */
.history-section {
    margin-top: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.history-section h3 {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 20px;
    text-align: center;
    color: #fff;
}

.history-table-container {
    overflow-x: auto;
    border: 1px solid #333;
    border-radius: 4px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: #111;
    font-size: 12px;
}

.history-table th {
    background: #222;
    color: #fff;
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #333;
    font-weight: 400;
}

.history-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #222;
    color: #fff;
}

.history-table tbody tr:hover {
    background: #1a1a1a;
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .date-display {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .reset-btn {
        padding: 10px 16px;
        font-size: 14px;
        width: 100%;
        margin-top: 10px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        max-width: 100%;
    }
    
    .person-card {
        padding: 20px 15px;
        margin: 0;
    }
    
    .person-card h2 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .score {
        font-size: 28px;
        margin-bottom: 12px;
    }
    
    .progress-container {
        margin-bottom: 12px;
        gap: 8px;
    }
    
    .progress-bar {
        height: 10px;
    }
    
    .progress-text {
        font-size: 14px;
        min-width: 40px;
    }
    
    .last-test {
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .test-btn {
        padding: 14px 20px;
        font-size: 16px;
        width: 100%;
    }
    
    .history-section {
        margin-top: 30px;
    }
    
    .history-section h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .history-table-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .history-table {
        font-size: 12px;
    }
    
    .history-table th {
        padding: 10px 6px;
        font-size: 12px;
    }
    
    .history-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    /* Modal Mobile Styles */
    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 90vh;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .close {
        font-size: 20px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .question {
        margin-bottom: 15px;
    }
    
    .question label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .question select {
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 0;
    }
    
    .modal-footer {
        margin-top: 20px;
    }
    
    .submit-btn {
        padding: 14px 20px;
        font-size: 16px;
        width: 100%;
    }
}

/* Extra Small Screens */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .person-card {
        padding: 15px 10px;
    }
    
    .score {
        font-size: 24px;
    }
    
    .history-table {
        font-size: 11px;
    }
    
    .history-table th,
    .history-table td {
        padding: 6px 4px;
    }
    
    .modal-content {
        width: 98%;
        margin: 2% auto;
    }
    
    .modal-body {
        padding: 12px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 10px;
    }
    
    .question {
        margin-bottom: 10px;
    }
    
    .question select {
        padding: 8px;
    }
}
