:root {
  color-scheme: light;
  --ink: #072017;
  --muted: #5f766c;
  --green: #1da85b;
  --green-deep: #0b6f43;
  --lime: #a7ed73;
  --blue: #2f7cf6;
  --cream: #fff4c8;
  --sand: #f4cf75;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(6, 74, 43, 0.16);
  --shadow: 0 22px 70px rgba(11, 57, 39, 0.22);
  --radius: 8px;
  font-family:
    Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", Meiryo,
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f3fff4;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(47, 124, 246, 0.18), transparent 22rem),
    radial-gradient(circle at 82% 18%, rgba(255, 213, 96, 0.28), transparent 21rem),
    linear-gradient(180deg, #f7fff3 0%, #c8f4a0 44%, #85d86f 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.game-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 10px max(16px, calc((100vw - 1060px) / 2));
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px) saturate(1.35);
}

.brand-link strong {
  font-size: 1.12rem;
  font-weight: 1000;
  letter-spacing: 0;
}

.brand-link span {
  color: var(--green);
}

.room-link {
  display: inline-grid;
  min-height: 36px;
  place-items: center;
  padding: 0 14px;
  border-radius: 999px;
  color: #0d6f43;
  font-size: 0.78rem;
  font-weight: 1000;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px var(--line);
}

.putt-shell {
  display: grid;
  min-height: calc(100vh - 62px);
  place-items: start center;
  padding: 24px 16px 54px;
}

.putt-machine {
  width: min(100%, 1060px);
}

.title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.title-row p {
  margin: 0 0 5px;
  color: var(--green-deep);
  font-size: 0.85rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.title-row h1 {
  margin: 0;
  color: #08351f;
  font-size: clamp(2.3rem, 7vw, 5.3rem);
  font-weight: 1000;
  line-height: 0.9;
  letter-spacing: 0;
}

.best-card {
  min-width: 132px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 12px 28px rgba(10, 85, 50, 0.12);
  text-align: right;
}

.best-card span,
.hud-row span,
.ad-slot span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
}

.best-card strong {
  display: block;
  margin-top: 5px;
  color: var(--blue);
  font-size: 1.32rem;
  font-weight: 1000;
  line-height: 1;
}

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

.hud-row div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 30px rgba(10, 85, 50, 0.1);
}

.hud-row strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 1000;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-frame {
  position: relative;
  overflow: hidden;
  width: min(100%, 620px);
  margin: 0 auto;
  border: 6px solid rgba(255, 255, 255, 0.86);
  border-radius: 14px;
  background: #6bd36b;
  box-shadow: var(--shadow);
  touch-action: none;
}

#putt-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 620 / 860;
  background: #83d86f;
}

.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 24px;
  color: #fff;
  background: linear-gradient(180deg, rgba(3, 32, 20, 0.18), rgba(3, 32, 20, 0.58));
  text-align: center;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.34);
}

.game-overlay[hidden] {
  display: none;
}

.game-overlay p {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.88rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.game-overlay strong {
  font-size: clamp(2.4rem, 9vw, 5.2rem);
  font-weight: 1000;
  line-height: 0.95;
}

.game-overlay button,
.serve-button,
.icon-button {
  display: inline-grid;
  min-height: 48px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 1000;
  cursor: pointer;
  background: var(--blue);
  box-shadow: 0 14px 32px rgba(21, 92, 213, 0.24);
  transition:
    filter 0.16s ease,
    transform 0.16s ease;
}

.game-overlay button {
  min-width: 168px;
  margin-top: 22px;
  padding: 0 26px;
}

.serve-button {
  min-width: 150px;
  padding: 0 26px;
}

.icon-button {
  width: 58px;
  min-width: 58px;
  padding: 0;
  color: #0a7445;
  font-size: 1.45rem;
  background: rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 0 0 1px var(--line),
    0 12px 28px rgba(11, 85, 50, 0.14);
}

.game-overlay button:hover,
.serve-button:hover,
.icon-button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.control-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  margin: 16px 0 12px;
}

.ad-slot {
  display: grid;
  min-height: 70px;
  place-items: center;
  border: 1px dashed rgba(16, 112, 67, 0.26);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.ad-slot small {
  margin-top: 3px;
  color: #7c9087;
  font-weight: 800;
}

@media (max-width: 720px) {
  .putt-shell {
    padding: 16px 10px 42px;
  }

  .title-row {
    align-items: start;
  }

  .best-card {
    min-width: 104px;
    padding: 9px 10px;
  }

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

  .course-frame {
    border-width: 4px;
    border-radius: 12px;
  }

  .control-row {
    gap: 8px;
  }

  .icon-button {
    width: 52px;
    min-width: 52px;
  }

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

@media (max-width: 430px) {
  .game-nav {
    padding-right: 12px;
    padding-left: 12px;
  }

  .brand-link strong {
    font-size: 1rem;
  }

  .room-link {
    padding: 0 11px;
  }

  .title-row h1 {
    font-size: clamp(2rem, 13vw, 3rem);
  }

  .best-card {
    min-width: 92px;
  }

  .hud-row strong {
    font-size: 1rem;
  }
}
