:root {
  --bg: #17130f;
  --panel: #2f291f;
  --panel-soft: #3d3428cc;
  --line: #9f8a60;
  --text: #f2e8d1;
  --muted: #c2b08f;
  --accent: #d3a95d;
  --accent-2: #8e6630;
  --danger: #c66b6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 0, #3b3226 0%, var(--bg) 60%, #0f0d0a 100%);
}

.hidden {
  display: none !important;
}

.sud-app {
  position: fixed;
  inset: 0;
}

.hud-top-bg,
.hud-bottom-bg {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

.hud-top-bg {
  top: 0;
  height: 72px;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.9019607843), rgba(17, 17, 17, 0.1215686275));
}

.hud-bottom-bg {
  bottom: 0;
  height: 76px;
  background: linear-gradient(0deg, rgba(17, 17, 17, 0.9019607843), rgba(17, 17, 17, 0.1215686275));
}

.safe-area-root {
  position: fixed;
  z-index: 2;
}

.screen {
  width: 100%;
  height: 100%;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.1215686275);
  border-radius: 14px;
  background: linear-gradient(160deg, #2f291f, #473d30);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.368627451);
}

.screen-login,
.screen-menu {
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-panel,
.menu-panel {
  width: min(520px, 100%);
  padding: 20px;
}

.auth-panel h1,
.menu-panel h2 {
  margin: 0 0 8px;
}

.auth-panel p,
.menu-panel p {
  margin: 0 0 16px;
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2705882353);
  color: var(--text);
  outline: none;
}

.btn-primary,
.btn-secondary,
.action-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #21150a;
}

.btn-secondary {
  background: #2e2b26;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1333333333);
}

.error-text {
  min-height: 20px;
  color: var(--danger);
}

.character-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.character-item {
  border: 1px solid rgba(255, 255, 255, 0.1490196078);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.1490196078);
}

.character-item.selected {
  border-color: #f1c66f;
  background: rgba(108, 75, 30, 0.3333333333);
}

.menu-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.screen-game {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 8px 0;
}

.hud-top-content,
.hud-bottom-content {
  padding: 0 10px;
}

.hud-top-content {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.stat {
  border: 1px solid rgba(255, 255, 255, 0.1333333333);
  border-radius: 10px;
  background: rgba(30, 26, 20, 0.7803921569);
  text-align: center;
  padding: 6px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.stat strong {
  font-size: 19px;
}

.game-main {
  min-height: 0;
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  gap: 10px;
  padding: 0 10px;
}

.panel-soft {
  border: 1px solid rgba(255, 255, 255, 0.1137254902);
  border-radius: 12px;
  background: var(--panel-soft);
  backdrop-filter: blur(2px);
}

.left-actions,
.right-actions {
  display: grid;
  gap: 8px;
  padding: 10px;
  align-content: start;
}

.action-btn {
  background: #201a13;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1607843137);
}

.map-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.map-viewport {
  position: absolute;
  inset: 0;
}

.map-viewport canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.map-overlay {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.431372549);
  border: 1px solid rgba(255, 255, 255, 0.1490196078);
  border-radius: 8px;
  padding: 6px 10px;
  color: #f8e7c4;
  font-size: 12px;
}

.hud-bottom-content {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .hud-top-content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .game-main {
    grid-template-columns: 120px 1fr 120px;
  }
}