/* Shell Game — sea-and-sand theme. Everything is scoped to .sg-root so the WordPress theme can't reach in (and we don't reach out). Sizes are in px because some themes change the root font size. */

.sg-root {
  --sg-ink: #102a3a;
  --sg-ink-soft: #3d5361;
  --sg-card: #fbf6ec;
  --sg-key: #e9dcc3;
  --sg-line: #a89a7f;
  --sg-hit: #0a5f7a;
  --sg-near: #b4471e;
  --sg-miss: #6e6556;
  --sg-foam: #ffffff;
  --sg-tint: #e6f1f4;
  --sg-tint: color-mix(in srgb, var(--sg-hit) 12%, #fff);
  max-width: 520px;
  margin: 0 auto;
  color: var(--sg-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Verdana, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  text-align: left;
}
.sg-root *, .sg-root *::before, .sg-root *::after { box-sizing: border-box; }
.sg-root [hidden] { display: none !important; }
.sg-root p { margin: 0 0 12px; font-size: 18px; color: inherit; }
.sg-root button {
  font-family: inherit; text-transform: none; letter-spacing: normal; text-shadow: none;
  box-shadow: none; margin: 0; width: auto; min-width: 0; line-height: 1.2; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.sg-root button:focus-visible, .sg-root a:focus-visible, .sg-root input:focus-visible {
  outline: 3px solid #f0a020; outline-offset: 2px;
}
.sg-loading { padding: 40px 16px; text-align: center; }

/* ---------- card + header ---------- */

.sg-root .sg-game {
  background: var(--sg-card);
  border: 1px solid var(--sg-line);
  border-radius: 20px;
  padding: 16px 12px 20px;
  box-shadow: 0 6px 24px rgba(16, 42, 58, .08);
}
.sg-root .sg-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 4px 4px 12px; margin-bottom: 8px; border-bottom: 2px dashed var(--sg-line);
}
.sg-root .sg-brand { display: flex; align-items: center; gap: 10px; }
.sg-root .sg-logo { width: 46px; height: 46px; flex: none; color: var(--sg-hit); }
.sg-root .sg-title { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--sg-hit); letter-spacing: .5px; }
.sg-root .sg-sub { margin: 2px 0 0; font-size: 16px; color: var(--sg-ink-soft); }
.sg-root .sg-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-root .sg-tool {
  background: var(--sg-foam); color: var(--sg-ink); border: 2px solid var(--sg-line);
  border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 700; min-height: 44px;
}
.sg-root .sg-tool:hover { background: #f3ead8; color: var(--sg-ink); }
.sg-root .sg-tool[aria-pressed="true"] { background: var(--sg-ink); color: var(--sg-foam); border-color: var(--sg-ink); }

/* ---------- message ---------- */

.sg-root .sg-msg {
  min-height: 46px; margin: 4px auto 8px; text-align: center; font-size: 19px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sg-root .sg-msg.is-on { background: var(--sg-ink); color: var(--sg-foam); border-radius: 999px; padding: 8px 20px; width: fit-content; max-width: 100%; }

/* ---------- board ---------- */

.sg-root .sg-board { display: grid; gap: 7px; width: 100%; max-width: 350px; margin: 0 auto 18px; }
.sg-root .sg-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.sg-root .sg-tile {
  position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  background: var(--sg-foam); border: 3px solid var(--sg-line); border-radius: 14px;
  font-size: 34px; font-weight: 800; color: var(--sg-ink); text-transform: uppercase; user-select: none;
}
.sg-root .sg-tile.is-filled { border-color: var(--sg-ink-soft); animation: sgPop .12s ease-out; }
.sg-root .sg-tile.is-hit  { background: var(--sg-hit);  border-color: var(--sg-hit);  color: var(--sg-foam); }
.sg-root .sg-tile.is-near { background: var(--sg-near); border-color: var(--sg-near); color: var(--sg-foam); }
.sg-root .sg-tile.is-miss { background: var(--sg-miss); border-color: var(--sg-miss); color: var(--sg-foam); }

/* Reveal: each tile turns in order, and its color switches at the halfway point. */
.sg-root .sg-tile.is-flip {
  animation: sgTurn .5s ease both;
  animation-delay: calc(var(--i) * .25s);
  transition: background-color 0s, border-color 0s, color 0s;
  transition-delay: calc(var(--i) * .25s + .25s);
}
.sg-root .sg-row.is-shake { animation: sgShake .4s ease; }

@keyframes sgPop { 50% { transform: scale(1.08); } }
@keyframes sgTurn { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes sgShake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- keyboard ---------- */

.sg-root .sg-kb { display: grid; gap: 7px; }
.sg-root .sg-kb-row { display: flex; gap: 5px; justify-content: center; }
.sg-root .sg-kb-row:nth-child(2) { padding: 0 4.5%; }
.sg-root .sg-key {
  position: relative; flex: 1 1 0; height: 60px; padding: 0;
  background: var(--sg-key); color: var(--sg-ink); border: 0; border-radius: 10px;
  font-size: 21px; font-weight: 800;
}
.sg-root .sg-key:hover { background: var(--sg-key); color: var(--sg-ink); filter: brightness(.94); }
.sg-root .sg-key:active { transform: translateY(1px); }
.sg-root .sg-key--wide { flex: 1.6 1 0; font-size: 14px; letter-spacing: .3px; text-transform: uppercase; }
.sg-root .sg-key.is-hit  { background: var(--sg-hit);  color: var(--sg-foam); }
.sg-root .sg-key.is-near { background: var(--sg-near); color: var(--sg-foam); }
.sg-root .sg-key.is-miss { background: var(--sg-miss); color: #e6ded0; }

/* ---------- color-blind mode: a mark on every scored tile and key, plus stripes on "wrong spot" ---------- */

.sg-root .sg-mark { display: none; }
.sg-root.sg-cb .is-hit .sg-mark, .sg-root.sg-cb .is-near .sg-mark, .sg-root.sg-cb .is-miss .sg-mark,
.sg-root .sg-help .sg-mark {
  display: block; position: absolute; top: 2px; right: 5px; font-size: 15px; line-height: 1; font-weight: 800;
}
.sg-root .is-hit .sg-mark::before { content: "\2713"; }
.sg-root .is-near .sg-mark::before { content: "\2194"; }
.sg-root .is-miss .sg-mark::before { content: "\2715"; }
.sg-root.sg-cb .is-near { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.22) 0 5px, transparent 5px 11px); }
.sg-root.sg-cb .sg-key.is-hit::after,
.sg-root.sg-cb .sg-key.is-near::after,
.sg-root.sg-cb .sg-key.is-miss::after { position: absolute; top: 2px; right: 4px; font-size: 12px; line-height: 1; }
.sg-root.sg-cb .sg-key.is-hit::after { content: "\2713"; }
.sg-root.sg-cb .sg-key.is-near::after { content: "\2194"; }
.sg-root.sg-cb .sg-key.is-miss::after { content: "\2715"; }

/* ---------- results ---------- */

.sg-root .sg-results { border-top: 2px dashed var(--sg-line); padding-top: 16px; text-align: center; }
.sg-root .sg-verdict { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.sg-root .sg-answer { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 280px; margin: 0 auto 14px; }
.sg-root .sg-answer .sg-tile { font-size: 28px; border-radius: 12px; }
.sg-root .sg-fact { font-size: 19px; text-align: left; background: var(--sg-foam); border-left: 6px solid var(--sg-hit); border-radius: 10px; padding: 12px 14px; }
.sg-root .sg-sponsor { font-size: 16px; color: var(--sg-ink-soft); }
.sg-root .sg-sponsor a { color: var(--sg-hit); font-weight: 700; }
.sg-root .sg-h3 { margin: 20px 0 10px; font-family: inherit; font-size: 21px; font-weight: 800; line-height: 1.25; color: var(--sg-ink); text-transform: none; letter-spacing: normal; }

.sg-root .sg-btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 12px 20px;
  margin: 0 0 10px; border-radius: 999px; font-size: 19px; font-weight: 800; text-decoration: none; text-align: center;
}
.sg-root .sg-btn--primary { background: var(--sg-ink); color: var(--sg-foam); border: 0; }
.sg-root .sg-btn--primary:hover { background: var(--sg-ink); color: var(--sg-foam); filter: brightness(1.25); }
.sg-root .sg-btn--primary:disabled { opacity: .6; cursor: default; }
.sg-root .sg-btn--link { background: var(--sg-foam); color: var(--sg-hit); border: 3px solid var(--sg-hit); }
.sg-root .sg-btn--link:hover { background: var(--sg-tint); color: var(--sg-hit); }
.sg-root .sg-share-msg { font-size: 17px; font-weight: 700; color: var(--sg-hit); min-height: 1px; }
.sg-root .sg-share-text { text-align: left; white-space: pre-wrap; font-size: 16px; background: var(--sg-foam); padding: 10px; border-radius: 8px; user-select: all; }

.sg-root .sg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 8px; }
.sg-root .sg-stats div { background: var(--sg-foam); border-radius: 12px; padding: 10px 4px; }
.sg-root .sg-stats dd { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--sg-hit); }
.sg-root .sg-stats dt { font-size: 14px; line-height: 1.2; color: var(--sg-ink-soft); }
.sg-root .sg-stats div { display: flex; flex-direction: column-reverse; }

.sg-root .sg-signup { background: var(--sg-tint); border-radius: 16px; padding: 4px 14px 8px; margin: 16px 0; text-align: left; }
.sg-root .sg-signup .sg-h3 { margin-top: 14px; }
.sg-root .sg-names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sg-root .sg-label { display: block; font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.sg-root .sg-input {
  display: block; width: 100%; height: 56px; padding: 0 14px; margin: 0 0 12px;
  font-size: 19px; color: var(--sg-ink); background: var(--sg-foam);
  border: 2px solid var(--sg-line); border-radius: 12px; box-shadow: none;
}
.sg-root .sg-signup-note { font-size: 15px; color: var(--sg-ink-soft); margin: 0 0 8px; text-align: center; }
.sg-root .sg-signup-msg { font-size: 17px; font-weight: 700; min-height: 1px; margin: 0; }
.sg-root .sg-signup-done { font-size: 19px; font-weight: 700; color: var(--sg-hit); margin: 12px 0; text-align: center; }
.sg-root .sg-next { font-size: 18px; margin-top: 8px; }
.sg-root .sg-clock { font-variant-numeric: tabular-nums; font-size: 22px; }

/* ---------- ads ---------- */

.sg-root .sg-ad { text-align: center; margin: 14px auto; overflow: hidden; }
.sg-root .sg-ad iframe { display: block; margin: 0 auto; border: 0; }
.sg-root .sg-ad-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #77705f; margin: 0 0 4px; }

/* ---------- how to play ---------- */

.sg-root .sg-help {
  position: fixed; inset: 0; z-index: 2147483000; background: rgba(16, 42, 58, .6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.sg-root .sg-help-card {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--sg-card); border-radius: 20px; padding: 20px 20px 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.sg-root .sg-help .sg-h3 { margin-top: 0; font-size: 26px; }
.sg-root .sg-help-x {
  position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%; background: var(--sg-key); color: var(--sg-ink); font-size: 30px; line-height: 1;
}
.sg-root .sg-ex { display: grid; grid-template-columns: repeat(5, 48px); gap: 5px; margin: 6px 0 4px; }
.sg-root .sg-ex .sg-tile { font-size: 24px; border-radius: 10px; border-width: 2px; }
.sg-root .sg-ex .sg-mark { font-size: 12px; top: 1px; right: 3px; }
.sg-root .sg-ex-say { font-size: 17px; }

@media (max-width: 380px) {
  .sg-root .sg-game { padding: 12px 6px 16px; border-radius: 14px; }
  .sg-root .sg-tile { font-size: 28px; }
  .sg-root .sg-kb-row { gap: 4px; }
  .sg-root .sg-key { height: 56px; font-size: 19px; }
  .sg-root .sg-key--wide { font-size: 12px; }
  .sg-root .sg-stats { grid-template-columns: repeat(2, 1fr); }
  .sg-root .sg-ex { grid-template-columns: repeat(5, 42px); }
}
@media (prefers-reduced-motion: reduce) {
  .sg-root .sg-tile, .sg-root .sg-row { animation: none !important; transition: none !important; }
}
