:root {
  --bg: #0e141b;
  --panel: #111b25;
  --accent: #48c78e;
  --text: #e6f1ff;
  --muted: #9bb0c7;
  --border: #1f2a36;
  --danger: #ff6b6b;
  --warn: #ffbf69;
}

* {
  box-sizing: border-box;
}

#rotate-guidance {
  display: none; /* Hidden by default in landscape */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  color: white;
  text-align: center;
  padding-top: 50px;
  z-index: 800;
}

@media screen and (orientation: portrait) {
  #rotate-guidance {
    display: block; /* Shown only in portrait mode */
  }
}

html, body {
  max-width: 750px;
  width: 750px;
  max-height: 750px;
  height: 750px;  
  font-size: 8pt;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #0b1016, #0f1a23);
  color: var(--text);
}

.app {
  max-width: 756px;
  min-width: 756px;
  width: 756px;
  margin: 0 auto;
  padding: 0px 2px 0px 2px;
  margin: 0px 2px 0px 2px;
}

.bar {
  min-width: 756px;  
  width: 756px;  
  /* position: fixed; */
  top: 0;
/*   left: 0; 
  right: 0; */
  display: flex;
  /* justify-content: space-between; */
  align-items: center;
  gap: 8px;
  padding: 0px 2px 0px 2px;
  margin: 0px 2px 0px 2px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
#title-bar {
  display: inline;
  min-width: 280px;
  max-width: 280px;
  width: 280px;
  justify-content: center;
  justify-items: center;
}
#points {
  min-width: auto;
  margin-left: 6px;
  margin-right: 6px;
  justify-self: center;
  justify-items: center;
  text-align: center;
}
.game-title, .game-title.sub {
  display: inline;
}
.game-title.sub {
  margin-left: 4px;
}

h1 {
  margin: 0;
  letter-spacing: 0.5px;
}

.sub {
  margin: 4px 0 0;
  color: var(--muted);
}

.meta {
  min-width: 370px;
  max-width: 370px;
  width: 370px;
  display: flex;
/*   min-width: 170px;
  max-width: 170px;
  width: 170px;  */ 
  /* justify-content: flex-end; */  
  text-align: left;
  font-weight: 600;
  background-color: #1d3042;
  border-radius: 4px;
  padding: 2px 6px;
  gap: 6px;
}
.left-meta {
  width:120px;
}
.right-meta {
  width:230px;
  min-width: 230px;
}  
#time, #biome {
  font-size: 8pt;
  min-width: 80px;
  max-width: 100px;
  width: 100px;
}
#weather {
  font-size: 8pt;
  min-width: 150px;
  max-width: 150px;
  width: 150px;
  text-align: left;
}
.indicators {
  font-size: 8pt;
  display: flex;
  gap: 8px;
  align-items: center;
}
.indicators span {
  min-width: 40px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.indicator-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}
.torch-lit {
  color: #ff9500;
  font-weight: bold;
}

#main-container {
  position:relative;
  padding: 0px 2px 0px 2px;
  margin: 0px 2px 0px 2px;  
} 

.layout {
  display: grid;
  grid-template-columns: 1fr;
}
#top-buttons {
  display: grid;  
  justify-content: right;
  align-items: right;
  align-content: right;
  direction: row;
  gap: 5px;
}
.top, .bottom {
  display: flex;
  min-width: 720px;
  max-width: 720px;
  width: 720px;
  gap: 2px;
}
/* .top {  
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
} */

.right {
  min-width: 310px;
  max-width: 310px;
  width: 310px;
  display: flex;
  flex-direction: column;
}

.right-top {
  padding: 2px;
}

.right-bottom {
  flex: 1;  
  display: flex;
  flex-direction: column;
}

.panel, #latest {
  padding: 2px 6px 2px 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.panel.stats {
  min-width: 110px;
  max-width: 110px;
  width: 110px;
  min-height: 53px;
  max-height: 53px;
  height: 53px;
}
.stats p {
  margin: 4px 0;
}

.invToolsButtons-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 40px;
  max-width: 40px;
  width: 40px;
}

.invToolsButtons-grid > div {
  font-size: 24px;
  cursor: pointer;
  text-align: center;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.invToolsButtons-grid > div:hover {
  background-color: rgba(72, 199, 142, 0.1);
  transform: scale(1.1);
}

#left-top {
  background: var(--panel);  
  border: 1px solid var(--border);
  border-radius: 10px;    
}
#latest, .recipe-summary {  
  margin-bottom: 4px;
  padding: 0px 6px 0px 6px;
  border-radius: 5px;
  word-wrap: normal;
  background-color: #23642f;
  color: var(--warn);    
}
#latest {
  font-size: 10pt;
  margin-top: 6px;
  min-width: 160px;
  max-width: 160px;
  width: 160px;
  min-height: 164px;
  max-height:164px;
  height: 164px;
}
#warning-top, #warning-bottom {
  margin: 1px 0px;
  padding: 2px 6px;
  min-height: 26px;
  max-height: 26px;
  height: 26px;
  background-color: #10381a;
  color: #34ce57;
  border-radius: 5px;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Warning message styles */
#warning-top.warning-message,
#warning-bottom.warning-message {
  background-color: #3a3a1a;
  color: var(--warn);
}

#warning-top.danger-message,
#warning-bottom.danger-message {
  background-color: #3a1a1a;
  color: var(--danger);
}

#warning-top.temp-warning,
#warning-bottom.temp-warning {
  background-color: #2a2a3a;
  color: #87ceeb;
}

#warning-top.fatigue-warning,
#warning-bottom.fatigue-warning {
  background-color: #2a3a2a;
  color: #9acd32;
}

#warning-top.critical-warning,
#warning-bottom.critical-warning {
  background-color: #4a1a1a;
  color: #ff4444;
}

#warning-top.predator-warning,
#warning-bottom.predator-warning {
  background-color: #3a1a2a;
  color: #ff6b9d;
}

#warning-top.lightning-warning,
#warning-bottom.lightning-warning {
  background-color: #1a2a3a;
  color: #7eb8ff;
}

/* Warning animations */
.warning-blink {
  animation: warning-blink-anim 0.8s ease-in-out 2;
}

@keyframes warning-blink-anim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.danger-pulse {
  animation: danger-pulse-anim 1s ease-in-out infinite;
}

@keyframes danger-pulse-anim {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.02);
  }
}
.recipe-summary {
  margin-top: 4px;
  height: 28px;
  width: 260px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  min-height: 20px;
  margin-left: 3px;
}  
}

td.move {
  text-transform: capitalize;
  padding: 0px;
  border-radius: 4px;
  border: 0;
  align-items: center;
  align-content: center;
  justify-content: center;
  justify-items: center;
  justify-self: center;
  text-align: center;
}

.status-grid {
  font-size: 7pt;
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-template-columns: repeat(2, auto);
  grid-auto-flow: column;
  gap: 4px;
  row-gap: 2px;
  padding: 2px;
  background-color: #0a1118;
  border-radius: 4px;
}

.status-grid > div.col {
  display: flex;
  padding: 1px 3px;
  background-color: #1f3952;
  width: auto;
  min-width: 70px;
}

.status-grid .label {
  flex-shrink: 0;
  font-weight: bold;
  text-align: left;
  white-space: nowrap;
  margin-right: 4px;
}

.status-grid .value {
  flex-shrink: 0;
  font-weight: normal;
  text-align: right;
}

/* Legacy span.label and span.value for other contexts */
span.label {
  font-weight: bold;
  margin-right: 4px;
  white-space: nowrap;
  width: 40px;
  display: inline-block;
}
span.value {
  font-weight: normal;
  min-width: 15px;
  max-width: 15px;
  width: 15px;
  text-align: left;
  display: inline-block;
}

/* #tool-icon, #inventory-icon, #permanentTool-icon, #settings-icon  { */
.button-icon {
  min-width: 28px;
  
  width: 28px;  
  text-align: right;
  font-weight:bolder;  
  border-radius: 2px;
  padding: 1px;
  font-size: 16pt;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
}
#tool-icon {
  margin-right:8px;
}

div.tools-icon:hover {
  background-color: #85b8f2;
  cursor: pointer;
}


.tools-grid, .inventory-grid{ 
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  margin-top: 8px;
}

.tools-grid {
  grid-template-rows: repeat(auto-fill, min-content);
}
.inventory-panel {
  display: block;
}

.permanent-tools-panel {
  margin-top: 16px;
}

.permanent-tools-panel h3 {
  margin: 0 0 8px 0;
  font-size: 11pt;
}

.permanent-tools-grid {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 8px;
  padding: 8px;
  background-color: #0a1118;
  border-radius: 4px;
  font-size: 8pt;
}

.permanent-tools-grid div {
  text-align: center;
  padding: 4px;
}

.consumable-tools-panel {
  margin: 0;
  padding: 2px;
  max-width: 300px;
  width: 300px;  
}

.consumable-tools-grid {
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: column;
  gap: 2px;
  padding: 2px;
  background-color: #0a1118;
  border-radius: 4px;
  font-size: 8pt;
  margin-bottom: 2px;  
}

.consumable-tools-grid div {
  display: flex;
  padding: 1px 2px;
}

.consumable-tools-grid .tool-label {
  width: 60px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.consumable-tools-grid .tool-value {
  width: 20px;
  text-align: right;
}

.consumable-tools-grid .col {
  background-color: #1f3952;
}
.consumable-tools-grid .col-1 {
  max-width: 48px;
}
.consumable-tools-grid .col-1 .tool-label { width: 43px; }
.consumable-tools-grid .col-2 .tool-label { width: 60px; }
.consumable-tools-grid .col-2 {
  margin-left: -16px;
  max-width: 80px;
}
.consumable-tools-grid .col-3 .tool-label { width: 45px; }
.consumable-tools-grid .col-3 {
  margin-left: 0px;
  max-width: 64px;
}
.consumable-tools-grid .col-4 .tool-label { width: 60px; }

.consumable-tools-grid .col-1 .tool-value { width: 15px; }
.consumable-tools-grid .col-2 .tool-value { width: 15px; }
.consumable-tools-grid .col-3 .tool-value { width: 15px; }
.consumable-tools-grid .col-4 .tool-value { width: 15px; }




.settings-panel {
  display: block;
}

/* ADDED: 2026-01-16 - Audio controls with volume sliders */
.audio-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background-color: #0a1118;
  border-radius: 4px;
  margin-bottom: 8px;
}

.audio-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-toggle {
  width: 80px;
  flex-shrink: 0;
}

.audio-toggle.off {
  background-color: #444;
  color: #888;
}

.volume-slider {
  flex: 1;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: #1a2633;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.volume-slider:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.volume-slider:disabled::-webkit-slider-thumb {
  background: #666;
}

.settings-buttons-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 8px;
  padding: 8px;
  background-color: #0a1118;
  border-radius: 4px;
}

.settings-button {
  width: 120px;
  padding: 5px 6px;
  background-color: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  font-size: 9pt;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-button:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.settings-button:active {
  opacity: 0.7;
}

.debug-weather-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  /* gap: 6px; */
  margin-top: -8px;
  padding: 8px;
  background-color: #0a1118;
  border-radius: 4px;
  max-width: 135px;
  width: 135px;  
}

.debug-button {
  padding: 4px 2px;
  background-color: #444;
  color: #fff;
  border: 1px solid #666;
  border-radius: 3px;
  font-size: 8pt;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 30px;
  width: 20px;
}

.debug-button:hover {
  background-color: #555;
  opacity: 0.9;
}

.debug-button:active {
  opacity: 0.7;
}

/* ----------------------------------------------------------------------------
 * SECTION: Debug Lightning Grid
 * PURPOSE: 4-column grid for lightning warning levels (30/60/90) + strike
 * ADDED: 2026-01-14 17:30
 * ---------------------------------------------------------------------------- */
.debug-lightning-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 4px;
  padding: 8px;
  background-color: #0a0a1a;
  border-radius: 4px;
  border: 1px solid #446;
}

/* ----------------------------------------------------------------------------
 * SECTION: Debug Danger Grid
 * PURPOSE: Grid for predator warnings and attacks (6 buttons, 3 per row)
 * MODIFIED: 2026-01-14 17:30 - Changed from 7-col to 3-col, removed fixed width
 * ---------------------------------------------------------------------------- */
.debug-danger-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 4px;
  padding: 8px;
  background-color: #1a0a0a;
  border-radius: 4px;
  border: 1px solid #400;
}

.debug-button.warning {
  background-color: #554400;
  border-color: #886600;
}

.debug-button.warning:hover {
  background-color: #776600;
}

.debug-button.danger {
  background-color: #600;
  border-color: #900;
}

.debug-button.danger:hover {
  background-color: #800;
}

.panel.actions {
  gap:0px;
  padding: 3px 0px 3px 0px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#actions {
  display: block;  
  gap: 5px;
}

#action-buttons{
  min-width: 290px;
  max-width: 346px;
  width: 346px;
  flex-wrap: wrap;
  display: flex;
  /* Creates 2 rows, with content flowing into the next column */
  grid-template-rows: repeat(2, min-content);
  /* Flows items into columns first, then wraps to new columns */
  grid-auto-flow: row;
  /* Sets the width of each column to be equal */
  grid-template-columns: repeat(7, 36px);
  /* Optional: Adds space between the items */
  gap: 2px;
}
/* button.action { */
.action {
  background: #1d3042;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%;
  min-width: 50px;
  max-width: 55px;
  width: 55px;
  min-height: 30px;
  max-height: 30px;
  height: 30px;
  padding: 0px 0px;
  cursor: pointer;
  font-size: 12pt;
  line-height: 1.2;
  transition: transform 0.05s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
button.action.narrow {
  margin-left: 6px;

}
.eat-button.action, .forage-button.action {
  font-size: 9pt;
}

button.action.extra-wide {
  min-width: 60px;
  max-width: 60px;
  width: 60px;  
}

button.action.wide {
  min-width: 53px;
  max-width: 53px;
  width: 53px;  
}

button.action.narrow {
  min-width: 45px;
  max-width: 45px;
  width: 45px;  
}

button.action:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(72, 199, 142, 0.25);
}

button.action:active:not(:disabled) {
  transform: translateY(1px);
}

button.action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.move-controls {
  display: block;
}

.move.action {
  min-width: 50px;
  max-width: 50px;
  width: 50px;  
  min-height: 50px;
  max-height: 50px;
  height: 50px;
  text-align: center;
  padding: 2px;;
}

.make {
  display: flex;
  /* flex-direction: column; */
  /* gap: 8px; */
  /* justify-content: end; */
  margin-top: 2px;
  margin-bottom: 1px;
}

.make-controls {
  display: flex;
/*   grid-template-columns: 1fr auto; */
  gap: 2px;
  align-items: center;
  height: 34px;
  background-color: #223e5a;
  padding-left: 3px;
  padding-right: 3px;
  border-radius: 5px;
  margin-left: 4px;
}
.make-select, #make-select, .make-select > option {
 font-size: 7pt;
 max-width: 80px;
 min-width: 40px;
 width: 60px;
}
.make-select, .make-button.action {
  max-height: 30px;
  height: 30px;
}

.make select {
  font-size: 12px;
  background: #152433;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}

.recipe-hint {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

button.forage-button.action, .make-button.action {
  font-size: 9pt;
  min-width: 30px;
  max-width: 30px;
  width: 30px;
  height: 30px;
}
.eat-control, .forage-control, .axe-control, .snare-control, .hunt-control, .fish-control, .fire-control, .water-control {
  display: flex;
  /* Defines two columns: 1 part for the first, 1 part for the second */
  grid-template-columns: 1fr 1fr;
  /* Optional: adds space between the columns */
  column-gap: 2px;
  flex-direction: row;
  /* Aligns items vertically centered */
  gap: 2px;
  flex-wrap: wrap;
  align-items: center;
  margin-left: 6px;
  border-radius: 4px;
  background-color: #244c72;
  padding-left: 4px;
  padding-right: 4px;
  max-height: 34px;
  min-height: 34px;
  height: 34px;  
}
button.forage-button.action, button.eat-button.action, .hunt-button.action, .axe-button.action, .snare-button.action, .fish-button.action {
  font-size:11pt;
  max-height: 30px;
  min-height: 30px;
  height: 30px;
}

.fish-button.action, .hunt-button.action { 
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11pt;  
  max-width: 45px;
  min-width: 45px;
  width: 45px;
}
.fish-button.action > span, .hunt-button.action > span { 
  font-size: 9pt;
}

.axe-button.action {
  font-size: 14pt;
  max-width: 30px;
  min-width: 30px;
  width: 30px;  
}

.fire-control, .water-control {
  justify-content: center;
  padding-left: 2px;
  padding-right: 2px;
}
.fire-control {
  width: 46px;
}
.water-control {
  width: 62px;
}

.eat-control select, .hunt-control select, .axe-control select, #axe-select, .snare-control select, #snare-select, .fish-control select, #forage-select, #fish-select {
  font-size: 7pt;
  background: #152433;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0px;
  height: 30px;
}
#fish-select {
  max-width: 55px;
  width:55px;
}
#fire-select {
  max-width: 40px;
  width:40px;
}
#eat-select {
  max-width: 40px;
  width:40px;
}
#hunt-select {
  max-width: 75px;
  width:75px;
}

#axe-select {
  min-width: 55px;
  width:55px;
}

#snare-select {
  width: 55px;
}

#forage-select {
  max-width: 65px;
  width: 65px;
}

/* Fire and Water selects - standalone dropdowns, no buttons */
.fire-select, .water-select {
  font-size: 7pt;
  background: #152433;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  height: 30px;
}
.water-select {
  min-width: 56px;
  width: 56px;
}

.panel.log {
  display:none;
}
.log {
  height: 200px;
  overflow-y: auto;
  font-size: 11px;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}

/* .panel.map-wrap {
  min-width: 250px;
  max-width: 400px;
  width: 400px;  
} */
.map-wrap {
  display: flex;
  flex-direction: column;
  gap: 0px;
  border-radius: 6px;
  padding: 5px;
  position: relative; /* For game over popup positioning */
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.map {
  display: grid;
  grid-template-columns: repeat(var(--map-cols, 5), 25px);
  grid-template-rows: repeat(var(--map-rows, 5), 25px);
  gap: 0px;
}

.tile {
  font-size: 12pt;
  /* border-radius: 8px; */
  padding: 0px;;
  text-align: center;
  justify-content: center;
  border: 1px solid var(--border);
  min-width: 25px;
  max-width: 25px;
  width: 25px;
  min-height: 25px;
  max-height: 25px;
  height: 25px; 
  text-transform: capitalize;
}
.tile:hover {
  /* border-color: var(--accent); */
  box-shadow: 0 6px 16px rgba(72, 199, 142, 0.25);
  cursor:not-allowed;
}

.tile.explored {
  background: #162535;
  color: var(--text);
}


.tile.current {
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 6px 16px rgba(72, 199, 142, 0.35);
  animation: tile-pulse 1.5s ease-in-out infinite;
}

/* Continuous pulse animation for current tile */
@keyframes tile-pulse {
  0%, 100% { border-color: var(--accent); box-shadow: 0 6px 16px rgba(72, 199, 142, 0.35); }
  50% { border-color: #fff; box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); }
}

/* Death state - red border and overlay */
.tile.current.dead {
  animation: none;
  border-color: #ff4444;
  border-width: 3px;
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.7);
  position: relative;
}

.tile.current.dead::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 0, 0, 0.3);
  pointer-events: none;
}

/* Tile icons (shelter, fire) */
.tile-icons {
  display: block;
  font-size: 8pt;
  line-height: 1;
  position: absolute;
  top: 1px;
  right: 1px;
}

.tile-biome {
  display: block;
  font-size: 10pt;
}

/* Tile icon images (for biomes with iconImage) */
.tile-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
  display: block;
}

.tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tile.camp {
  border-radius: 3px;
  background: #23642f;
  color: #d4edda;
  border-color: #ffbf69;
}
.tile.forest {
  background: #317e3b;
  color: #a8d5a2;
}
.tile.mountain {
  background: #5a5a5a;
  color: #d1d1d1;
}
.tile.river {
  /*background: #3676bb;*/
  background: black;
}
.tile.lake {
  /*background: #2e5f99;*/
  background: black;
  color: #d1e7f5;
}
.tile.plain {
  background: #8bb164;
  color: #e2f0d9;
}
.tile.desert {
  background: #d2b98b;
  color: #5b3d1b;
}
.tile.swamp {
  background: #4a6b42;
  color: #c1d6b8;
}
.tile.tundra {
  background: #d4dce0;
  color: #2e3b44;
}
.tile.hills {
  /* background: #8b7d6b; */
  background: #5a5a5a;
  color: #f0e8dc;
}
.tile.coast {
  background: #449fd8;
  color: #e1f0fb;
}
.tile.unexplored {
  background: #0c1118;
  color: #b6b8b9;
}



#biome {
  color: var(--accent);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .left {
    grid-template-rows: auto;
  }
  .log {
    max-height: 160px;
  }
}

.game-buttons {
    padding: 2px 8px;
    font-size: 11px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#forceRefreshBtn-icon {
  font-size: 14pt;
  padding:0px;
  background-color: white;
    border: none;
    border-radius: 0;  
  color: black;
  margin: 0px;
  gap: 0px;
}
#forceRefreshBtn-icon {
  background-color: white;
}
#newGameBtn {
  background-color: #f8f5f5;
}
/* #debugClearBtn {
  background-color: #f0ad4e;
} */

#showInventoryBtn {
  background-color: #6c757d;
}
#debugClearBtn:hover, #newGameBtn:hover, #showLogBtn:hover, #showInventoryBtn:hover, #goFS:hover {
  opacity: 0.8;
}

/* Popup Styles */
.popup {
  position: fixed;
  top: 0;
  left: 0px;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 50px 10px 10px 160px;
  /* Prevent background scrolling when popup is open */
  overscroll-behavior: contain;
  touch-action: none;
}

.popup-content {
  background-color: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 8px;
  min-width: 300px;
  max-width: 95vw;
  width: 400px;
  min-height: 200px;
  max-height: 200px;
  height: 200px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  /* Allow touch scrolling inside popup content */
  touch-action: auto;
}
/* MODIFIED: 2026-01-14 17:30 - Widened settings popup from 155px to 220px to fit debug grids */
.popup-content.settings {
  min-width: 220px;
  max-width: 220px;
  width: 220px;
  min-height: 320px;
  max-height: 400px;
  height: auto;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* padding: 6px 8px; */
  border-bottom: 1px solid var(--border);
  background-color: rgba(72, 199, 142, 0.1);
}

.popup-header h2 {
  flex: 1;
  text-align: center;
  margin-left: 0;  /* Remove this offset */
  color: var(--accent);
  font-size: 16px;
}

.close-popup {
  background: none;
  border: none;
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-popup:hover {
  color: var(--accent);
}

.popup-body {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  /* Fix mobile scrolling - prevent scroll from propagating to body */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* Log popup specific */
#logPopupContent {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

/* Inventory popup specific */
.popup-tools-grid,
.popup-inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.popup-body .tools-panel h3,
.popup-body .inventory-panel h3 {
    padding-top: 0px;
    margin-top: 0px;
    height: 5px;
    line-height: 0px;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 14px;
}
#inventory-bar {
  margin-left: 20px;
}

.popup-body .tools-panel:first-child h3 {
  margin-top: 0;
}

#settingsDropdown, #toolsDropdown {
  display: block;
  position: fixed;
  top: 50px;
  right: 10px;
  z-index: 1500;
  background-color: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  min-width: 200px;
}

/* Blink animation for status messages */
@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0.3; }
}

.blink-message {
  animation: blink 0.6s ease-in-out;
}


/* Warning colors for critical stats */
.stat-warning {
  color: var(--warn) !important;
  font-weight: bold;
}

.stat-critical {
  color: var(--danger) !important;
  font-weight: bold;
}

/* Dropdown Styles */
.dropdown {
  position: fixed;
  top: 50px;
  right: 10px;
  z-index: 1500;
  background-color: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  min-width: 200px;
  max-width: 300px;
}

.dropdown-content {
  padding: 0;
}

.dropdown-body {
  padding: 12px;
}

.tools-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tools-panel h3 {
  margin: 0 0 8px 0;
  color: var(--accent);
  font-size: 12pt;
}

.dropdown-tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  font-size: 7pt;
}

.dropdown-tools-grid > div {
  padding: 4px;
  background-color: rgba(72, 199, 142, 0.05);
  border-radius: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dropdown-tools-grid > div .label {
  font-weight: bold;
  margin-right: 8px;
}

.dropdown-tools-grid > div .value {
  font-weight: normal;
}

/* Biome Tooltip */
.biome-tooltip {
  background-color: var(--panel);
  color: var(--accent);
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 9pt;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  white-space: nowrap;
  text-transform: capitalize;
}

/* Make Icon Grid */
.make-icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px;
  background-color: #1a2a3a;
  border-radius: 5px;
  width: 100%;
  justify-content: flex-start;
  width:350px;
  min-width: 350px;
}

.make-icon-btn {
  width: 40px;
  height: 40px;
  font-size: 24pt;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: #1d3042;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.make-icon-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(72, 199, 142, 0.3);
  transform: scale(1.05);
}

.make-icon-btn.selected {
  border-color: var(--accent);
  background: rgba(72, 199, 142, 0.2);
  box-shadow: 0 0 8px rgba(72, 199, 142, 0.5);
}

.make-icon-btn.disabled {
  opacity: 0.4;
  cursor: pointer; /* Still clickable to show tooltip */
}

.make-icon-btn.disabled:hover {
  border-color: var(--warn);
  box-shadow: 0 2px 8px rgba(255, 191, 105, 0.3);
}

/* Color coding for make icons - item states */
.make-icon-btn.have-item {
  background: #1a5a2a; /* Green - have the item */
  border-color: #28a745;
}

.make-icon-btn.have-item:hover {
  background: #22732f;
  border-color: #34ce57;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.make-icon-btn.can-build {
  background: #1a3d5c; /* Blue - can build */
  border-color: #3498db;
}

.make-icon-btn.can-build:hover {
  background: #224d73;
  border-color: #5dade2;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.make-icon-btn.cant-build {
  background: #3a1a1a; /* Red/dark - can't build */
  border-color: #8b3a3a;
  opacity: 0.6;
}

.make-icon-btn.cant-build:hover {
  border-color: #c0392b;
  box-shadow: 0 2px 8px rgba(192, 57, 43, 0.3);
}

/* Count badge for consumable items */
.make-icon-btn .count-badge {
  position: absolute;
  bottom: 1px;
  right: 1px;
  font-size: 7pt;
  font-weight: bold;
  min-width: 12px;
  height: 12px;
  line-height: 12px;
  text-align: center;
  border-radius: 3px;
  color: #fff;
  background: #333;
  padding: 0 2px;
}

.make-icon-btn.have-item .count-badge {
  background: #28a745;
}

.make-icon-btn.can-build .count-badge {
  background: #3498db;
}

.make-icon-btn.cant-build .count-badge {
  background: #8b3a3a;
}

/* Make icon button needs position relative for count badge */
.make-icon-btn {
  position: relative;
}

.make-icon-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Make Tooltip */
.make-tooltip {
  background-color: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  font-size: 9pt;
  min-width: 140px;
  max-width: 200px;
}

.make-tooltip .tooltip-title {
  font-weight: bold;
  color: var(--accent);
  font-size: 11pt;
  margin-bottom: 6px;
  text-transform: capitalize;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.make-tooltip .tooltip-ingredients {
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 6px;
}

.make-tooltip em {
  color: var(--muted);
  font-size: 8pt;
}

.make-tooltip .tooltip-status {
  margin-top: 6px;
  font-weight: bold;
}

.make-tooltip .tooltip-status .ready {
  color: var(--accent);
}

.make-tooltip .tooltip-status .not-ready {
  color: var(--warn);
}

/* ============================================================================
   INVENTORY ICON GRID
   ============================================================================ */
/* Popup inventory can be wider */
.inv-icon-grid {
  max-width: 400px;
}

.inv-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.inv-icon-btn .inv-icon {
  font-size: 24pt;
  line-height: 1;
}

.inv-icon-btn .count-badge {
  position: absolute;
  bottom: 1px;
  right: 1px;
  font-size: 7pt;
  font-weight: bold;
  min-width: 12px;
  height: 12px;
  line-height: 12px;
  text-align: center;
  border-radius: 3px;
  color: #fff;
  background: #333;
  padding: 0 2px;
}

/* Has items - green */
.inv-icon-btn.has-item {
  background: #1a5a2a;
  border-color: #28a745;
}

.inv-icon-btn.has-item .count-badge {
  background: #28a745;
}

.inv-icon-btn.has-item:hover {
  background: #22732f;
  border-color: #34ce57;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

/* No items - dark/muted */
.inv-icon-btn.no-item {
  background: #2a2a3a;
  border-color: #555;
  opacity: 0.5;
}

.inv-icon-btn.no-item .count-badge {
  background: #555;
}

.inv-icon-btn.no-item:hover {
  opacity: 0.8;
  border-color: #777;
}

/* Inventory icon images */
.inv-icon-btn img.inv-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Visible Inventory Grid (always visible, configurable items) */
.visible-inventory-panel {
  margin: 0;
  padding: 0px 2px 0px 2px;
  margin: 0px 2px 0px 2px;
}
.visible-inventory-grid {
  font-size: 8pt;
}
.visible-inventory-grid,
.inv-icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  background-color: #1a2a3a;
  border-radius: 4px;
}


.visible-inventory-grid .inv-item {
  display: flex;
  padding: 1px 4px;
  justify-content: space-between;
}

.visible-inventory-grid .label {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visible-inventory-grid .value {
  text-align: right;
  flex-shrink: 0;
  min-width: 20px;
}

/* Per-column widths */
.visible-inventory-grid .col-1 { width: 70px; }
.visible-inventory-grid .col-2 { width: 75px; }
.visible-inventory-grid .col-3 { width: 100px; margin-right: 10px; }
.visible-inventory-grid .col-4 { width: 75px; }

/* Per-column label widths */
.visible-inventory-grid .col-1 .label { width: 45px; }
.visible-inventory-grid .col-2 .label { width: 45px; }
.visible-inventory-grid .col-3 .label { width: 65px; }
.visible-inventory-grid .col-4 .label { width: 45px; }

/* All Columns */
.visible-inventory-grid [class*="col-"] { background-color: #223e5a; }

.inventory-panel {
  margin-left: -10px;
}
#inventory-bar {
  font-size: 8pt;
  display: grid;
  grid-template-rows: repeat(5, auto);
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: column;
  gap: 2px;
  margin-top: 8px;
  padding: 6px;
  background-color: #0a1118;
  border-radius: 4px;
}

#inventory-bar .inv-item {
  display: flex;
  padding: 1px 4px;
  justify-content: space-between;
}

#inventory-bar .label {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#inventory-bar .value {
  text-align: right;
  flex-shrink: 0;
  min-width: 20px;
}

/* Per-column widths */
#inventory-bar .col-1 { width: 70px; }
#inventory-bar .col-2 { width: 75px; }
#inventory-bar .col-3 { width: 100px; margin-right: 10px; }
#inventory-bar .col-4 { width: 75px; }

/* Per-column label widths */
#inventory-bar .col-1 .label { width: 45px; }
#inventory-bar .col-2 .label { width: 45px; }
#inventory-bar .col-3 .label { width: 65px; }
#inventory-bar .col-4 .label { width: 45px; }

/* All Columns */
#inventory-bar [class*="col-"] { background-color: #223e5a; } 




/* ============================================================================
   INVENTORY TOOLTIP
   ============================================================================ */

.inv-tooltip {
  position: fixed;
  z-index: 1000;
  background-color: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  font-size: 9pt;
  min-width: 160px;
  max-width: 250px;
}

.inv-tooltip .tooltip-title {
  font-weight: bold;
  color: var(--accent);
  font-size: 11pt;
  margin-bottom: 6px;
  text-transform: capitalize;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.inv-tooltip .tooltip-desc {
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
  font-style: italic;
}

.inv-tooltip .tooltip-biomes {
  color: var(--muted);
  font-size: 8pt;
  margin-bottom: 8px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.inv-tooltip .tooltip-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.inv-tooltip .tooltip-action {
  flex: 1;
  padding: 6px 10px;
  font-size: 9pt;
  font-weight: bold;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.inv-tooltip .tooltip-action.eat-action {
  background: #1a5a2a;
  color: #fff;
  border-color: #28a745;
}

.inv-tooltip .tooltip-action.eat-action:hover {
  background: #22732f;
  border-color: #34ce57;
}

.inv-tooltip .tooltip-action.forage-action {
  background: #1a3d5c;
  color: #fff;
  border-color: #3498db;
}

.inv-tooltip .tooltip-action.forage-action:hover {
  background: #224d73;
  border-color: #5dade2;
}

/* ============================================================================
   GAME OVER POPUP
   ============================================================================ */

.game-over-popup {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 6px;
}

.game-over-content {
  text-align: center;
  color: #fff;
  padding: 20px;
}

.game-over-content h1 {
  font-size: 2.5em;
  color: #ff4444;
  text-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
  margin-bottom: 15px;
  animation: pulse-red 1.5s ease-in-out infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; text-shadow: 0 0 20px rgba(255, 0, 0, 0.5); }
  50% { opacity: 0.8; text-shadow: 0 0 30px rgba(255, 0, 0, 0.8); }
}

.game-over-content p {
  font-size: 1.1em;
  margin: 8px 0;
  color: #ccc;
}

.game-over-content #gameOverReason {
  color: #ff8888;
  font-style: italic;
}

.game-over-content #gameOverStats {
  color: #88ccff;
}

.game-over-restart {
  margin-top: 20px;
  padding: 12px 30px;
  font-size: 1.1em;
  background: var(--accent, #48c78e);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.game-over-restart:hover {
  background: #3ab07d;
  transform: scale(1.05);
}

.game-over-restart:active {
  transform: scale(0.98);
}

/* ===== DRAMATIC EVENT POPUP ===== */
/* For attacks, lightning, and other dramatic events */

.dramatic-event-popup {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  border-radius: 6px;
  animation: dramatic-fade-in 0.2s ease-out;
}

@keyframes dramatic-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dramatic-event-content {
  text-align: center;
  color: #fff;
  padding: 25px 40px;
  max-width: 80%;
}

.dramatic-event-icon {
  font-size: 4em;
  margin-bottom: 10px;
  animation: dramatic-icon-pulse 0.8s ease-in-out infinite;
}

@keyframes dramatic-icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.dramatic-event-content h2 {
  font-size: 1.8em;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.dramatic-event-content p {
  font-size: 1.1em;
  color: #ccc;
  margin: 0;
}

/* Warning variant - yellow/orange theme */
.dramatic-event-popup.warning .dramatic-event-content h2 {
  color: #ffcc00;
  text-shadow: 0 0 15px rgba(255, 200, 0, 0.6);
}

.dramatic-event-popup.warning .dramatic-event-icon {
  text-shadow: 0 0 20px rgba(255, 200, 0, 0.5);
}

/* Danger variant - red theme (for actual attacks) */
.dramatic-event-popup.danger .dramatic-event-content h2 {
  color: #ff4444;
  text-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
  animation: danger-title-flash 0.5s ease-in-out infinite;
}

@keyframes danger-title-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.dramatic-event-popup.danger .dramatic-event-icon {
  text-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

/* Lightning variant - blue/white theme */
.dramatic-event-popup.lightning .dramatic-event-content h2 {
  color: #88ccff;
  text-shadow: 0 0 15px rgba(100, 180, 255, 0.6);
}

.dramatic-event-popup.lightning .dramatic-event-icon {
  text-shadow: 0 0 20px rgba(100, 180, 255, 0.5);
  animation: lightning-flash 0.3s ease-in-out infinite;
}

@keyframes lightning-flash {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

/* ===== THREAT WARNING BORDER STYLES ===== */
/* All threat levels flash with increasing intensity */

/* Low threat - flashing yellow glow (slow pulse) */
.app.threat-warning-low {
  animation: threat-flash-low 1.5s ease-in-out infinite;
}

@keyframes threat-flash-low {
  0%, 100% {
    box-shadow: inset 0 0 10px rgba(204, 204, 0, 0.2),
                0 0 8px rgba(204, 204, 0, 0.15);
  }
  50% {
    box-shadow: inset 0 0 20px rgba(204, 204, 0, 0.4),
                0 0 15px rgba(204, 204, 0, 0.3);
  }
}

/* Medium threat - flashing orange glow (medium pulse) */
.app.threat-warning-medium {
  animation: threat-flash-medium 1s ease-in-out infinite;
}

@keyframes threat-flash-medium {
  0%, 100% {
    box-shadow: inset 0 0 15px rgba(255, 136, 0, 0.3),
                0 0 10px rgba(255, 136, 0, 0.2);
  }
  50% {
    box-shadow: inset 0 0 25px rgba(255, 136, 0, 0.5),
                0 0 20px rgba(255, 136, 0, 0.4);
  }
}

/* High threat - flashing red glow (faster pulse) */
.app.threat-warning-high {
  animation: threat-flash-high 0.75s ease-in-out infinite;
}

@keyframes threat-flash-high {
  0%, 100% {
    box-shadow: inset 0 0 20px rgba(255, 0, 0, 0.4),
                0 0 15px rgba(255, 0, 0, 0.3);
  }
  50% {
    box-shadow: inset 0 0 30px rgba(255, 0, 0, 0.6),
                0 0 25px rgba(255, 0, 0, 0.5);
  }
}

/* Imminent/Critical threat - rapid flashing red border */
.app.threat-warning-imminent {
  animation: threat-flash-imminent 0.4s ease-in-out infinite;
}

@keyframes threat-flash-imminent {
  0%, 100% {
    box-shadow: inset 0 0 30px rgba(255, 0, 0, 0.6),
                0 0 25px rgba(255, 0, 0, 0.5);
  }
  50% {
    box-shadow: inset 0 0 45px rgba(255, 0, 0, 0.9),
                0 0 40px rgba(255, 0, 0, 0.8);
  }
}

/* ============================================================================
   CHOICES.JS CUSTOM DROPDOWN STYLING
   ============================================================================ */

/* Hide native select dropdown arrows globally */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none !important;
}

/* Remove IE dropdown arrow */
select::-ms-expand {
  display: none;
}

/* Choices.js container - match game theme */
.choices {
  margin-bottom: 0 !important;
  font-size: 8pt !important;
}

.choices__inner {
  background: #152433 !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 2px 4px !important;
  min-height: 30px !important;
  font-size: 8pt !important;
}

/* Remove the dropdown arrow completely */
.choices[data-type*="select-one"]::after {
  display: none !important;
  content: none !important;
  border: none !important;
}

.choices[data-type*="select-one"] .choices__inner {
  padding-bottom: 2px !important;
  padding-right: 4px !important;
}

/* Selected item styling */
.choices__list--single {
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
}

.choices__item {
  color: var(--text) !important;
}

.choices__item--selectable {
  color: var(--text) !important;
}

/* Dropdown list styling - IMPORTANT: Override CDN defaults */
.choices__list--dropdown,
.choices__list[aria-expanded] {
  background: #152433 !important;
  background-color: #152433 !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  z-index: 1001 !important;
}

.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
  padding: 6px 8px !important;
  font-size: 9pt !important;
  color: var(--text) !important;
  background: transparent !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: #1a3d5c !important;
  background-color: #1a3d5c !important;
  color: #fff !important;
}

.choices__list--dropdown .choices__item--selectable:hover,
.choices__list[aria-expanded] .choices__item--selectable:hover {
  background: #1a3d5c !important;
  background-color: #1a3d5c !important;
}

/* Disabled items */
.choices__list--dropdown .choices__item--disabled,
.choices__list[aria-expanded] .choices__item--disabled {
  color: #666 !important;
  opacity: 0.6 !important;
  background: transparent !important;
}

/* Custom option with image */
.choices-option-with-image {
  display: flex;
  align-items: center;
  gap: 6px;
}

.choices-option-with-image img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Eat dropdown specific - show image as selected item */
.eat-control .choices__inner {
  min-width: 80px !important;
}

.eat-control .choices__item img {
  width: 20px !important;
  height: 20px !important;
}

/* Placeholder image styling */
.choices__placeholder {
  opacity: 1 !important;
}

.choices__placeholder img {
  width: 20px;
  height: 20px;
}

/* Focus state */
.choices.is-focused .choices__inner {
  border-color: var(--accent) !important;
}

/* Hide the input search box for select-one */
.choices__input {
  background: #152433 !important;
  color: var(--text) !important;
}
