* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  touch-action: none;
  background: #1a1a2e;
  font-family: sans-serif;
}

#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#cvWrap {
  width: 100%;
  position: relative;
  background: #000;
  flex-shrink: 0;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
}

#hud {
  position: absolute;
  top: 4px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
  z-index: 2;
}

#minimap {
  position: absolute;
  top: 24px;
  right: 8px;
  width: 200px;
  height: 20px;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
  z-index: 3;
  overflow: hidden;
}

#pad {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #111;
  min-height: 100px;
}

.pg {
  display: flex;
  gap: 10px;
}

.pb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.pb:active {
  background: rgba(255,255,255,0.3);
}

.pk {
  border-color: rgba(255,130,50,0.5);
  background: rgba(255,130,50,0.15);
}

.pj {
  border-color: rgba(80,160,255,0.5);
  background: rgba(80,160,255,0.15);
}

.pe {
  border-color: rgba(180,100,255,0.5);
  background: rgba(180,100,255,0.15);
  font-size: 18px;
}

.ps {
  border-color: rgba(255,210,0,0.5);
  background: rgba(255,210,0,0.15);
  font-size: 14px;
}

/* Character creation overlay */
#charCreate {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15,15,40,0.97);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  color: #fff;
  text-align: center;
  padding: 20px;
}

#charCreate.off {
  display: none;
}

#charCreate h1 {
  font-size: 32px;
  margin-bottom: 6px;
}

#charCreate h2 {
  font-size: 20px;
  color: #aaa;
  margin-bottom: 20px;
}

#ccName {
  margin-bottom: 16px;
}

#ccName input {
  padding: 10px 16px;
  font-size: 18px;
  border: 2px solid #555;
  border-radius: 10px;
  background: #222;
  color: #fff;
  text-align: center;
  width: 200px;
  outline: none;
}

#ccName input:focus {
  border-color: #4fc3f7;
}

#ccColors {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.cc-color {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid #555;
  cursor: pointer;
}

.cc-color:active {
  transform: scale(1.1);
}

.cc-color.sel {
  border-color: #fff;
  box-shadow: 0 0 12px rgba(255,255,255,0.4);
}

#ccPreview {
  margin-bottom: 16px;
  font-size: 14px;
  color: #aaa;
  min-height: 24px;
}

#ccGo {
  padding: 14px 40px;
  font-size: 22px;
  border: none;
  border-radius: 12px;
  background: #4CAF50;
  color: #fff;
  cursor: pointer;
}

#ccGo:active {
  background: #388E3C;
}
