/* Shared Wysdordle header + game pills + Pearl card. Copied from public/wysdordle/index.html. */
:root {
  --g: #24A0DA;
  --y: #c9b458;
  --x: #787c7e;
  --b: #d3d6da;
  --k: #d3d6da;
  --t: #1a1a1b;
  --navy: #0a253a;
  --blue: #24A0DA;
}
html {
  overflow-x: hidden;
  max-width: 100%;
}
body {
  overflow-x: hidden;
  max-width: 100%;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}
.wx-shell {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
}
header.wx-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(65px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 8px 0;
  border-bottom: 1px solid var(--b);
  flex: none;
  background: #fff;
  color: var(--t);
  box-shadow: none;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 30;
  box-sizing: border-box;
  width: 100%;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  --wm-h: 20px;
  /* /wysdom-wordmark.png is 312×102. Last ink row of the 'sdom' letters is
     y=63 (0-index); their bottom edge is 64/102 of the bitmap. Rows 64–101
     are the stethoscope descender. Do not flex-center — that sits the game
     name on the PNG box, below the letter baseline. */
  --wm-sdom: 64;
}
header.wx-bar .ttl {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
  margin: 0;
  line-height: 1;
  flex: 1;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}
header.wx-bar .hs {
  width: 88px;
  flex: none;
  display: flex;
  align-items: center;
}
header.wx-bar .hr {
  width: 88px;
  display: flex;
  justify-content: flex-end;
  flex: none;
}
header.wx-bar .ttl img {
  height: var(--wm-h);
  width: auto;
  aspect-ratio: 312 / 102;
  flex: none;
  object-fit: contain;
  object-position: center;
}
header.wx-bar .ttl .gn {
  font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.015em;
  color: var(--navy);
  white-space: nowrap;
  line-height: 1;
  /* 0.14em is Montserrat's leftover em-box below the glyph bottoms of
     letters without descenders, so the visual baseline meets sdom. */
  padding-bottom: calc(var(--wm-h) * (102 - var(--wm-sdom)) / 102 - 0.14em);
}
@media (min-width: 420px) {
  header.wx-bar {
    --wm-h: 28px;
  }
  header.wx-bar .ttl {
    gap: 5px;
  }
  header.wx-bar .ttl .gn {
    font-size: 20px;
  }
}
@media (min-width: 500px) {
  header.wx-bar {
    --wm-h: 32px;
  }
  header.wx-bar .ttl .gn {
    font-size: 22px;
  }
}
header.wx-bar button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
  color: inherit;
}
header.wx-bar .hs a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
#chips {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  padding: 8px 12px 0;
  flex: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
#chips::-webkit-scrollbar { display: none; }
#chips a,
#chips button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--b);
  background: #fff;
  color: var(--t);
  border-radius: 4px;
  padding: 6px 12px;
  min-height: 44px;
  min-width: 44px;
  font: 700 13px "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex: none;
  -webkit-tap-highlight-color: transparent;
}
#chips a.on,
#chips button.on {
  background: var(--t);
  color: #fff;
  border-color: var(--t);
}
@media (min-width: 560px) {
  #chips { justify-content: center; }
}

/* Pearl card — exact Wysdordle rules */
#mc h2, #modal-message h2, #result-modal h2 {
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  margin: 14px 0 8px;
}
.stats { display: flex; justify-content: center; }
.stats div { flex: 1; text-align: center; max-width: 80px; }
.stats b { display: block; font-size: 32px; font-weight: 400; }
.stats span { font-size: 11px; color: var(--x); }
.tag { font-size: 11px; color: #787c7e; text-align: center; margin-top: 12px; }
.tag a { color: #787c7e; }
#pearl { margin-top: 18px; border-top: 1px solid var(--b); padding-top: 12px; }
.pdv { border: 0; border-top: 1px solid var(--b); width: 40%; margin: 6px auto 12px; }
.exh { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; text-align: center; margin: 0 0 8px; }
#pearl .ans { font-size: 13px; text-align: center; }
#pearl .ans b { font-size: 20px; letter-spacing: .15em; display: block; color: var(--navy); }
#pearl .mean { font-size: 14px; text-align: center; margin: 4px 0 10px; color: #444; }
.pc { background: var(--navy); color: #fff; border-radius: 8px; overflow: hidden; }
.pc .vl { position: relative; display: block; aspect-ratio: 16/9; background: #000; overflow: hidden; }
.pc .vl img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc .vl .pb { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.pc .vl:hover .pb { transform: scale(1.08); }
.pc .vl .cap { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 4px; }
.pc .meta { padding: 10px 12px; }
.pc .meta .k { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .06em; }
.pc .meta .t { font-weight: 700; margin: 2px 0; }
.pc .meta .s { font-size: 13px; opacity: .85; }
.pc .watch { display: inline-flex; align-items: center; justify-content: center; margin: 0 12px 14px; background: var(--blue); color: #fff; border-radius: 24px; font-weight: 700; font-size: 16px; padding: 10px 24px; text-decoration: none; min-height: 44px; }

#share {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 24px;
  font-weight: 700;
  font-size: 16px;
  padding: 12px 28px;
  cursor: pointer;
  min-height: 44px;
}
.guess-rows { text-align: center; font-size: 22px; letter-spacing: 2px; margin: 8px 0 12px; }
@keyframes wx-flip { 0%{transform:rotateX(0)} 50%{transform:rotateX(-90deg)} 100%{transform:rotateX(0)} }
@keyframes wx-bounce { 0%,20%{transform:translateY(0)} 40%{transform:translateY(-18px)} 50%{transform:translateY(4px)} 60%{transform:translateY(-10px)} 80%{transform:translateY(2px)} 100%{transform:translateY(0)} }
.g-row.flip { animation: wx-flip .5s ease-in; }
.g-row.bounce { animation: wx-bounce 1s; }

.foot { display: flex; align-items: center; justify-content: center; margin-top: 14px; flex-wrap: wrap; gap: 8px; }

#ov {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 12px;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
#ov.show { display: flex; }
#modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 23px rgba(0,0,0,.2);
  width: min(500px, calc(100vw - 24px));
  max-height: min(92vh, calc(100dvh - 24px));
  overflow: auto;
  padding: 16px 16px 20px;
  position: relative;
  box-sizing: border-box;
}
#close,
#modal-close-btn,
.close-btn {
  min-width: 44px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
#close {
  position: absolute;
  right: 8px;
  top: 6px;
  border: 0;
  background: none;
  font-size: 22px;
  cursor: pointer;
}

/* Game controls that must stay thumb-sized on every page */
#submit-btn,
.btn_color,
#summary-btn,
#guess,
.choices button,
.btns button,
.card,
.tile,
#kb button {
  min-height: 44px;
  touch-action: manipulation;
}
.wdx-pearl {
  position: relative;
  z-index: 2;
  min-height: 44px;
}
.modal-content {
  max-width: min(500px, calc(100vw - 16px));
  max-height: min(92vh, calc(100dvh - 16px));
  overflow: auto;
  position: relative;
  box-sizing: border-box;
}
