@charset "UTF-8";

:root {
    --bg-wood: #3e2723;
    --paper: #fdfbf7;
    --ink: #2b2b2b;
    --gold: #c5a059;
    --accent-science: #2e7d32;
    --font-main: 'Shippori Mincho', serif;
}

* { box-sizing: border-box; touch-action: manipulation; }

body {
    margin: 0; padding: 0;
    background-color: var(--bg-wood);
    color: var(--ink);
    font-family: var(--font-main);
    min-height: 100vh;
}

#app {
    max-width: 800px; margin: 0 auto; padding: 20px;
}

header {
    text-align: center; padding: 30px 0;
    border-bottom: 2px solid var(--gold); margin-bottom: 30px;
}
h1 { color: var(--paper); margin: 0; font-size: 2.2rem; }
.subtitle { color: var(--gold); margin-top: 10px; }

.panel {
    background-color: var(--paper);
    border-radius: 4px; padding: 25px; margin-bottom: 20px;
    border-left: 8px solid var(--gold);
    display: none; opacity: 0; transition: opacity 0.5s;
}
.panel.active { display: block; opacity: 1; }

.form-group { margin-bottom: 25px; }
label { display: block; font-weight: bold; margin-bottom: 8px; border-bottom: 1px solid #ccc; width: fit-content; }
select, input[type="text"], input[type="password"], textarea {
    width: 100%; padding: 12px; font-size: 1.1rem;
    border: 1px solid #ccc; border-radius: 4px; font-family: sans-serif;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* モード選択 */
.mode-select-container { display: flex; gap: 15px; margin-top: 10px; }
.mode-option { flex: 1; cursor: pointer; }
.mode-option input { display: none; }
.mode-box {
    border: 2px solid #ccc; border-radius: 8px; padding: 15px;
    text-align: center; background: #fff; transition: 0.2s; height: 100%;
}
.mode-box i { font-size: 2rem; margin-bottom: 10px; color: #555; }
.mode-option input:checked + .mode-box {
    border-color: var(--gold); background: #fffdf0;
}
.mode-option input:checked + .mode-box i { color: var(--bg-wood); }

.subject-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.tab-btn {
    flex: 1; padding: 12px; background: #eee; border: 1px solid #ccc; cursor: pointer; font-size: 1.1rem;
}
.tab-btn.active { background: var(--gold); color: white; border-color: var(--gold); }

.btn-action {
    width: 100%; padding: 16px; font-size: 1.2rem; font-weight: bold;
    color: white; background: var(--bg-wood); border: none; cursor: pointer;
    margin-top: 15px; border-radius: 4px;
}
.btn-check { background: var(--accent-science); }
.btn-share { background: #1976d2; margin-top: 10px; }
.btn-manual { background: #555; margin-top: 10px; }

.text-input-box { height: 150px; resize: none; font-size: 1.2rem; }

/* カメラ */
.camera-wrapper {
    background: #000; height: 300px; margin-top: 10px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
video { width: 100%; height: 100%; object-fit: contain; }
.camera-controls { text-align: center; padding: 10px; background: #eee; }
.btn-small { padding: 8px 15px; cursor: pointer; }

/* サムネイル */
.photo-gallery {
    display: flex; gap: 5px; overflow-x: auto; padding: 10px 0; background: #333; margin-bottom: 10px;
}
.photo-thumb {
    height: 80px; width: auto; border: 2px solid #fff;
}

/* 結果テーブル */
.result-table-container { overflow-x: auto; margin-top: 20px; }
#result-table { width: 100%; border-collapse: collapse; min-width: 600px; }
#result-table th, #result-table td {
    border: 1px solid #ddd; padding: 8px; text-align: center; vertical-align: middle;
}
#result-table th { background: #f0f0f0; font-weight: bold; }
.score-display {
    font-size: 3rem; text-align: center; color: var(--bg-wood); font-weight: bold; font-family: 'Zen Kurenaido';
}
.time-display { text-align: center; color: #666; }

.instruction-box { background: #e3f2fd; color: #0d47a1; padding: 15px; text-align: center; border-radius: 4px; }
.fig-area img { max-width: 100%; height: auto; }