﻿:root {
  --bg-top: #b9ddff;
  --bg-bottom: #f4f0d5;
  --panel: #fffef7;
  --line: #c9d8bd;
  --ink: #162215;
  --muted: #5b6a57;
  --leaf: #2f7a43;
  --leaf-dark: #245f35;
  --honey: #e8b344;
  --danger: #b74f43;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", Candara, "Gill Sans", sans-serif;
}

button {
  border: 1px solid #95af95;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 42px;
  padding: 0 14px;
}

button:hover {
  border-color: var(--leaf);
}

button:active {
  transform: translateY(1px);
}

.app-shell {
  margin: 0 auto;
  padding: 14px 0 18px;
  width: min(1200px, calc(100% - 22px));
}

.topbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.eyebrow {
  color: var(--leaf-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(1.55rem, 3.5vw, 2.2rem);
  line-height: 1.05;
  margin: 0;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.72);
}

.hud {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
}

.stat {
  background: rgba(255, 255, 247, 0.93);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 68px;
  padding: 10px;
}

.stat span {
  color: var(--muted);
  display: block;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.stat strong,
.stat strong span {
  color: var(--ink);
  display: inline;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  margin: 0;
}

.game-panel {
  aspect-ratio: 16 / 9;
  background: #f2f6f2;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 330px;
  overflow: hidden;
  position: relative;
}

#gameCanvas {
  display: block;
  height: 100%;
  touch-action: none;
  width: 100%;
}

.overlay {
  position: absolute;
  z-index: 5;
}

.top-left {
  background: rgba(255, 255, 247, 0.8);
  border: 1px solid rgba(130, 146, 128, 0.56);
  border-radius: 10px;
  font-size: 0.9rem;
  left: 10px;
  max-width: min(76%, 460px);
  padding: 8px 10px;
  top: 10px;
}

.bottom-right {
  bottom: 10px;
  right: 10px;
}

.bottom-left {
  bottom: 10px;
  left: 10px;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  min-width: 122px;
}

#convertButton {
  background: #fdf7e7;
  border-color: #c8ab6d;
}

#jumpButton {
  background: #e9f2ff;
  border-color: #8da9cf;
}

.mobile-stick {
  display: none;
}

.joystick-zone {
  backdrop-filter: blur(1.4px);
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(152, 167, 152, 0.8);
  border-radius: 50%;
  height: 120px;
  position: relative;
  width: 120px;
}

.joystick-knob {
  background: rgba(61, 95, 68, 0.8);
  border-radius: 50%;
  height: 52px;
  left: 34px;
  position: absolute;
  top: 34px;
  width: 52px;
}

.hint-line {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 10px 2px 0;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 12px, 1200px);
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-left {
    font-size: 0.83rem;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    min-width: 132px;
  }

  .hint-line {
    font-size: 0.82rem;
    margin-top: 8px;
  }
}

@media (pointer: coarse) {
  .mobile-stick {
    display: block;
  }

  .top-left {
    max-width: 82%;
  }

  .actions button {
    min-height: 48px;
  }
}
