/* --- AI Stick Hand Styles --- */

* { box-sizing: border-box; }
body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    overflow: hidden; background: #000;
    font-family: "Noto Sans JP", sans-serif;
}

/* カメラ背景 */
.camera-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0;
}
.input_video { display: none; }
.output_canvas {
    width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1);
}

/* UIレイヤー */
.ui-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; padding: 10px;
    display: flex; flex-direction: column;
    pointer-events: none; /* Canvas操作を通す */
}

/* 要素有効化 */
.header-bar, .setup-card, .overlay-screen, #game-ui button {
    pointer-events: auto;
}

/* ヘッダー */
.header-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.9);
    padding: 8px 15px; border-radius: 30px;
    margin-bottom: 10px; flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.btn-menu {
    background: transparent; border: 2px solid #5d4037;
    color: #5d4037; padding: 5px 15px; border-radius: 20px;
    font-weight: bold; cursor: pointer;
}
.header-title { font-weight: bold; color: #5d4037; font-size: 1.1rem; }

/* 設定カード */
.setup-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px; padding: 20px;
    width: 95%; max-width: 400px; margin: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
}
.card-title { margin: 0 0 5px 0; color: #5d4037; font-size: 1.5rem; }
.card-desc { font-size: 0.9rem; color: #666; margin-bottom: 20px; }

.settings-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.s-row {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px dashed #ccc; padding-bottom: 5px;
}
.s-row label { font-weight: bold; color: #5d4037; }
.s-row select {
    padding: 8px; border-radius: 6px; border: 1px solid #999;
    font-size: 1rem; width: 50%; text-align: center; background: #fff;
}
.double-select { display: flex; gap: 5px; width: 50%; justify-content: flex-end; align-items: center; }
.double-select select { width: 100%; }

.start-btn {
    width: 100%; padding: 15px; background: #5d4037; color: white;
    font-size: 1.3rem; font-weight: bold; border: none; border-radius: 50px;
    box-shadow: 0 4px 10px rgba(93, 64, 55, 0.4);
}

/* ゲーム中UI */
#game-ui { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 20px; }
.game-header {
    display: flex; justify-content: space-around;
    background: rgba(255,255,255,0.8); padding: 10px; border-radius: 15px;
}
.g-stat { font-weight: bold; color: #5d4037; font-size: 1.2rem; }
.btn-stop {
    align-self: center; background: rgba(255,255,255,0.9); border: 2px solid #999;
    padding: 10px 30px; border-radius: 30px; font-weight: bold; color: #555;
}

/* オーバーレイ画面 */
.overlay-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(250, 247, 242, 0.95);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 100;
}
.big-timer { font-size: 5rem; font-weight: 900; color: #d4a373; margin: 20px 0; }
.result-data {
    background: #fff; padding: 20px; border-radius: 15px; width: 80%;
    margin-bottom: 20px; text-align: left; border: 1px solid #eee;
}
.result-data p { margin: 10px 0; font-size: 1.2rem; font-weight: bold; color: #4a3f35; }
.highlight { color: #d32f2f; font-size: 1.5rem; }

.btn-primary { width: 80%; padding: 12px; background: #5d4037; color: white; border: none; border-radius: 30px; font-size: 1.1rem; font-weight: bold; margin-bottom: 10px; }
.btn-secondary { width: 80%; padding: 10px; background: #fff; color: #5d4037; border: 2px solid #5d4037; border-radius: 30px; font-size: 1rem; font-weight: bold; }

.hidden { display: none !important; }