/* Outlandle — guess the country from its outline.
 * One 480px column on a white page; every size below is in CSS pixels. */

:root {
  --line: #e5e7eb;
  --ink: #000;
  --icon: #262626;
  --muted: #737373;
  --gray-btn: #e6e7eb;
  --green: #2b8f35;
  --logo-green: #268e43;
  --pill: #c0ddfd;
  --pill-ink: #2c4d70;
  --sys: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: #fff;
  color: var(--ink);
  font-family: var(--sys);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.ol-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ol-app {
  width: 100%;
  max-width: 512px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* Wider screens: everything a touch smaller, on a white panel with a soft shadow down both sides. */
@media (min-width: 640px) {
  .ol-app, .ol-dlg, .ol-toast { zoom: 0.86; }
  .ol-app {
    max-width: 600px;
    min-height: calc(100vh / 0.86);
    padding: 0 60px 48px;
    background: #fff;
    box-shadow: 0 0 28px rgba(0, 0, 0, 0.12);
  }
}

/* ---------- header ---------- */
.ol-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding-bottom: 4px;
  margin: 0 -7px;
  border-bottom: 1px solid var(--line);
}
.ol-head-right { position: relative; display: flex; gap: 8px; }
.ol-head-left { display: flex; align-items: center; gap: 8px; }
.ol-hbtn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--icon);
  border-radius: 8px;
}
.ol-i-user { width: 20.2px; height: 21.2px; transform: translate(1px, 1.5px); }
.ol-i-stats { width: 18px; height: 17px; }
.ol-i-menu { width: 20.4px; height: 13.6px; transform: translateX(1px); }

.ol-logo {
  position: absolute;
  left: 50%;
  top: calc(50% - 2px); /* centre of the content box (header has 4px bottom padding) */
  height: 39px;
  display: flex;
  align-items: center;
  transform: translate(-50%, -50%);
  font-family: "Open Sans", var(--sys);
  font-weight: 700;
  font-size: clamp(14px, 4.6vw, 25px);
  line-height: 1;
  letter-spacing: 0.029em;
  color: #000;
  white-space: nowrap;
  user-select: none;
}
.ol-logo img { width: 0.72em; height: 0.72em; margin: 0 0.06em; flex-shrink: 0; }
.ol-logo-sub { margin-left: 0.3em; font-weight: 400; letter-spacing: 0.02em; align-self: center; }
.ol-logo > span { margin-right: -0.029em; transform: translateY(-0.2px); }
.ol-logo-l { color: var(--logo-green); }

/* hamburger menu */
.ol-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 210px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.ol-menu button, .ol-menu a {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.4;
}
.ol-menu button:hover, .ol-menu a:hover { background: #f3f4f6; }
.ol-menu button:disabled { color: #a3a3a3; cursor: default; background: none; }
.ol-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------- round switcher ---------- */
.ol-rounds {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  height: 40px;
}
.ol-nbtn {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #0b0b0b;
}
.ol-nbtn svg { width: 8px; height: 15px; }
.ol-nbtn:disabled { background: var(--gray-btn); border-color: var(--gray-btn); color: var(--muted); cursor: default; }

.ol-dd { position: relative; flex: 0 1 260px; min-width: 0; }
.ol-dd-btn {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: #000;
  white-space: nowrap;
}
.ol-dd-emoji { width: 13.6px; height: 13.2px; flex: none; margin-right: 9.6px; transform: translateY(0.3px); }

/* ---------- silhouette ---------- */
.ol-sil { width: 280px; height: 280px; max-width: 100%; margin: 16px auto 0; }
.ol-sil svg { width: 100%; height: 100%; overflow: visible; }

/* ---------- answer pill ---------- */
.ol-pill {
  width: fit-content;
  max-width: 100%;
  height: 38.5px;
  margin: 16px auto 0;
  padding: 0 16px;
  border-radius: 11px;
  background: var(--pill);
  color: var(--pill-ink);
  font-size: 16px;
  line-height: 36.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ol-pill b { font-weight: 600; }

/* ---------- guess entry (in the pill's place while playing) ---------- */
.ol-entry { display: flex; gap: 8px; height: 40px; margin-top: 16px; position: relative; z-index: 10; }
.ol-combo { position: relative; flex: 1; min-width: 0; }
.ol-combo input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 16px; /* 16px stops iOS zooming in */
  outline: none;
}
.ol-combo input::placeholder { color: #9ca3af; }
.ol-combo input:focus { border-color: #9ca3af; }
.ol-guess {
  flex: none;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 600;
}
.ol-guess:hover, .ol-play:hover { filter: brightness(1.06); }
.ol-entry.shake { animation: ol-shake 0.35s ease; }
@keyframes ol-shake {
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

.ol-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  list-style: none;
  max-height: min(264px, 42vh);
  overflow-y: auto;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.ol-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
}
.ol-list li em { font-style: normal; font-size: 13px; color: var(--muted); }
.ol-list li mark { background: none; color: inherit; font-weight: 600; }
.ol-list li[aria-selected="true"] { background: #f3f4f6; }
.ol-list li.is-used { color: #a3a3a3; }
.ol-list li.is-used::after { content: "guessed"; margin-left: auto; font-size: 12px; }
.ol-list .ol-empty { color: var(--muted); cursor: default; }

/* ---------- guesses ---------- */
.ol-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 16px;
}
.ol-cell {
  height: 31.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 9.5px;
  font-size: 16px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
}
.ol-c-name { grid-column: span 3; text-overflow: ellipsis; display: block; text-align: center; line-height: 29.5px; }
.ol-c-dist { grid-column: span 2; }
.ol-c-empty { grid-column: span 7; }
.ol-c-dir svg { width: 14.8px; height: 14.4px; }

/* ---------- after the round ---------- */
.ol-play {
  width: 100%;
  height: 39px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.ol-play svg { width: 6px; height: 11px; margin-right: 7px; }

.ol-links { display: flex; gap: 16px; height: 39px; margin-top: 16px; }
.ol-sq, .ol-share {
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
}
.ol-sq { flex: none; width: 40px; }
.ol-i-wiki { width: 28px; height: 26px; }
.ol-i-maps { width: 17.6px; height: 24.6px; }
.ol-share { flex: 1; min-width: 0; gap: 12px; font-size: 16px; font-weight: 500; color: #000; }
.ol-i-share { width: 17px; height: 18.4px; flex: none; }
.ol-sq:hover, .ol-share:hover, .ol-nbtn:not(:disabled):hover { background: #f9fafb; }

/* ---------- dialogs ---------- */
.ol-dlg {
  border: 0;
  padding: 0;
  margin: auto;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border-radius: 12px;
  background: #fff;
  color: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.ol-dlg[open] { display: flex; flex-direction: column; }
.ol-dlg::backdrop { background: rgba(0, 0, 0, 0.35); }
.ol-dlg-sm { width: min(340px, calc(100vw - 32px)); }
.ol-dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.ol-dlg-head h2 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.ol-x { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--icon); margin-right: -6px; }
.ol-x svg { width: 14px; height: 14px; }
.ol-x:hover { background: #f3f4f6; }
.ol-dlg-body { padding: 14px 16px 16px; overflow-y: auto; }
.ol-prose p { font-size: 15px; line-height: 1.5; margin-bottom: 10px; }
.ol-prose p:last-child { margin-bottom: 0; }
.ol-muted { color: #525252; font-size: 14px !important; }
.ol-demo { margin: 4px 0 12px; }
.ol-credit { padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted) !important; font-size: 12.5px !important; }

/* stats */
.ol-stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.ol-stat-tiles div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px 6px; }
.ol-stat-tiles b { display: block; font-size: 22px; font-weight: 600; line-height: 1.2; }
.ol-stat-tiles span { font-size: 12px; color: var(--muted); }
.ol-dist-title { margin: 16px 0 8px; font-size: 15px; font-weight: 600; }
.ol-dist { display: grid; gap: 4px; }
.ol-dist-row { display: grid; grid-template-columns: 14px 1fr; align-items: center; gap: 8px; font-size: 14px; }
.ol-dist-bar {
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: #d4d4d4;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.ol-dist-row.is-now .ol-dist-bar { background: var(--green); }

/* settings */
.ol-set { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ol-set:first-child { padding-top: 2px; }
.ol-set:last-child { border-bottom: 0; padding-bottom: 0; }
.ol-set label { cursor: pointer; }
.ol-set strong { display: block; font-size: 15px; font-weight: 600; }
.ol-set em { display: block; font-style: normal; font-size: 13px; color: var(--muted); }
.ol-switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #d4d4d4;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.ol-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.ol-switch:checked { background: var(--green); }
.ol-switch:checked::after { transform: translateX(18px); }
.ol-seg { display: inline-flex; flex: none; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 8px; }
.ol-seg button { padding: 4px 12px; border-radius: 6px; font-size: 14px; color: #525252; }
.ol-seg button[aria-checked="true"] { background: var(--gray-btn); color: #000; font-weight: 500; }

/* confirm */
.ol-confirm { text-align: center; padding: 20px 16px 16px; }
.ol-confirm h2 { font-size: 18px; font-weight: 600; }
.ol-confirm p { margin-top: 4px; font-size: 15px; color: #525252; }
.ol-confirm-btns { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.ol-btn-plain, .ol-btn-green { height: 40px; padding: 0 16px; border-radius: 8px; font-weight: 600; }
.ol-btn-plain { border: 1px solid var(--line); }
.ol-btn-green { background: var(--green); color: #fff; }

/* toast */
.ol-toast {
  position: fixed;
  left: 50%;
  top: 56px;
  z-index: 50;
  transform: translate(-50%, -8px);
  max-width: calc(100vw - 32px);
  padding: 8px 14px;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.ol-toast.show { opacity: 1; transform: translate(-50%, 0); }

.ol-fatal { padding: 40px 0; text-align: center; }

/* phones: slimmer header buttons leave room for the logo */
@media (max-width: 480px) {
  .ol-hbtn { width: 36px; }
  .ol-head-right { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* footer links */
.ol-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 16px 32px; font-size: 14px; color: #888; }
.ol-foot a { color: #555; text-decoration: none; }
.ol-foot a:hover { text-decoration: underline; }
.ol-foot-links { display: flex; gap: 10px; }
.ol-foot-giveup { font: inherit; color: #555; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 14px; cursor: pointer; }
.ol-foot-giveup:hover:not(:disabled) { background: #f3f4f6; }
.ol-foot-giveup:disabled { opacity: .45; cursor: default; }
