:root {
    --bg-color: #000;
    --text-color: #fff;
    --accent-color: #4caf50;
    --warning-color: #ff9800;
    --guide-color: rgba(255, 255, 255, 0.8);
    --surface-color: #1a1a1a;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
}

.screen-view {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.app-header {
    background: var(--surface-color);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}
.app-header h3 { margin: 0; font-size: 18px; }

.btn-primary { background: var(--accent-color); color: white; border: none; padding: 10px 15px; border-radius: 6px; font-weight: bold; cursor: pointer; }
.btn-secondary { background: #444; color: white; border: none; padding: 10px 15px; border-radius: 6px; cursor: pointer; }
.btn-select { width: 100%; background: #333; color: white; border: 1px solid var(--accent-color); padding: 15px; margin: 8px 0; border-radius: 8px; font-weight: bold; font-size: 14px; cursor: pointer; text-align: left; }
.btn-cancel-text { background: transparent; border: none; color: #aaa; margin-top: 10px; cursor: pointer; }

.list-container { flex: 1; overflow-y: auto; padding: 15px; }
.list-item { background: var(--surface-color); padding: 15px; border-radius: 8px; margin-bottom: 10px; border-left: 4px solid var(--accent-color); cursor: pointer; }
.list-item-title { font-weight: bold; font-size: 15px; margin-bottom: 4px; }
.list-item-sub { font-size: 12px; color: #aaa; }
.no-data { text-align: center; color: #666; margin-top: 40px; }

.detail-meta { padding: 15px; background: #111; font-size: 14px; line-height: 1.6; }
.photo-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 15px; }
.photo-card { background: var(--surface-color); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.photo-card img { width: 100%; height: 120px; object-fit: cover; background: #000; }
.photo-label { font-size: 11px; padding: 6px; text-align: center; background: rgba(0,0,0,0.4); }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); z-index: 3000; display: flex; justify-content: center; align-items: center; }
.modal-content { background: #fff; color: #000; padding: 30px; border-radius: 12px; min-width: 280px; max-width: 85%; }
.modal-content input { padding: 12px; margin: 15px 0; width: 100%; border: 1px solid #ccc; border-radius: 6px; font-size: 16px; box-sizing: border-box; }
.modal-content button { width: 100%; padding: 12px; background: var(--accent-color); color: white; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }
.demo-hint { color: #666; font-size: 11px; margin-top: 10px; }
.text-center { text-align: center; }

.header { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; background: rgba(0,0,0,0.8); z-index: 10; height: 50px; }
.header-btn { font-size: 20px; cursor: pointer; color: white; }
.status-container { text-align: center; flex: 1; }
.auto-btn { background: white; color: black; padding: 4px 10px; border-radius: 15px; font-weight: bold; font-size: 10px; display: inline-flex; align-items: center; }
.status-text { font-size: 8px; margin-top: 2px; color: #aaa; }

.info-bar { text-align: center; padding: 8px; background: rgba(0,0,0,0.6); height: 45px; }
.shot-count { font-size: 10px; letter-spacing: 1px; color: #4caf50; }
.instruction { font-size: 13px; font-weight: bold; text-transform: uppercase; margin-top: 2px; }

.viewport { position: relative; flex: 1; background: #111; overflow: hidden; display: flex; justify-content: center; align-items: center; }
video { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 1; }

.overlay { position: absolute; width: 100%; height: 100%; pointer-events: none; display: flex; justify-content: center; align-items: center; z-index: 5; }
.guide-frame { position: absolute; border: 2px solid var(--guide-color); transition: all 0.2s ease-in-out; box-sizing: border-box; width: 95%; height: 95%; }

.bracket { position: absolute; width: 20px; height: 20px; border: 2px solid var(--guide-color); }
.tl { top: -4px; left: -4px; border-right: none; border-bottom: none; }
.tr { top: -4px; right: -4px; border-left: none; border-bottom: none; }
.bl { bottom: -4px; left: -4px; border-right: none; border-top: none; }
.br { bottom: -4px; right: -4px; border-left: none; border-top: none; }

.percentage-marker { position: absolute; color: var(--accent-color); font-size: 11px; font-weight: bold; background: rgba(0,0,0,0.5); padding: 2px 4px; border-radius: 3px; }
.p-left { left: 10px; top: 50%; transform: translateY(-50%); }
.p-right { right: 10px; top: 50%; transform: translateY(-50%); }
.p-bottom { bottom: 15px; left: 50%; transform: translateX(-50%); }

.center-reticle { width: 12px; height: 12px; border: 2px solid var(--accent-color); border-radius: 50%; position: absolute; }
.warning-msg { position: absolute; bottom: 15px; width: 90%; text-align: center; background: rgba(255, 152, 0, 0.9); color: black; padding: 6px; font-size: 10px; font-weight: bold; z-index: 5; border-radius: 4px; }

.controls { height: 90px; display: flex; justify-content: center; align-items: center; background: black; }
.shutter-btn { width: 60px; height: 60px; border: 4px solid white; border-radius: 50%; background: transparent; cursor: pointer; }
.shutter-btn:active { background: white; }

.camera-switch-btn { position: absolute; bottom: 15px; right: 15px; width: 40px; height: 40px; background: rgba(0,0,0,0.6); border: 2px solid var(--accent-color); border-radius: 50%; color: white; font-size: 18px; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; }

.photo-modal-content { background: #1a1a1a; padding: 15px; border-radius: 10px; text-align: center; width: 90%; max-width: 400px; color: #fff;}
.photo-modal-content img { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 6px; margin: 10px 0; border: 1px solid #333; }
.photo-modal-buttons { display: flex; gap: 10px; margin-top: 15px; }
.btn-confirm { flex: 1; padding: 14px; background: var(--accent-color); color: white; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }
.btn-cancel { flex: 1; padding: 14px; background: #d32f2f; color: white; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }

/* ==========================================
   追加：アクションバー・判定結果画面スタイル
   ========================================== */
.action-bar {
    padding: 10px 15px;
    background: #111;
    border-bottom: 1px solid #333;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

.result-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 判定レベルカード（大表示） */
.result-badge-box {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.result-level-title {
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.9;
    letter-spacing: 1px;
}

.result-level-value {
    font-size: 26px;
    font-weight: bold;
    margin-top: 5px;
}

/* 汎用結果カード */
.result-card {
    background: var(--surface-color);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
}

.result-card h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #aaa;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.result-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* フォーム要素 */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: #ccc;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    background: #111;
    border: 1px solid #444;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* 完了通知 */
.completed-notice {
    background: #1e3a1e;
    color: #81c784;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    border: 1px solid #2e7d32;
}
