:root {
  --board: #d8b38a; /* light wood */
  --border: #6b4b2a; /* dark wood */
  --line: #3b2b18;
  --ui: #111827;
  --accent: #3b82f6;
  --background: radial-gradient(circle at 30% 20%, #f8ede1, #eee6dc 40%, #e6dacd 70%, #ded1c1 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans";
  background: var(--background);
  color: #111;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden; /* Prevent scrollbars on mobile */
  transition: background 0.5s;
}

/* --- WELCOME SCREEN STYLES --- */
#welcomeScreen {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

#welcomeScreen h1 {
  font-size: clamp(2.5rem, 10vw, 4rem);
  color: var(--border);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  margin: 0;
}

#welcomeScreen p {
    font-size: 1.2rem;
    color: #555;
    margin-top: -10px;
}

.profiles-container {
    display: flex;
    gap: 40px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.profile-editor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-pic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #eee;
    border: 4px solid var(--border);
    cursor: pointer;
    background-size: cover;
    background-position: center;
}

.profile-name-input {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    font-weight: 600;
    width: 150px;
}

#startButton {
  font-size: 1.5rem;
  font-weight: 600;
  padding: 15px 30px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

#startButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.hidden {
    display: none !important;
}

/* --- GAME STYLES --- */
.wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 760px;
  padding: 10px;
}

.canvas-container {
    width: 100%;
    position: relative;
    aspect-ratio: 1 / 1;
}

canvas {
  width: 100%;
  height: 100%;
  background: var(--board);
  border: 20px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  touch-action: none;
  position: absolute;
  top: 0;
  left: 0;
  transition: background 0.5s, border-color 0.5s;
}

.hud {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.pill {
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 6px 10px;
  border-radius: 999px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
}

.player-display .profile-pic {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
}

.pill.wallet {
    background-color: #fffbeb;
    color: #b45309;
    font-weight: 600;
}

.pill.timer {
    background-color: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
}

.pill select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 1em;
  color: #374151;
  cursor: pointer;
}

.btn {
  cursor: pointer;
  border: none;
  background: #111827;
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
}

.btn:active {
  transform: translateY(1px);
}

.legend {
  font-size: 11px;
  color: #374151;
  width: 100%;
  text-align: center;
}

.meter {
  height: 10px;
  width: 100px;
  background: #e5e7eb;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.meter > span {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--accent);
}

/* --- NEW FULLSCREEN STYLES --- */
body.fullscreen-active .hud {
    display: none;
}
body.fullscreen-active .wrap {
    height: 100vh;
    padding: 0;
    gap: 0;
    justify-content: center;
}
