:root {
  --lcd-page-bg:  #071003;
  --lcd-bg:       #4F7811;
  --lcd-line:     #E3F6C2;
  --lcd-muted:    #B5E08A;
  --snake-body:   #3CFF3C;
  --snake-head:   #F7FFDA;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Press Start 2P", "VT323", system-ui, sans-serif;
  background: var(--lcd-page-bg);
  color: var(--lcd-line);
  display: flex;
  flex-direction: column;
}

.screen {
  background: var(--lcd-bg);
  color: var(--lcd-line);
  padding: 16px;
  border-radius: 8px;
  border: 4px solid #1E2B08;
  box-shadow: 0 0 0 4px #020603;
  width: min(700px, 95vw);
  max-width: calc(100% - 8px);
  margin: 8px auto;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.title-block {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}

.snake-logo {
  display: none;
}

.screen-title .title-text {
  font-size: 18px;
  line-height: 1.3;
}

.screen-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  justify-content: center;
}

.screen-subtitle {
  display: none;
}

.screen-button {
  background: transparent;
  border: 2px solid #1E2B08;
  padding: 6px 10px;
  font: inherit;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--lcd-line);
}

.screen-separator {
  border: none;
  border-top: 1px solid var(--lcd-line);
  margin: 12px 0;
  opacity: 0.6;
}

.screen-quote {
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 8px;
  text-transform: none;
  min-height: 42px;
}

#map-container {
  border: 2px solid #1E2B08;
  background: var(--lcd-bg);
  padding: 4px;
  margin-top: 8px;
  max-width: 960px;
  position: relative;
}

#map {
  width: 100%;
  height: 320px;
  border: 2px solid #1E2B08;
}

.screen-status {
  margin-top: 8px;
  font-size: 10px;
  color: var(--lcd-muted);
}

.screen-build {
  margin-top: 4px;
  font-size: 10px;
  color: var(--lcd-muted);
  line-height: 1.4;
  display: flex;
  gap: 8px;
  align-items: center;
}

.change-btn {
  margin-left: 8px;
  border: 2px solid #1E2B08;
  background: transparent;
  color: var(--lcd-line);
  padding: 4px 7px;
  border-radius: 0;
  cursor: pointer;
  font-size: 10px;
}
.change-btn:hover {
  background: rgba(0,0,0,0.08);
}

.city-picker { display: none; }
footer.build { display: none; }

@media (max-width: 768px) {
  .screen {
    padding: 12px;
    margin: 8px auto;
    width: min(700px, 96vw);
  }
  .screen-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .title-block {
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
  }
  .screen-title .title-text { font-size: 15px; }
  .screen-subtitle { font-size: 8px; }
  .change-btn { font-size: 9px; padding: 3px 6px; }
  #map { height: 60vh; min-height: 260px; }
  .screen-quote { font-size: 10px; line-height: 1.6; }
  .screen-status { font-size: 9px; }
  .screen-build { font-size: 9px; }
}

/* City panel (conserve fonctionnalités) */
.city-panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  pointer-events: none;
}
.city-panel.hidden { display: none; }
.panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: all;
}
.panel {
  position: relative;
  margin: 16px;
  width: min(360px, 90vw);
  background: var(--lcd-bg);
  border: 1px solid var(--lcd-line);
  border-radius: 12px;
  padding: 12px;
  z-index: 2;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  pointer-events: all;
  color: var(--lcd-line);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.panel-header h2 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
}
.close-btn {
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: var(--lcd-line);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
}
.panel input#citySearch {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--lcd-line);
  background: rgba(255, 255, 255, 0.1);
  color: var(--lcd-line);
  margin-bottom: 10px;
  font-family: inherit;
}
.panel-section { margin-bottom: 10px; }
.panel-title {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lcd-line);
  margin-bottom: 6px;
}
.panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--lcd-line);
  border-radius: 10px;
}
.panel li {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
}
.panel li:last-child { border-bottom: none; }
.panel li:hover { background: rgba(0, 0, 0, 0.08); }

#custom-attrib {
  position: absolute;
  bottom: 4px;
  right: 4px;
  color: #0A1F0A;
  font-family: "Press Start 2P", "VT323", system-ui, sans-serif;
  font-size: 6px;
  line-height: 1.2;
  pointer-events: none;
}
#talk-button {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: #4F7811;
  color: var(--lcd-line);
  border: 2px solid #0A1F0A;
  border-radius: 0;
  padding: 3px 6px;
  font-family: "Press Start 2P", "VT323", system-ui, sans-serif;
  font-size: 9px;
  cursor: pointer;
}
#talk-button:hover { background: #3d5e0d; }

.mapboxgl-ctrl-logo,
.mapboxgl-ctrl-attrib,
.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.modal-card {
  position: relative;
  background: var(--lcd-bg);
  border: 3px solid #1E2B08;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  padding: 16px;
  width: min(400px, 90vw);
  z-index: 21;
  color: var(--lcd-line);
  text-transform: uppercase;
  font-size: 10px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.modal-header h3 {
  margin: 0;
  font-size: 14px;
}
.modal form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal input,
.modal textarea {
  padding: 8px;
  border: 1px solid #1E2B08;
  background: rgba(255,255,255,0.08);
  color: var(--lcd-line);
  font-family: inherit;
  text-transform: none;
}
.modal textarea { resize: vertical; }
.modal-note {
  font-size: 9px;
  color: var(--lcd-muted);
  margin: 0;
}
