* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  color: #17202a;
}

#game {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #fff;
}

.cat {
  position: absolute;
  width: 390px;
  height: auto;
  left: 52%;
  top: 35px;
  user-select: none;
  pointer-events: none;
  mix-blend-mode: multiply;
  transform-origin: center;
  z-index: 2;
}

#manyCats {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.extra-cat {
  position: absolute;
  width: 75px;
  height: auto;
  user-select: none;
  pointer-events: none;
  mix-blend-mode: multiply;
}

#walkTooltip, #patTooltip {
  position: absolute;
  z-index: 6;
  border: 1px solid #dfe3e7;
  border-radius: 999px;
  background: #fff;
  color: #17202a;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(0,0,0,.08);
  white-space: nowrap;
}

#walkTooltip {
  display: none;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  transform: translate(-50%, -100%);
}

#patTooltip {
  display: none;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  transform: translate(-50%, -100%);
}

#controls {
  position: absolute;
  left: 70px;
  bottom: 30px;
  width: 365px;
  min-height: 330px;
  border: 2px solid #e4e7eb;
  border-radius: 18px;
  background: rgba(255,255,255,.97);
  padding: 16px 24px 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
  z-index: 10;
}

#nameArea {
  display: flex;
  gap: 7px;
  margin-bottom: 15px;
}

#catNameInput {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1.5px solid #cfd5da;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: #17202a;
  font-size: 14px;
}

#saveName {
  height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: #17202a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.instruction {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 700;
}

.keyboard-icon { font-size: 23px; margin-right: 7px; }

.mini-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 30px;
  border: 1px solid #d7dce1;
  border-radius: 5px;
  background: #fff;
  font-size: 16px;
}

.wasd { margin-top: 18px; }

.key-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.key-row + .key-row { margin-top: 10px; }

.key {
  width: 78px;
  height: 78px;
  border: 2px solid #b9c0c7;
  border-radius: 11px;
  background: linear-gradient(#fff, #fafafa);
  color: #17202a;
  font-size: 30px;
  font-weight: 700;
  box-shadow: inset 0 0 0 6px #f5f6f7, 0 3px 0 #d7dce1;
}

.key.active {
  transform: translateY(3px);
  background: #f1f3f5;
  box-shadow: inset 0 0 0 6px #e8eaec, 0 0 0 #d7dce1;
}

#dontClick {
  position: absolute;
  right: 28px;
  bottom: 28px;
  z-index: 12;
  padding: 11px 17px;
  border: 1.5px solid #cbd1d6;
  border-radius: 10px;
  background: #fff;
  color: #17202a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#dontClick.active { border-color: #17202a; }

@media (max-width: 800px) {
  .cat { width: 300px; left: 48%; }
  #controls {
    left: 25px;
    bottom: 20px;
    width: 365px;
    transform: scale(.85);
    transform-origin: bottom left;
  }
}
