:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: #12160f;
  color: #d9e2cf;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  -webkit-tap-highlight-color: transparent;
}
a { color: #9fe08a; }
code { background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 3px; }

#app { max-width: 760px; margin: 0 auto; padding: 0 14px 24px; }

.topbar {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 18px 2px 8px;
}
.brand { font-weight: 700; font-size: 20px; color: #d7f5c6; letter-spacing: 0.01em; }
.brand-sub { font-size: 12px; color: #6f8a63; }
.who { margin-left: auto; font-size: 12px; color: #8fae7f; }

.screen.hidden { display: none; }

.intro-card {
  background: linear-gradient(180deg, rgba(60,80,45,0.18), rgba(20,26,16,0.4));
  border: 1px solid rgba(159,224,138,0.18);
  border-radius: 14px;
  padding: 20px 22px;
}
.intro-card h1 {
  margin: 0 0 10px;
  font-family: ui-serif, Georgia, serif;
  font-style: italic;
  font-size: 26px;
  color: #eafcd8;
  text-shadow: 0 0 18px rgba(150,255,120,0.15);
}
.intro-card p { line-height: 1.55; color: #c4d3b8; margin: 0 0 12px; }
.intro-card p.fine { font-size: 12px; color: #6f8a63; }

#login-box, #continue-box {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px;
}
#continue-box.hidden { display: none; }
#login-box.hidden { display: none; }

input#handle-input {
  flex: 1; min-width: 180px;
  background: #0c0f09; border: 1px solid rgba(159,224,138,0.3);
  color: #eafcd8; border-radius: 8px; padding: 10px 12px; font: inherit;
  outline: none;
}
input#handle-input:focus { border-color: #9fe08a; }

.pill-btn {
  border: 1px solid rgba(159,224,138,0.35);
  background: rgba(159,224,138,0.06);
  color: #d9e2cf;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
  transition: transform 0.08s ease, background 0.15s ease;
}
.pill-btn:hover { background: rgba(159,224,138,0.14); }
.pill-btn:active { transform: scale(0.96); }
.pill-btn.primary { background: #6fae4a; border-color: #6fae4a; color: #0d150a; }
.pill-btn.primary:hover { background: #7fc257; }

.status { min-height: 20px; margin-top: 10px; font-size: 12.5px; color: #9fbf8e; }
.status.error { color: #ff9a8a; }

/* ---- game screen ---- */

#hud {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 2px;
}
.hp-wrap {
  position: relative; width: 160px; height: 18px;
  background: #1c2416; border: 1px solid rgba(159,224,138,0.3); border-radius: 5px;
  overflow: hidden;
}
#hp-bar {
  position: absolute; inset: 0; width: 100%;
  background: linear-gradient(90deg, #ff5a4e, #ffb454 55%, #7fc257);
  transform-origin: left center;
  transition: transform 0.15s linear;
}
#hp-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #0d150a; text-shadow: 0 1px 0 rgba(255,255,255,0.25);
}
#hud-stats { font-size: 12.5px; color: #b9cfae; }
#hud-stats #score { color: #eafcd8; font-weight: 700; }

.canvas-wrap {
  position: relative;
  border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(159,224,138,0.22);
  background: #0a0d07;
  touch-action: none;
}
canvas#board { display: block; width: 100%; height: auto; }

.overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 24px;
  background: rgba(8,10,6,0.86);
  backdrop-filter: blur(2px);
}
.overlay.hidden { display: none; }
.overlay h2 {
  margin: 0; font-family: ui-serif, Georgia, serif; font-style: italic;
  font-size: 24px; color: #eafcd8;
}
.overlay p { margin: 0; color: #c4d3b8; max-width: 480px; line-height: 1.5; font-size: 14px; }
.overlay #over-stats { color: #9fe08a; font-weight: 600; }
.over-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

#controls {
  display: flex; align-items: center; gap: 14px; padding: 12px 2px 4px; flex-wrap: wrap;
}
.like-btn {
  border: none; border-radius: 999px;
  background: #d84a4a; color: #fff2ee;
  font: inherit; font-weight: 800; font-size: 15px; letter-spacing: 0.02em;
  padding: 14px 22px; cursor: pointer;
  box-shadow: 0 3px 0 #8f2f2f;
  transition: transform 0.06s ease;
  user-select: none;
}
.like-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8f2f2f; }
.like-btn.no-target { animation: no-target-shake 0.18s ease; }
@keyframes no-target-shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  70% { transform: translateX(4px); }
}
.hint { font-size: 12px; color: #6f8a63; }

.foot {
  margin-top: 26px; font-size: 11.5px; color: #5a7250; text-align: center; line-height: 1.6;
}
