@import url('https://fonts.googleapis.com/css?family=Press+Start+2P');

/* ===== 🎨 Root Theme Variables ===== */
:root {
  --color-dirt-dark: #3b2f2f;
  /* background, borders */
  --color-dirt-clay: #a0522d;
  /* clay red UI bg */
  --color-gold: #ffd700;
  /* gold - buttons, highlights */
  --color-beige: #f5deb3;
  /* text */
  --color-black: #000000;
  /* deep border */
  --color-hover: #9b6d19;
  /* hover feedback */
  --color-ui-dark: #1a1a1a;
  /* dark container background */
  --color-ui-dark2: #000000;
}

/* ===== Canvas Container ===== */
.canvas-container {
  flex: 1;
  background-color: var(--color-ui-dark);
  border: 2px solid var(--color-black);
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

canvas {
  image-rendering: pixelated;
  width: 100%;
  height: 100%;
}

/* ===== Buttons ===== */
button,
input[type=button],
input[type=submit] {
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
  background-color: var(--color-dirt-dark);
  color: var(--color-black);
  border: 2px solid var(--color-black);
  padding: 10px 16px;
  border-radius: 0;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.15s ease;
  border-bottom: var(--color-ui-dark2) 4px solid !important;
}

div{

  font-family: 'Press Start 2P', cursive !important;
}


button:hover,
input[type=button]:hover,
input[type=submit]:hover {
  background-color: var(--color-hover);
  transform: translateY(-2px) rotate(-1.5deg);
}

button:active,
input[type=button]:active {
  background-color: var(--color-dirt-clay);
  color: var(--color-beige);
  transform: translateY(1px) rotate(1deg);
}

/* ===== Inputs ===== */
input[type=text],
textarea,
select {
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
  background-color: var(--color-beige);
  color: var(--color-black);
  border: 2px solid var(--color-black);
  padding: 6px;
  border-radius: 0;
  box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
  outline: 1px dotted var(--color-gold);
  
}

/* ===== Inventory Panel ===== */
#inventory.container {
  /* Provide a border, background, etc., if you like */
  border-radius: 10px;
  background: rgba(20, 20, 20, 1);
  /* You can also add a media query to ensure responsiveness on smaller devices */
  max-width: 70%;
  width: 59%;
  max-height: 70%;
  min-height: 50%;
  height: auto;
  overflow-y: clip;
  /* CR - I want the pieces inside to deal with their overflow not the entire container */
}

/* Title styling */
.inventory-title {
  font-size: 1.2rem;
  font-weight: bold;
  text-decoration: underline;
  margin: 0 10px;
  color: whitesmoke;
}


/* Scrollable item list */
.item-list {
  flex: 1;
  overflow: hidden auto;
  padding: 4px;
}

.item-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.item-list li,
.item-list div {
  padding: 6px;
  margin: 3px 0;
  background: transparent;
  cursor: pointer;
}

.item-list li:hover,
.item-list div:hover,
.item-list .selected {
  background-color: var(--color-gold);
  color: var(--color-dirt-dark);
}


.entry-animation {
  animation: cardEntry 0.5s forwards;
}


/* Misc elements */
.spacebar-hotkey {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-ui-dark);
  border: 2px solid var(--color-black);
  padding: 6px;
  font-size: 1rem;
  color: white;
  cursor: pointer;
}

.tag-bar {
  display: flex;
  justify-content: center;
  gap: 5px;
  border-bottom: 2px solid var(--color-black);
  padding: 4px 0;
}

.tag-button {
  padding: 6px 12px;
  font-size: 14px;
  font-family: 'Press Start 2P', cursive;
  background-color: var(--color-dirt-clay);
  color: var(--color-beige);
  border: 1px solid var(--color-black);
  border-radius: 0;
  cursor: pointer;
}


.buildOption {
  background-color: var(--color-dirt-dark);
  color: var(--color-beige);
  border: 1px solid var(--color-black);
  padding: 8px;
  font-size: 14px;
  margin: 6px 0;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
  width: 8px;
  background: var(--color-black);
}

::-webkit-scrollbar-track {
  background: var(--color-ui-dark);
}

::-webkit-scrollbar-thumb {
  background: #555;
  border: 1px solid var(--color-black);
}

::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* ===== Responsive Fixes ===== */
@media (max-width: 768px) {
  .canvas-container {
    width: 100vw;
    height: 100vh;
    flex-direction: column;
  }

  .inventory-panel {
    width: 100%;
    height: 50vh;
  }
}

/* Fullscreen body styling with animated background */
body {
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Press Start 2P', cursive;
  color: var(--color-ui-dark2);
  overflow: hidden;
  background-image: url('./game/images/floor.png'); /* Your tileable dirt texture */
  background-repeat: repeat;
  background-size: 400px 400px; /* Adjust based on your image */
  animation: scrollDirt 20s linear infinite;
}

@keyframes scrollDirt {
  from { background-position: 0 0; }
  to { background-position: 512px 512px; }
}

@keyframes scrollDirt {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 512px 512px;
  }
}



/* Futuristic Canvas */
canvas {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background-color: rgba(20, 20, 20, 0.9);
}



button:active {
  animation: buttonPress 0.1s forwards;
  font-weight: 900;
  border-bottom: none;
}


button:hover::before {
  left: 100%;
}
@keyframes buttonPress {
  0% { transform: scale(1) translateY(0); }
  50% { transform: scale(0.96) translateY(2px); }
  100% { transform: scale(0.95) translateY(2px); }
}


/* Input focus effect */
input:focus {
  font-size: 2em;
  font-weight: 900;
}


.container {
  padding: 20px;
  border: 2px solid var(--color-dirt-dark);
  background: var(--color-ui-dark);
  border-radius: 10px;
  text-align: center;
  transition: 0.3s ease-in-out;
  flex-grow: calc(10);
}

input:focus {
  font-size: 2em;
  font-weight: 900;
  background-color: var(--color-hover);
  color: var(--color-black);
  outline: none;
  border: #1a1a1a 1px solid;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .canvas-container {
    width: 90vw;
    height: 90vh;
  }

  button {
    font-size: 16px;
    padding: 10px 25px;
  }

  input {
    font-size: 14px;
    padding: 10px;
  }
}


.raceCard {
  background-color: #222;
  color: #fff;
  padding: 20px;
  margin: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  font-size: 1em;

  border: #222 2px solid;
}

.raceCard:hover {

  background-color: #222;
  border: white 2px solid;
}

.serverEntry:hover {
  border: black 5px solid;

}

/* Set scrollbar width (and optional background for the track area) */
::-webkit-scrollbar {
  width: 8px;
  /* Adjust for desired width */
  background: #111;
  /* Dark background for the scrollbar track */
}

/* Style of the scrollbar track (behind the draggable thumb) */
::-webkit-scrollbar-track {
  background: #111;
  /* Match the main scrollbar background */
  border-radius: 4px;
  /* Gives a subtle rounded track */
}

/* The draggable scrollbar thumb */
::-webkit-scrollbar-thumb {
  background: #555;
  /* Medium gray thumb for a futuristic vibe */
  border-radius: 4px;
  /* Slight rounding for a modern look */
  border: 1px solid #222;
  /* A subtle border that frames the thumb */
}

::-webkit-scrollbar-thumb:hover {
  background: #888;
}




/* Tag bar styling */
.tag-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-bottom: 2px solid black;
  height: 2rem;
  /* or auto */
}

tag-bar:hover {
  background-color: var(--color-gold);
}

.tag-button.selected {
  background-color: var(--color-gold);
  color: var(--color-dirt-dark);
}

.bottom-area {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 1rem;
  flex: 1;
}

.item-list {
  flex: 1;
  overflow-y: auto;
  height: 60vh;
}

.item-details {
  flex: 1;
  border-left: 2px solid black;
  overflow-y: clip;
  height: 60vh;
}

@media (max-width: 768px) {
  body {
    padding: 5px;
  }

  .tag-button,
  .buildOption,
  .raceCard,
  .serverEntry {
    font-size: 12px;
    padding: 6px;
  }
  #raceTitle {
    font-size: calc(1vw + 4px);
    top: 20%;
    padding: 6px 12px;
  }

  .inventory-title {
    font-size: 1rem;
  }

  .serverEntry {
    min-width: 40px;
    flex-direction: column;
  }
  input,
  textarea,
  select {
    font-size: 12px;
    padding: 6px;
  }

  button {
    font-size: 12px;
    padding: 8px 12px;
  }
  #inventory.container {
    width: 95vw;
    max-height: 80vh;
    padding: 10px;
    overflow-y: auto;
  }
}


#chatToggle:hover {
  animation:none !important;
  transform: translateY(0px) rotate(0deg) !important; 
  background-color: var(--color-ui-dark2);
  border: white 1px solid;
}