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

body {
  background: #0d0f12;
  color: #d8e0e6;
  font-family: "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

#game-wrap {
  width: 800px;
  position: relative;
}

#canvas-area {
  position: relative;
  padding-bottom: 158px;
}

#game-canvas {
  display: block;
  background: #1b1f24;
  border: 2px solid #3a4149;
}

#hud-topleft {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(10, 12, 15, 0.7);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  min-width: 140px;
}

#hud-topright {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(10, 12, 15, 0.7);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  min-width: 140px;
  max-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  text-align: right;
}

#hud-bottomleft {
  position: absolute;
  bottom: 170px;
  left: 12px;
  background: rgba(10, 12, 15, 0.7);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  min-width: 130px;
}

#mode-label {
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 6px;
  color: #7fd8ff;
}

#battery-bar-bg {
  width: 100%;
  height: 10px;
  background: #2a2f35;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

#battery-bar-fill {
  height: 100%;
  width: 100%;
  background: #4fd67a;
  transition: width 0.1s linear, background 0.2s linear;
}

#battery-label {
  font-size: 12px;
  color: #9aa4ad;
  margin-bottom: 6px;
}

#health-bar-bg {
  width: 100%;
  height: 10px;
  background: #2a2f35;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

#health-bar-fill {
  height: 100%;
  width: 100%;
  background: #ff6b6b;
  transition: width 0.1s linear, background 0.2s linear;
}

#health-label {
  font-size: 12px;
  color: #9aa4ad;
  margin-bottom: 6px;
}

#status-label {
  font-size: 13px;
  font-weight: bold;
  color: #6b7480;
}

#alert-label {
  margin-top: 4px;
  font-size: 12px;
  font-weight: bold;
}

#timeattack-label {
  margin-top: 4px;
  font-size: 14px;
  font-weight: bold;
  color: #f2d774;
  letter-spacing: 1px;
}

#timeattack-label.hidden {
  display: none;
}

#hack-label {
  margin-top: 4px;
  font-size: 13px;
  font-weight: bold;
  color: #7fd8ff;
}

#hack-label.hidden {
  display: none;
}

#download-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  background: rgba(10, 12, 15, 0.82);
  border: 1px solid #ff9d4d;
  border-radius: 6px;
  padding: 8px 14px;
  box-shadow: 0 0 16px rgba(255, 157, 77, 0.35);
  text-align: center;
}

#download-banner.hidden {
  display: none;
}

#download-banner-label {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #ff9d4d;
  margin-bottom: 6px;
}

#download-bar-bg {
  width: 100%;
  height: 14px;
  background: #2a2f35;
  border-radius: 7px;
  overflow: hidden;
}

#download-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff9d4d, #ffc37a);
  transition: width 0.15s linear;
}

#charge-label {
  margin-top: 4px;
  font-size: 13px;
  font-weight: bold;
  color: #4fd67a;
}

#charge-label.hidden {
  display: none;
}

#parts-label {
  margin-top: 6px;
  font-size: 12px;
  color: #5ad1c9;
}

#parts-label.hidden {
  display: none;
}

#slots-label {
  margin-top: 2px;
  font-size: 13px;
  font-weight: bold;
  color: #9aa4ad;
}

#slots-label.hidden {
  display: none;
}

#equip-label,
#swim-label,
#smoke-label,
#jammer-label,
#munition-label,
#decoy-label,
#minimap-gadget-label,
#detector-label,
#storage-label {
  margin-top: 3px;
  font-size: 11px;
  color: #6b7480;
}

#equip-label.hidden,
#swim-label.hidden,
#smoke-label.hidden,
#jammer-label.hidden,
#munition-label.hidden,
#decoy-label.hidden,
#minimap-gadget-label.hidden,
#detector-label.hidden,
#storage-label.hidden {
  display: none;
}

#funds-label {
  margin-top: 6px;
  font-size: 14px;
  font-weight: bold;
  color: #e8c34a;
}

#funds-label.hidden {
  display: none;
}

#gameover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(10, 12, 15, 0.75);
  text-align: center;
}

#gameover p {
  font-size: 28px;
  color: #ff6b6b;
  margin-bottom: 8px;
}

#gameover p.small {
  font-size: 14px;
  color: #d8e0e6;
}

#gameover #result-detail {
  font-size: 16px;
  font-weight: bold;
}

#gameover.hidden {
  display: none;
}

#chat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 6, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 14;
}

#chat-backdrop.chat-active {
  opacity: 1;
}

#chat-panel {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  background: rgba(4, 10, 6, 0.9);
  border: 1px solid #2a4a34;
  border-radius: 4px 4px 0 0;
  font-family: "Consolas", "Courier New", monospace;
  box-shadow: 0 0 8px rgba(79, 214, 122, 0.15);
  opacity: 0.75;
  z-index: 16;
  transition: opacity 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, left 0.25s ease,
    top 0.25s ease, bottom 0.25s ease, width 0.25s ease;
}

#chat-panel.chat-active {
  left: 160px;
  top: 170px;
  bottom: auto;
  width: 480px;
  opacity: 1;
  border-radius: 4px;
  border-color: #4fd67a;
  border-width: 2px;
  box-shadow: 0 0 30px rgba(79, 214, 122, 0.55);
}

#chat-log {
  height: 112px;
  overflow-y: auto;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #4fd67a;
  transition: height 0.25s ease, font-size 0.25s ease;
}

#chat-panel.chat-active #chat-log {
  height: 220px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.7;
}

#chat-log .chat-echo {
  color: #7fd8ff;
}

#chat-log .chat-system {
  color: #9aa4ad;
}

#chat-log .chat-challenge {
  color: #f2d774;
  font-weight: bold;
  letter-spacing: 2px;
}

#chat-log .chat-success {
  color: #4fd67a;
  font-weight: bold;
}

#chat-log .chat-fail,
#chat-log .chat-warn {
  color: #ff6b6b;
}

#chat-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-top: 1px solid #2f6b3f;
  padding: 6px 12px;
  transition: padding 0.25s ease;
}

#chat-panel.chat-active #chat-input-row {
  padding: 10px 18px;
}

#chat-prompt {
  color: #4fd67a;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  transition: font-size 0.25s ease;
}

#chat-panel.chat-active #chat-prompt {
  font-size: 17px;
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #d8ffe4;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  padding: 4px 0;
  transition: font-size 0.25s ease;
}

#chat-panel.chat-active #chat-input {
  font-size: 17px;
}

#chat-input::placeholder {
  color: #3d5c46;
}


#base-screen {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #12151a;
  z-index: 20;
}

#base-screen.hidden {
  display: none;
}

#base-panel {
  width: 560px;
  max-height: 560px;
  overflow-y: auto;
  background: rgba(20, 24, 30, 0.95);
  border: 1px solid #3a4149;
  border-radius: 8px;
  padding: 24px 28px;
}

#base-panel h1 {
  font-size: 20px;
  letter-spacing: 2px;
  color: #7fd8ff;
  margin-bottom: 16px;
  text-align: center;
}

#base-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: bold;
}

#base-funds {
  color: #e8c34a;
}

#base-parts {
  color: #5ad1c9;
}

#base-slots {
  color: #9aa4ad;
}

#test-mode-toggle {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: bold;
  color: #ff9e57;
  cursor: pointer;
  user-select: none;
}

#base-equipped-summary {
  color: #7fd8ff;
}

.base-hint {
  text-align: center;
  font-size: 12px;
  color: #6b7480;
  margin-bottom: 16px;
}

.base-section-title {
  font-size: 12px;
  letter-spacing: 2px;
  color: #6b7480;
  border-bottom: 1px solid #2a2f35;
  padding-bottom: 6px;
  margin-bottom: 10px;
  margin-top: 4px;
}

#base-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid #2a2f35;
}

.base-tab-btn {
  flex: 1;
  background: transparent;
  color: #6b7480;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
}

.base-tab-btn:hover {
  color: #9aa4ad;
}

.base-tab-btn.active {
  color: #7fd8ff;
  border-bottom-color: #7fd8ff;
}

.base-tab-panel.hidden {
  display: none;
}

#mission-list,
#ranking-mission-list,
#ranking-map-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

#ranking-sort-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.ranking-sort-btn {
  background: #22262b;
  color: #9aa4ad;
  border: 1px solid #3a4149;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
}

.ranking-sort-btn:hover {
  background: #2c3138;
}

.ranking-sort-btn.active {
  background: #1f3a4a;
  border-color: #3ea8ff;
  color: #7fd8ff;
}

.ranking-times {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #d8e0e6;
}

.ranking-times-empty {
  font-size: 12px;
  color: #6b7480;
  margin-bottom: 10px;
}

.ranking-times-row {
  display: flex;
  gap: 10px;
}

.ranking-times-rank {
  width: 20px;
  color: #f2d774;
  font-weight: bold;
}

.ranking-times-name {
  flex: 1;
  color: #9aa4ad;
}

.ranking-times-value {
  font-family: "Consolas", "Courier New", monospace;
  color: #d8e0e6;
}

.mission-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #2a2f35;
  border-left: 3px solid #7fd8ff;
  border-radius: 4px;
  padding: 12px 14px;
}

.mission-item.active {
  border-left-color: #4fd67a;
  background: rgba(79, 214, 122, 0.06);
}

.mission-item.locked {
  border-left-color: #4a4f55;
  opacity: 0.55;
}

.mission-accept-btn:disabled {
  background: #2a2f35;
  color: #6b7480;
  border-color: #4a4f55;
  cursor: not-allowed;
}

.mission-item-client {
  font-size: 11px;
  color: #9aa4ad;
  margin-bottom: 4px;
}

.mission-item-title {
  font-size: 15px;
  font-weight: bold;
  color: #7fd8ff;
  margin-bottom: 8px;
}

.mission-item-text {
  font-size: 12px;
  line-height: 1.6;
  color: #d8e0e6;
  margin-bottom: 10px;
}

.mission-item-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  font-weight: bold;
}

.mission-item-reward {
  color: #4fd67a;
}

.mission-item-penalty {
  color: #ff6b6b;
}

.mission-accept-btn {
  margin-left: auto;
  background: #1f5c3a;
  color: #d8ffe4;
  border: 1px solid #4fd67a;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.mission-accept-btn:hover {
  background: #26754a;
}

#base-slot-upgrades {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

#base-equipment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.base-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #2a2f35;
  border-radius: 6px;
  padding: 10px 14px;
}

.base-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.base-item-name {
  font-size: 14px;
  font-weight: bold;
  color: #d8e0e6;
}

.base-item-detail {
  font-size: 11px;
  color: #6b7480;
}

.base-item-action label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9aa4ad;
  cursor: pointer;
}

.base-item-action input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.base-item-action input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.base-unlock-btn {
  background: #2a4a3a;
  color: #4fd67a;
  border: 1px solid #4fd67a;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.base-unlock-btn:hover {
  background: #35624a;
}

.base-unlock-btn:disabled {
  background: #262a2f;
  color: #565d66;
  border-color: #3a4149;
  cursor: not-allowed;
}

.base-level-btn {
  margin-top: 6px;
  font-size: 11px;
  padding: 4px 10px;
}

.base-locked-note {
  font-size: 11px;
  color: #8a6a3a;
}

#base-start-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: #1f5c3a;
  color: #d8ffe4;
  border: 1px solid #4fd67a;
  border-radius: 6px;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
}

#base-start-btn:hover {
  background: #26754a;
}

#custom-map-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.custom-map-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #2a2f35;
  border-radius: 6px;
  padding: 8px 12px;
}

.custom-map-item-name {
  font-size: 13px;
  font-weight: bold;
  color: #d8e0e6;
}

.custom-map-item-actions {
  display: flex;
  gap: 6px;
}

.custom-map-btn {
  background: #22303a;
  color: #7fd8ff;
  border: 1px solid #3d6a80;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
}

.custom-map-btn:hover {
  background: #2c4250;
}

.custom-map-btn.danger {
  color: #ff9d9d;
  border-color: #7a3a3a;
  background: #2f2020;
}

.custom-map-btn.danger:hover {
  background: #402a2a;
}

#open-editor-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: #2a2f60;
  color: #c6b8ff;
  border: 1px solid #6d4fc9;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

#open-editor-btn:hover {
  background: #363c7a;
}

#editor-screen {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #12151a;
  z-index: 25;
}

#editor-screen.hidden {
  display: none;
}

#editor-panel {
  width: 700px;
  max-height: 580px;
  overflow-y: auto;
  background: rgba(20, 24, 30, 0.95);
  border: 1px solid #3a4149;
  border-radius: 8px;
  padding: 20px 24px;
}

#editor-panel h1 {
  font-size: 18px;
  letter-spacing: 2px;
  color: #c6b8ff;
  margin-bottom: 14px;
  text-align: center;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.editor-toolbar-label {
  font-size: 11px;
  color: #6b7480;
  margin-left: 4px;
}

.editor-toolbar-label:first-child {
  margin-left: 0;
}

.editor-tool-btn {
  background: #22262b;
  color: #d8e0e6;
  border: 1px solid #3a4149;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.editor-tool-btn:hover {
  background: #2c3138;
}

.editor-tool-btn.active {
  background: #3a2f60;
  border-color: #6d4fc9;
  color: #c6b8ff;
}

.editor-group-btn,
.editor-sensor-btn {
  background: #22262b;
  color: #9aa4ad;
  border: 1px solid #3a4149;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.editor-group-btn:hover,
.editor-sensor-btn:hover {
  background: #2c3138;
}

.editor-group-btn.active {
  background: #4a3a1f;
  border-color: #e8c34a;
  color: #f2d774;
}

.editor-sensor-btn.active {
  background: #1f3a4a;
  border-color: #3ea8ff;
  color: #7fd8ff;
}

#editor-orientation-btn,
#editor-confirm-route-btn {
  background: #22262b;
  color: #9aa4ad;
  border: 1px solid #3a4149;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-left: auto;
}

#editor-confirm-route-btn:hover,
#editor-orientation-btn:hover {
  background: #2c3138;
}

#editor-canvas {
  display: block;
  background: #1b1f24;
  border: 1px solid #3a4149;
  cursor: crosshair;
}

#editor-status {
  min-height: 16px;
  margin: 8px 0;
  color: #4fd67a;
}

#editor-save-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

#editor-map-name {
  flex: 1;
  background: #1b1f24;
  border: 1px solid #3a4149;
  border-radius: 4px;
  color: #d8e0e6;
  padding: 6px 8px;
  font-size: 13px;
}

#editor-save-btn,
#editor-clear-btn,
#editor-close-btn {
  background: #22262b;
  color: #d8e0e6;
  border: 1px solid #3a4149;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

#editor-save-btn {
  background: #1f5c3a;
  color: #d8ffe4;
  border-color: #4fd67a;
}

#editor-save-btn:hover {
  background: #26754a;
}

#editor-clear-btn:hover,
#editor-close-btn:hover {
  background: #2c3138;
}

#settings-hint {
  position: absolute;
  right: 12px;
  bottom: 170px;
  font-size: 11px;
  color: #6b7480;
  background: rgba(10, 12, 15, 0.6);
  padding: 3px 10px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 40;
  white-space: nowrap;
}

#lang-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 60;
}

.lang-btn {
  background: rgba(10, 12, 15, 0.75);
  color: #9aa4ad;
  border: 1px solid #3a4149;
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.lang-btn:hover {
  background: rgba(30, 34, 40, 0.85);
}

.lang-btn.active {
  background: #1f5c3a;
  border-color: #4fd67a;
  color: #d8ffe4;
}

#settings-screen {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(10, 12, 15, 0.85);
  z-index: 30;
}

#settings-screen.hidden {
  display: none;
}

#settings-panel {
  width: 720px;
  max-height: 560px;
  overflow-y: auto;
  background: rgba(20, 24, 30, 0.97);
  border: 1px solid #3a4149;
  border-radius: 8px;
  padding: 22px 26px;
}

#settings-panel h1 {
  font-size: 18px;
  letter-spacing: 2px;
  color: #7fd8ff;
  margin-bottom: 16px;
  text-align: center;
}

#difficulty-panel {
  border: 1px solid #2a2f35;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.02);
}

#difficulty-panel h3 {
  font-size: 13px;
  letter-spacing: 1px;
  color: #7fd8ff;
  margin-bottom: 8px;
}

#difficulty-select {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.difficulty-btn {
  flex: 1;
  background: #22262b;
  color: #9aa4ad;
  border: 1px solid #3a4149;
  border-radius: 4px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
}

.difficulty-btn:hover {
  background: #2c3138;
}

.difficulty-btn.active {
  background: #1f5c3a;
  border-color: #4fd67a;
  color: #d8ffe4;
}

.difficulty-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#difficulty-desc {
  margin-bottom: 0;
}

#settings-body {
  font-size: 12px;
  line-height: 1.7;
  color: #9aa4ad;
  margin-bottom: 18px;
}

#settings-body h3 {
  font-size: 13px;
  letter-spacing: 1px;
  color: #7fd8ff;
  border-bottom: 1px solid #2a2f35;
  padding-bottom: 4px;
  margin: 18px 0 8px;
}

#settings-body h3:first-child {
  margin-top: 0;
}

#settings-body p {
  margin-bottom: 6px;
}

#settings-body ul {
  margin: 0 0 6px 18px;
  padding: 0;
}

#settings-body li {
  margin-bottom: 3px;
}

#settings-footer-actions {
  display: flex;
  gap: 10px;
}

#settings-title-return-btn,
#settings-close-btn {
  display: block;
  flex: 1;
  padding: 10px;
  background: #22262b;
  color: #d8e0e6;
  border: 1px solid #3a4149;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

#settings-title-return-btn:hover,
#settings-close-btn:hover {
  background: #2c3138;
}

#title-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  background: rgba(10, 12, 15, 0.55);
  z-index: 20;
  pointer-events: none;
}

#title-overlay.hidden {
  display: none;
}

#title-logo {
  margin: 0;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 34px;
  letter-spacing: 4px;
  color: #4fd67a;
  text-shadow: 0 0 12px rgba(79, 214, 122, 0.7), 0 0 28px rgba(79, 214, 122, 0.35);
}

#title-prompt {
  margin: 0;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 16px;
  letter-spacing: 3px;
  color: #e8c34a;
  animation: titlePromptBlink 1s steps(1) infinite;
}

@keyframes titlePromptBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

#name-screen {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #12151a;
  z-index: 22;
}

#name-screen.hidden {
  display: none;
}

#name-panel,
#continue-panel {
  width: 360px;
  background: rgba(20, 24, 30, 0.95);
  border: 1px solid #3a4149;
  border-radius: 8px;
  padding: 28px 26px;
  text-align: center;
}

#continue-panel.hidden,
#name-panel.hidden {
  display: none;
}

#name-panel h1,
#continue-panel h1 {
  font-size: 18px;
  letter-spacing: 2px;
  color: #7fd8ff;
  margin-bottom: 12px;
}

#continue-summary {
  margin-bottom: 16px;
}

#name-input {
  display: block;
  width: 100%;
  background: #1b1f24;
  border: 1px solid #3a4149;
  border-radius: 4px;
  color: #d8e0e6;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 14px;
  text-align: center;
}

#name-confirm-btn,
#continue-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: #1f5c3a;
  color: #d8ffe4;
  border: 1px solid #4fd67a;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
}

#name-confirm-btn:hover,
#continue-btn:hover {
  background: #26754a;
}

#new-agent-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 10px;
  background: transparent;
  color: #9aa4ad;
  border: 1px solid #3a4149;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

#new-agent-btn:hover {
  background: #22262b;
  color: #d8e0e6;
}

#base-greeting {
  margin-top: -8px;
}

#bubble-container {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  z-index: 15;
}

.comic-bubble {
  position: relative;
  background: #fffbe8;
  color: #1a1a1a;
  border: 3px solid #1a1a1a;
  border-radius: 16px;
  padding: 7px 18px;
  font-family: "Comic Sans MS", "Segoe UI", sans-serif;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
  animation: bubble-pop 0.25s ease-out;
  white-space: nowrap;
}

.comic-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 28px;
  border-width: 10px 8px 0 0;
  border-style: solid;
  border-color: #1a1a1a transparent transparent transparent;
}

.comic-bubble::before {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 31px;
  border-width: 7px 6px 0 0;
  border-style: solid;
  border-color: #fffbe8 transparent transparent transparent;
  z-index: 1;
}

.comic-bubble.mood-success {
  border-color: #1f8a3a;
  color: #1f8a3a;
}

.comic-bubble.mood-success::after {
  border-color: #1f8a3a transparent transparent transparent;
}

.comic-bubble.mood-fail {
  border-color: #c62828;
  color: #c62828;
}

.comic-bubble.mood-fail::after {
  border-color: #c62828 transparent transparent transparent;
}

.comic-bubble.mood-warn {
  border-color: #c67c00;
  color: #c67c00;
}

.comic-bubble.mood-warn::after {
  border-color: #c67c00 transparent transparent transparent;
}

.comic-bubble.fade-out {
  animation: bubble-fade 0.4s ease-in forwards;
}

@keyframes bubble-pop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bubble-fade {
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.9);
  }
}
