/* Eggsistential Breakfast — self-contained styles, no external fonts or CDNs. */

:root {
  --cream: #F7EFE0;
  --foam: #FFF8EE;
  --butter: #F3D48A;
  --yolk: #E8A01A;
  --yolk-deep: #C47A12;
  --caramel: #B5682A;
  --toast: #8C4E24;
  --coffee: #3B2416;
  --coffee-soft: #5C3A28;
  --linen: #F3E6D2;
  --linen-deep: #E7D3B8;
  --iron: #2C2622;
  --tomato: #C24732;
  --focus: #E8A01A;
  --shadow: rgba(59, 36, 22, 0.18);
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "EB Garamond", "Crimson Text", Georgia, "Times New Roman", serif;
  --font-ui: "Avenir Next", "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --header-h: clamp(3.6rem, 12vh, 5.4rem);
  --radius: 1.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

html {
  background: var(--linen);
}

body {
  min-height: 100%;
  height: 100%;
  color: var(--coffee);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, #FBF3E4 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 100%, #E8C9A0 0%, transparent 50%),
    var(--linen);
  color-scheme: light;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 20;
  padding: 0.5rem 0.8rem;
  background: var(--coffee);
  color: var(--foam);
  border-radius: 999px;
  text-decoration: none;
  transform: translateY(-150%);
}

.skip:focus {
  transform: none;
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100svh;
  max-height: 100dvh;
  max-height: 100svh;
  min-height: 0;
  overflow: hidden;
  padding:
    max(0.55rem, env(safe-area-inset-top))
    max(0.75rem, env(safe-area-inset-right))
    max(0.55rem, env(safe-area-inset-bottom))
    max(0.75rem, env(safe-area-inset-left));
  max-width: 72rem;
  margin: 0 auto;
}

header.mast {
  flex: 0 0 auto;
  text-align: center;
  padding: 0.15rem 0.5rem 0.55rem;
  min-height: 0;
}

header.mast h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.55rem, 4.6vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--coffee);
}

header.mast .tagline {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(0.88rem, 2.2vw, 1.1rem);
  color: var(--toast);
}

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #E8C48A;
  box-shadow:
    0 0 0 1px rgba(59, 36, 22, 0.08),
    0 18px 40px var(--shadow);
  isolation: isolate;
}

.stage:focus {
  outline: none;
}

.stage:focus-visible {
  box-shadow:
    0 0 0 3px var(--linen),
    0 0 0 6px var(--focus),
    0 18px 40px var(--shadow);
}

#board {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

#board:active {
  cursor: grabbing;
}

.hud {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem 0;
  pointer-events: none;
  z-index: 2;
}

.hud-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem 0.7rem 0.45rem;
  background: rgba(255, 248, 238, 0.78);
  border-radius: 0.9rem;
  box-shadow: 0 2px 10px rgba(59, 36, 22, 0.08);
  backdrop-filter: blur(6px);
}

.hud-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--toast);
  font-weight: 600;
}

.hud-value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
  color: var(--coffee);
  font-variant-numeric: tabular-nums;
}

.lives {
  display: flex;
  gap: 0.28rem;
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
}

.life {
  width: 1.05rem;
  height: 1.35rem;
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #F6E6C8 45%, #E2C8A0 100%);
  box-shadow: inset 0 -2px 0 rgba(140, 90, 40, 0.15);
}

.life.lost {
  background: radial-gradient(circle at 35% 30%, #E8D5C0 0%, #C9B09A 100%);
  opacity: 0.45;
  position: relative;
}

.life.lost::after {
  content: "";
  position: absolute;
  inset: 20% 30%;
  border-top: 1.5px solid var(--coffee-soft);
  transform: rotate(-25deg);
  opacity: 0.7;
}

.icon-btn {
  pointer-events: auto;
  appearance: none;
  border: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.86);
  color: var(--coffee);
  box-shadow: 0 2px 10px rgba(59, 36, 22, 0.1);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.icon-btn svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  background: var(--foam);
}

.icon-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.icon-btn[aria-pressed="true"] .wave {
  opacity: 0.25;
}

.icon-btn[aria-pressed="true"] .slash {
  display: block;
}

.icon-btn .slash {
  display: none;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(59, 36, 22, 0.18);
}

.overlay[hidden] {
  display: none !important;
}

.card {
  width: min(22.5rem, 100%);
  background: var(--foam);
  color: var(--coffee);
  border-radius: 1.35rem;
  padding: 1.55rem 1.4rem 1.35rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(59, 36, 22, 0.28);
}

.card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  font-weight: 600;
}

.card .quip {
  margin: 0.15rem 0 0.85rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.12rem;
  color: var(--toast);
}

.card p {
  margin: 0 0 0.7rem;
  color: var(--coffee-soft);
}

.card .howto {
  margin: 0 0 1.15rem;
  font-size: 0.98rem;
}

.card .scoreline {
  margin: 0 0 1.1rem;
  font-size: 1rem;
}

.touch-only {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .desktop-only {
    display: none;
  }

  .touch-only {
    display: revert;
  }
}

.btn {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: var(--coffee);
  color: var(--foam);
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 0 #2A1810;
}

.btn:hover {
  background: var(--coffee-soft);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #2A1810;
}

.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-height: 820px) {
  header.mast {
    padding-bottom: 0.28rem;
  }
}

@media (max-height: 620px) {
  header.mast {
    padding-bottom: 0.2rem;
  }

  header.mast .tagline {
    display: none;
  }

  .card {
    padding: 1.15rem 1.15rem 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn:active {
    transform: none;
  }

  .overlay,
  .hud-group,
  .icon-btn,
  .life {
    transition: none;
  }
}
