/* 紫藤峠の殺人 - Web Port Styles */

:root {
  --bg: #0a0a14;
  --panel-bg: #1a1a2e;
  --text-color: #e0e0e0;
  --accent: #c9a96e;
  --accent2: #8b5e3c;
  --border: #4a3728;
  --char-color: #f0d080;
  --choice-bg: #2a1f14;
  --choice-hover: #3d2b1a;
  --choice-text: #d4a854;
  --dialog-bg: rgba(8, 8, 20, 0.92);
  --name-bg: #1a0f08;
  --name-text: #e8c878;
  --panel-border: #5a3a1a;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Noto Serif CJK SC', 'Noto Serif SC', 'SimSun', 'MS Mincho', 'Hiragino Mincho ProN', serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ========== 响应式容器 ========== */
#game-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  overflow: hidden;
}

#game-container {
  position: relative;
  width: 700px;
  height: 500px;
  background: #000;
  border: 3px solid var(--panel-border);
  box-shadow: 0 0 40px rgba(0,0,0,0.8), 0 0 80px rgba(100,60,20,0.3), inset 0 0 20px rgba(0,0,0,0.5);
  overflow: hidden;
  cursor: default;
  /* transform: scale() 由JS动态设置 */
}
#game-container.clickable { cursor: pointer; }

/* ========== 多层图形 ========== */
#graphic-layers {
  position: absolute;
  top: 0; left: 0;
  width: 700px; height: 500px;
  z-index: 1;
}

.graphic-layer {
  position: absolute;
  top: 0; left: 0;
  width: 700px; height: 500px;
  pointer-events: none;
}

.graphic-layer img {
  position: absolute;
  transition: opacity 0.6s ease;
  opacity: 0;
  object-fit: fill;
  pointer-events: none;
}

.graphic-layer img.visible {
  opacity: 1;
}

/* ========== 对话框 ========== */
#dialog-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 700px; height: 500px;
  z-index: 10;
  pointer-events: none;
  display: none;
}

#dialog-box {
  position: absolute;
  background: var(--dialog-bg);
  border-top: 2px solid var(--panel-border);
  border-left: 2px solid var(--panel-border);
  border-right: 2px solid var(--panel-border);
  min-height: 70px;
  max-height: 100px;
  padding: 8px 14px 10px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  bottom: 0;
  left: 0;
  right: 0;
}

#dialog-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,150,80,0.5), transparent);
}

#char-name {
  display: none;
  position: absolute;
  background: var(--name-bg);
  color: var(--name-text);
  padding: 3px 20px;
  font-size: 14px;
  border: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--name-bg);
  border-radius: 4px 4px 0 0;
  font-weight: bold;
  letter-spacing: 1px;
  z-index: 11;
  white-space: nowrap;
}

#dialog-text {
  color: #d0d0d0;
  font-size: 16px;
  line-height: 1.8;
  min-height: 40px;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: break-word;
}

#click-indicator {
  display: none;
  position: absolute;
  color: rgba(200,160,100,0.7);
  font-size: 11px;
  animation: blink 1.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 12;
  bottom: 6px;
  right: 16px;
}

@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ========== 选项 ========== */
#choices-container {
  display: none;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  flex-direction: column;
  gap: 5px;
  padding: 12px 20px 14px 20px;
  background: linear-gradient(transparent, rgba(8,8,25,0.96) 18%);
}

.choice-btn {
  background: rgba(30,16,8,0.9);
  color: var(--choice-text);
  border: 1px solid var(--panel-border);
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  border-radius: 2px;
  pointer-events: auto;
  letter-spacing: 0.5px;
  min-height: 40px;
}

.choice-btn:hover, .choice-btn:active {
  background: rgba(50,28,14,0.95);
  border-color: #a07030;
  color: #f0c860;
  padding-left: 22px;
  box-shadow: 0 0 12px rgba(180,120,40,0.2);
}

/* ========== 标题画面 ========== */
#title-screen {
  position: absolute;
  top: 0; left: 0;
  width: 700px; height: 500px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #000;
}

#title-screen img {
  position: absolute;
  top: 0; left: 0;
  width: 700px; height: 500px;
  object-fit: cover;
  opacity: 0.7;
}

#title-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  background: rgba(0,0,0,0.75);
  padding: 30px 50px;
  border: 2px solid var(--panel-border);
  border-radius: 4px;
  min-width: 360px;
}

#title-overlay h1 {
  color: var(--accent);
  font-size: 28px;
  font-weight: normal;
  letter-spacing: 4px;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(200,150,80,0.5);
}

#title-overlay .subtitle {
  color: #a08060;
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 28px;
}

#title-overlay .start-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--panel-border);
  padding: 10px 40px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 3px;
  transition: all 0.3s;
  min-height: 44px;
}

#title-overlay .start-btn:hover, .start-btn:active {
  background: rgba(100,60,20,0.3);
  border-color: #a07030;
  box-shadow: 0 0 15px rgba(180,120,40,0.3);
  letter-spacing: 5px;
}

#title-overlay .continue-btn {
  background: transparent;
  color: #8a7050;
  border: 1px solid #3a2818;
  padding: 8px 30px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.3s;
  margin-top: 10px;
  min-height: 44px;
}

#title-overlay .continue-btn:hover, .continue-btn:active {
  background: rgba(60,40,20,0.3);
  border-color: #6a4830;
  color: #a08060;
}

/* ========== 加载画面 ========== */
#loading-screen {
  position: absolute;
  top: 0; left: 0;
  width: 700px; height: 500px;
  z-index: 100;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #a08060;
  font-size: 14px;
  letter-spacing: 2px;
}

#loading-text { margin-bottom: 4px; }

#loading-bar-bg {
  width: 300px; height: 3px;
  background: #2a1a0a;
  margin-top: 16px;
  border-radius: 2px;
  overflow: hidden;
}

#loading-bar {
  width: 0%; height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

#loading-status {
  margin-top: 8px;
  font-size: 10px;
  color: #604020;
}

/* ========== 顶部工具栏 ========== */
#top-toolbar {
  position: absolute;
  top: 4px; left: 4px;
  z-index: 40;
}

.toolbar-btn {
  background: rgba(26,15,8,0.8);
  color: var(--accent);
  border: 1px solid var(--panel-border);
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.toolbar-btn:hover, .toolbar-btn:active {
  background: rgba(42,26,10,0.9);
  border-color: #a07030;
}

/* ========== 右键菜单 ========== */
#context-menu {
  display: none;
  position: fixed;
  z-index: 200;
  background: #1a0f08;
  border: 1px solid var(--panel-border);
  min-width: 170px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}

.context-item {
  padding: 12px 18px;
  color: #c0a070;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(90,58,26,0.3);
}

.context-item:hover, .context-item:active {
  background: #2a1a0a;
  color: #f0c860;
}

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

/* ========== 存档槽 ========== */
#save-slots {
  display: none;
  position: fixed;
  z-index: 210;
  background: #1a0f08;
  border: 1px solid var(--panel-border);
  width: 280px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.8);
  padding: 8px;
}

.save-slots-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(90,58,26,0.5);
  margin-bottom: 6px;
  padding-bottom: 6px;
}

.save-slots-header h3 {
  color: var(--accent);
  font-size: 14px;
  padding: 4px 8px;
  text-align: center;
  letter-spacing: 1px;
  font-weight: normal;
  flex: 1;
}

.close-btn {
  background: transparent;
  color: #806040;
  border: 1px solid #3a2818;
  width: 26px;
  height: 26px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.close-btn:hover, .close-btn:active {
  background: #2a1a0a;
  color: #f0c860;
  border-color: #a07030;
}

#save-slots-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slot-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  color: #c0a070;
  border: 1px solid transparent;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  border-radius: 2px;
  min-height: 40px;
}

.slot-btn:hover, .slot-btn:active {
  background: #2a1a0a;
  color: #f0c860;
  border-color: var(--panel-border);
}

.slot-btn.empty {
  color: #604020;
  font-style: italic;
}

/* ========== 调试面板 ========== */
#debug-panel {
  display: none;
  position: absolute;
  top: 0; left: 0;
  z-index: 300;
  background: rgba(0,0,0,0.92);
  color: #0f0;
  font-size: 10px;
  font-family: monospace;
  padding: 4px 8px;
  max-width: 700px;
  max-height: 200px;
  overflow-y: auto;
  pointer-events: none;
  white-space: pre-wrap;
}

/* ========== 翻译标识 ========== */
#translation-notice {
  position: absolute;
  top: 4px; right: 8px;
  z-index: 30;
  color: rgba(200,150,100,0.55);
  font-size: 10px;
  pointer-events: none;
  letter-spacing: 0.5px;
}
