/* 基本設定とリセット */
:root {
    --bg-color: #000000;
    --neon-blue: #00d2ff;
    --neon-green: #00ff88;
    --neon-red: #ff2a6d;
    --text-color: #ffffff;
    --tron-cyan: #00f0ff;
    --dim-text: rgba(255, 255, 255, 0.4);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Noto Sans JP', sans-serif;
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    overflow: hidden;
    /* スクロールを抑制 */
    position: relative;
}

.container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    justify-content: space-between;
    align-items: center;
}

/* タイトル */
.app-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    color: var(--neon-blue);
    letter-spacing: 4px;
    text-shadow: 0 0 10px var(--neon-blue);
    margin-top: 10px;
}

/* メインコンテンツ（中央寄せだが少し下げる） */
.main-content {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* 中央付近 */
    gap: 30px;
    padding-bottom: 50px;
    /* 少し上に押し上げる（視覚的バランス） */
}

/* バーコード入力エリア */
.input-section {
    width: 100%;
    text-align: center;
}

.input-section label {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #ffffff;
    /* 視認性を上げるために明るく */
    text-transform: uppercase;
    letter-spacing: 2px;
}

#barcode-input {
    width: 100%;
    max-width: 280px;
    /* 横幅を少し抑える */
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    font-family: 'Orbitron', sans-serif;
    /* スマホで破綻しないようフォントサイズを微調整 */
    font-size: clamp(3rem, 15vw, 4.5rem);
    font-weight: bold;
    text-align: center;
    padding: 5px 10px;
    /* 縦の余白を減らす */
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
    outline: none;
    transition: all 0.3s;
    line-height: normal;
    height: 90px;
    /* 高さを固定して暴走を防ぐ */
}

#barcode-input:focus {
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

/* ボタン */
.action-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s;
}

.btn-large {
    font-size: 1.4rem;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.btn-primary:active {
    background: var(--neon-green);
    color: #000;
}

.btn-danger {
    background: rgba(255, 42, 109, 0.1);
    border: 1px solid var(--neon-red);
    color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 42, 109, 0.2);
}

.btn-danger:active {
    background: var(--neon-red);
    color: #000;
}

/* 下部コントロール */
.bottom-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* 調査モードトグル */
.mode-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mode-label {
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    opacity: 0.8;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--neon-blue);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* フッター */
.app-footer {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    opacity: 0.3;
}

/* メッセージオーバーレイ */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.2s;
}

.hidden {
    display: none;
}

.message-box {
    text-align: center;
    padding: 30px;
    border-radius: 20px;
    background: #000;
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 30px var(--neon-green);
    min-width: 240px;
}

.message-box.danger {
    border-color: var(--neon-red);
    box-shadow: 0 0 30px var(--neon-red);
}

.icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.message-text {
    font-size: 24px;
    font-weight: bold;
    line-height: 1.5;
    color: #fff;
}