* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.6;
    background-color: #f1f3f4;
    color: #202124;
    margin: 0;
    padding: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    min-height: 100vh;
}

.app-bar {
    background: #1e8e3e;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-bar-content {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.app-title {
    font-size: 20px;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.25px;
}

.app-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

.app-timer-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.app-timer-value {
    font-size: 16px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    min-width: 55px;
    text-align: center;
}

.app-timer.warning {
    background: rgba(249, 171, 0, 0.9);
}

.app-timer.danger {
    background: rgba(234, 67, 53, 0.9);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 12px 16px 24px;
}

.hidden {
    display: none !important;
}

/* Warning Box */
#warning-box {
    background: #fff;
    border-left: 4px solid #ea4335;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

/* Timer Box (legacy - now hidden) */
#timer-box {
    display: none;
}

.warning-icon {
    width: 24px;
    height: 24px;
    color: #ea4335;
    flex-shrink: 0;
}

.warning-text {
    flex: 1;
}

.warning-text strong {
    display: block;
    color: #ea4335;
    font-weight: 500;
    margin-bottom: 4px;
}

.warning-text p {
    margin: 0;
    color: #5f6368;
    font-size: 14px;
}

/* Card */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 24px 24px 0;
    border-top: 8px solid #1e8e3e;
}

.card-title {
    font-size: 24px;
    font-weight: 400;
    margin: 0 0 8px;
    color: #202124;
}

.card-description {
    font-size: 14px;
    color: #5f6368;
    margin: 0 0 16px;
}

.card-content {
    padding: 24px;
}

.card-actions {
    padding: 0 24px 24px;
}

/* Info List */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-icon {
    width: 24px;
    height: 24px;
    color: #1e8e3e;
    flex-shrink: 0;
}

.info-item span {
    font-size: 14px;
    color: #202124;
    line-height: 1.4;
}

.info-item.time-limit-info {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}

.info-item.time-limit-info .info-icon {
    color: #1e8e3e;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 8px;
}

.form-label .required {
    color: #ea4335;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background: #fff;
}

.form-input:focus {
    outline: none;
    border-color: #1e8e3e;
    box-shadow: 0 0 0 2px rgba(30, 142, 62, 0.2);
}

.form-input::placeholder {
    color: #80868b;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%235f6368' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 24px;
    padding-right: 40px;
}

/* Student Info Display */
.student-info-display {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: #5f6368;
    font-weight: 500;
    min-width: 100px;
}

.info-value {
    font-size: 14px;
    color: #202124;
    flex: 1;
}

/* Question Block */
.question-block {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    margin-bottom: 16px;
    padding: 24px;
    border-top: 8px solid #1e8e3e;
}

.question-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #202124;
}

.question-text {
    margin-bottom: 20px;
    font-size: 14px;
    color: #5f6368;
    line-height: 1.6;
}

.options-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-item {
    margin: 0;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    font-size: 14px;
    color: #202124;
}

.option-label:hover {
    background: #f8f9fa;
    border-color: #1e8e3e;
}

.option-label:active {
    background: #f1f3f4;
}

input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0 12px 0 0;
    cursor: pointer;
    accent-color: #1e8e3e;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    font-family: inherit;
    letter-spacing: 0.25px;
    text-transform: none;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.btn-primary {
    background: #1e8e3e;
    color: white;
}

.btn-primary:hover {
    background: #188038;
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

.btn-primary:active {
    background: #137333;
}

.btn-success {
    background: #34a853;
    color: white;
}

.btn-success:hover {
    background: #2d8e47;
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

.btn-success:active {
    background: #27753c;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Score Display */
.score-display {
    text-align: center;
    padding: 32px 0;
}

.score-number {
    font-size: 56px;
    font-weight: 300;
    color: #1e8e3e;
    line-height: 1;
    margin-bottom: 8px;
}

.score-value {
    font-weight: 500;
}

.score-separator {
    color: #dadce0;
    margin: 0 8px;
}

.score-total {
    color: #5f6368;
}

.score-label {
    font-size: 16px;
    color: #5f6368;
    margin: 0;
}

.note {
    font-size: 12px;
    color: #5f6368;
    text-align: center;
    margin: 12px 0 0;
    padding: 0 24px;
}

/* Responsive Design */
@media (max-width: 640px) {
    .app-bar-content {
        padding: 14px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .app-title {
        font-size: 18px;
        text-align: center;
    }

    .app-timer {
        justify-content: center;
    }

    .app-timer-value {
        font-size: 18px;
    }

    .container {
        padding: 8px 8px 16px;
    }

    .card-header {
        padding: 20px 16px 0;
    }

    .card-title {
        font-size: 20px;
    }

    .card-content {
        padding: 16px;
    }

    .card-actions {
        padding: 0 16px 16px;
    }

    .question-block {
        padding: 16px;
        border-top-width: 6px;
    }

    .question-title {
        font-size: 15px;
    }

    .option-label {
        padding: 14px;
        font-size: 15px;
    }

    .score-number {
        font-size: 48px;
    }

    #warning-box {
        padding: 12px;
    }

    .info-item {
        padding: 10px;
    }
}

@media (max-width: 360px) {
    .score-number {
        font-size: 40px;
    }

    .card-title {
        font-size: 18px;
    }
}

/* Lock Overlay */
#lock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.lock-modal {
    background: #fff;
    border-radius: 8px;
    padding: 32px 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.lock-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: #ea4335;
}

.lock-icon svg {
    width: 100%;
    height: 100%;
}

.lock-modal h2 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 16px;
    color: #202124;
}

.lock-modal p {
    color: #5f6368;
    font-size: 14px;
    margin: 8px 0;
    line-height: 1.5;
}

.lock-modal .warning-text {
    color: #ea4335;
    font-weight: 500;
    margin: 16px 0;
}

.password-input-group {
    margin: 24px 0 16px;
}

.password-input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 12px;
    font-family: 'Courier New', monospace;
    text-align: center;
}

.password-input-group input:focus {
    outline: none;
    border-color: #1e8e3e;
    box-shadow: 0 0 0 2px rgba(30, 142, 62, 0.2);
}

.lock-modal .note {
    font-size: 12px;
    color: #5f6368;
    margin-top: 16px;
}
