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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
  padding-bottom: 20px;
}

.hidden {
  display: none !important;
}

header {
  background: #1a73e8;
  color: #fff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-title {
  font-size: 1.1rem;
  font-weight: bold;
}

.tag-badge {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 0.85rem;
}

.main-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 10px;
}

/* 通過判定カード */
.result-card {
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  margin-bottom: 10px;
  border: 3px solid #ccc;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.result-card.success {
  border-color: #34a853;
  background: #e6f4ea;
}

.result-card.error {
  border-color: #ea4335;
  background: #fce8e6;
}

.res-status {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.res-bib {
  font-size: 2.2rem;
  font-weight: bold;
  color: #1a73e8;
  line-height: 1.1;
}

.res-name {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 4px 0;
  color: #111;
}

.res-sub {
  font-size: 0.95rem;
  font-weight: 600;
  color: #444;
}

/* 直前取消バー */
.cancel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-cancel {
  background: #ea4335;
  color: #fff;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

.btn-cancel:active {
  background: #c5221f;
}

/* モード切替タブ */
.mode-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.mode-btn {
  flex: 1;
  padding: 10px 4px;
  border: 2px solid #1a73e8;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  background: #fff;
  color: #1a73e8;
  text-align: center;
}

.mode-btn.active {
  background: #1a73e8;
  color: #fff;
}

/* カメラ枠 */
.camera-wrapper {
  position: relative;
  width: 100%;
  height: 260px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-guide {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 2px dashed #34a853;
  border-radius: 12px;
  pointer-events: none;
}

.camera-placeholder {
  color: #888;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
  white-space: pre-line;
}

/* 手入力バックアップ起動バー */
.manual-trigger {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.btn-manual-open {
  background: #5f6368;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

/* 通過ログ履歴 */
.log-list {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.85rem;
  padding: 4px 8px;
}

.log-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px solid #eee;
}

.log-item:last-child {
  border-bottom: none;
}

/* 手入力モーダル */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  width: 85%;
  max-width: 320px;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.modal-input {
  width: 100%;
  padding: 12px;
  font-size: 1.5rem;
  text-align: center;
  border: 2px solid #1a73e8;
  border-radius: 6px;
  margin: 15px 0;
}

.modal-btns {
  display: flex;
  gap: 8px;
}

.modal-btns button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}
