:root {
  color-scheme: dark;
}

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  font-family: "Montserrat", Arial, sans-serif;
  background: #050505;
  color: #f5f5f2;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #050505;
}

html.app-loading body { visibility: hidden; }

body {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #050505;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

#legal-links {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  display: none;
  width: max-content;
  max-width: calc(100vw - 28px);
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: clamp(10px, 3.5vw, 18px);
  row-gap: 8px;
  transform: translateX(-50%);
  color: #777773;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: .02em;
}

body.is-home #legal-links { display: flex; }

#legal-links a,
#legal-links button {
  flex: 0 0 auto;
  white-space: nowrap;
}

#legal-links a:hover,
#legal-links a:focus-visible,
#legal-links button:hover,
#legal-links button:focus-visible,
.legal-notice a:hover,
.legal-notice a:focus-visible { color: #f5f5f2; outline: none; }

#legal-links button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.legal-notice {
  margin: 2px 0 4px;
  color: #777773;
  font-size: 11px;
  line-height: 1.55;
  font-weight: 600;
  text-align: center;
}

.legal-notice a { text-underline-offset: 2px; }

.account-form .legal-consent {
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 11px;
  color: #777773;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
  cursor: pointer;
}

.account-form .legal-consent input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid #5f5f5c;
  border-radius: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.account-form .legal-consent input:checked {
  border-color: #f5f5f2;
  background: #f5f5f2;
  box-shadow: inset 0 0 0 4px #050505;
}

.account-form .legal-consent input:focus-visible {
  border-color: #f5f5f2;
  outline: 1px solid #f5f5f2;
  outline-offset: 3px;
}

.legal-consent a { color: #b7b7b2; text-underline-offset: 2px; }
.legal-consent a:hover,
.legal-consent a:focus-visible { color: #f5f5f2; outline: none; }

#cookie-banner {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: max(18px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) max(18px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}

#cookie-banner-card {
  width: min(760px, 100%);
  margin: 0;
  border: 1px solid #343432;
  padding: clamp(20px, 3vw, 30px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  background: #050505;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .55);
  pointer-events: auto;
}

.cookie-banner-copy h2 {
  margin: 0 0 12px;
  color: #f5f5f2;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -.05em;
}

.cookie-banner-copy p {
  margin: 0;
  color: #92928e;
  font-size: 12px;
  line-height: 1.65;
}

.cookie-banner-copy a { color: #f5f5f2; text-underline-offset: 2px; }
.cookie-banner-actions { display: grid; min-width: 168px; gap: 8px; }
.cookie-banner-actions button {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid #f5f5f2;
  padding: 9px 13px;
  background: transparent;
  color: #f5f5f2;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}

#accept-analytics { background: #f5f5f2; color: #050505; }
.cookie-banner-actions button:hover,
.cookie-banner-actions button:focus-visible { outline: 2px solid #777773; outline-offset: 2px; }
#close-cookie-settings { border-color: transparent; color: #777773; }

body {
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
}

header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 18px 20px 0;
}

.site-title { display: contents; }

#back, #home, #progress {
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #f5f5f2;
  font-size: 16px;
  line-height: 0.88;
  font-weight: 700;
  letter-spacing: -0.055em;
}

#back {
  grid-column: 1;
  justify-self: start;
  color: #777773;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -0.02em;
  cursor: pointer;
}

#back:hover,
#back:focus-visible { color: #f5f5f2; outline: none; }

#home {
  grid-column: 2;
  cursor: pointer;
  text-align: left;
}

#home span {
  display: block;
}

body.is-home header {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: block;
  height: auto;
  padding: 0;
  pointer-events: none;
}

body.is-home {
  grid-template-rows: minmax(0, 1fr);
}

body.is-home #home {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  font-size: clamp(38px, 4.8vw, 70px);
  white-space: nowrap;
}

body.is-home #modes {
  transform: translateY(88px);
}

#progress {
  grid-column: 3;
  justify-self: end;
  min-width: 3.6ch;
  padding-right: 2px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.04em;
}

#account-button {
  position: fixed;
  z-index: 12;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #343432;
  border-radius: 50%;
  padding: 0;
  background: #050505;
  color: #777773;
  cursor: pointer;
  pointer-events: auto;
}

#account-button:hover,
#account-button:focus-visible { border-color: #f5f5f2; color: #f5f5f2; outline: none; }
#account-button span { font-size: 11px; line-height: 1; letter-spacing: -0.02em; }

main {
  position: relative;
  min-height: 0;
}

#modes {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding-top: 10vh;
}

#modes button {
  border: 0;
  padding: 10px 14px;
  background: transparent;
  color: #f5f5f2;
  font-size: clamp(29px, 4vw, 58px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.045em;
  cursor: pointer;
}

#modes button[data-mode]:hover,
#modes button[data-mode]:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 0.055em;
  text-underline-offset: 0.08em;
}

.coming-soon {
  position: relative;
  color: #5f5f5c;
  cursor: default;
  text-align: center;
}

.coming-soon .coming-label {
  display: block;
  opacity: 1;
  transition: opacity 240ms ease;
}

.coming-soon small {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: max-content;
  margin: 0;
  transform: translate(-50%, -50%);
  opacity: 0;
  color: #5f5f5c;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.coming-soon.is-revealing .coming-label { opacity: 0; }
.coming-soon.is-revealing small {
  opacity: 1;
  font-size: clamp(14px, 1.4vw, 20px);
}

.puzzle {
  position: absolute;
  inset: 0;
  max-width: 100%;
  overflow: hidden;
  touch-action: none;
}

.puzzle input { touch-action: manipulation; }

body:not(.is-home) #home {
  color: #f5f5f2;
}

#solo {
  display: grid;
  place-items: center;
  padding: 18px;
}

#solo[hidden], #modes[hidden] { display: none; }

#keyboard-toggle {
  display: none;
  position: fixed;
  z-index: 8;
  right: 16px;
  bottom: 56px;
  width: auto;
  height: 40px;
  border: 1px solid #343432;
  border-radius: 0;
  padding: 0 12px;
  background: #050505;
  color: #8c8c88;
  font-family: Arial, sans-serif;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.keyboard-icon { font-size: 21px; }
.keyboard-label { font-family: inherit; font-size: 11px; font-weight: 600; }

#keyboard-toggle:hover,
#keyboard-toggle:focus-visible,
#keyboard-toggle:focus-within {
  border-color: #f5f5f2;
  color: #f5f5f2;
  outline: none;
}

#keyboard-input {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 1px;
  border: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  font-size: 16px;
}

#turnstile-container {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: min(300px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
}

#turnstile-container:empty {
  display: none;
}

#finished {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: clamp(9px, 1.35vh, 14px);
  padding: clamp(20px, 3.5vh, 38px) 18px 24px;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#finished h2,
#paywall-card h2 {
  margin: 0;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: -0.06em;
}

#completion-stats {
  width: min(390px, 86vw);
  display: grid;
  gap: 8px;
  margin-top: 0;
  font-variant-numeric: tabular-nums;
}

.result-primary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.result-primary span,
.result-comparison span {
  color: #777773;
  font-size: 13px;
}

.result-primary strong {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.result-comparison {
  min-height: 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  color: #777773;
  font-size: 13px;
}

.result-comparison strong {
  color: #f5f5f2;
  font-size: 15px;
}

.result-number {
  color: #777773;
  font-size: 12px;
  text-align: right;
}

.preview-numbers i { font-style: normal; }

#retry,
#more,
#solo-more,
#share-result,
#share-image,
#close-paywall,
.archive-item {
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: #f5f5f2;
  font-weight: 600;
  cursor: pointer;
}

#retry,
#more,
#solo-more,
#share-result,
#share-image {
  font-size: 20px;
  line-height: 1;
}

#share-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

#retry:hover,
#more:hover,
#solo-more:hover,
#share-result:hover,
#share-image:hover,
#close-paywall:hover,
.archive-item:hover {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

#archive {
  width: min(660px, 90vw);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 2px;
}

#solo-hub {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: clamp(52px, 9vh, 90px) 18px 70px;
}

#solo-hub h2 {
  width: min(760px, 90vw);
  margin: 0 auto 26px;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

#solo-list {
  width: min(760px, 90vw);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0 auto;
}

#solo-today {
  width: min(760px, 90vw);
  margin: 0 auto 24px;
}

#solo-today .archive-item { width: calc((100% - 36px) / 3); }

#solo-more {
  display: block;
  margin: 30px auto 0;
}

.archive-item {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 0;
  text-align: left;
}

.puzzle-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #292927;
  background: #090909;
}

.puzzle-card-meta {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px;
}

.puzzle-card-date,
.puzzle-card-status,
.puzzle-card-premiere {
  color: #777773;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.puzzle-card-status,
.puzzle-card-premiere {
  justify-self: end;
  white-space: nowrap;
}

.preview-leaf { background: #fff url('/leaf.jpg') center / cover no-repeat; }
.preview-where::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 22%;
  width: 58%;
  border-bottom: 1px solid #4a4a47;
  transform: translateX(-50%);
}
.preview-dial::before { content: '0'; position: absolute; left: 50%; top: 50%; width: 52%; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #666; border-radius: 50%; color: #f5f5f2; font-size: 22px; transform: translate(-50%, -50%); box-shadow: 0 0 0 18px #111, 0 0 0 19px #666; }
.preview-numbers { display: grid; grid-template-columns: repeat(8, 1fr); place-items: center; padding: 12%; color: #d7d7d3; font-size: 7px; }
.preview-light {
  display: grid;
  place-items: center;
  background: linear-gradient(90deg, #090909 0 50%, #f5f5f2 50% 100%);
}
.preview-light-switch {
  position: relative;
  z-index: 2;
  width: 18%;
  aspect-ratio: 0.58;
  display: block;
  border: 2px solid #777773;
  background: #f5f5f2;
  box-shadow: inset 0 -9px 0 #8a8a86;
}
.preview-light-number {
  position: absolute;
  color: #f5f5f2;
  font-size: clamp(13px, 1.8vw, 21px);
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  transform: translate(-50%, -50%);
}
.preview-light-number:nth-of-type(3) { color: #050505; }
.preview-chat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 16%;
}
.preview-chat i {
  display: block;
  max-width: 72%;
  padding: 7px 10px;
  border-radius: 13px;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}
.preview-chat-incoming { align-self: flex-start; background: #2c2c2e; }
.preview-chat-outgoing { align-self: flex-end; background: #0a84ff; }
.preview-then { display: grid; place-content: center; justify-items: center; gap: 10%; }
.preview-then-word { color: #a3a39e; font-size: clamp(9px, 1.35vw, 16px); font-style: normal; font-weight: 600; letter-spacing: .2em; }
.preview-calculator { display: grid; place-items: center; background: #090909; }
.preview-calculator-screen { color: #a3a39e; font-family: ui-monospace, monospace; font-size: clamp(16px, 2.4vw, 28px); font-style: normal; font-weight: 600; letter-spacing: .02em; }
.preview-balance { display: grid; place-items: center; }
.preview-balance-svg { width: 76%; height: 76%; fill: rgba(18, 18, 18, .8); stroke: #898985; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.preview-balance-svg circle { fill: #090909; stroke: #acaca7; stroke-width: 2; }

.archive-item.is-locked .puzzle-card-preview > :not(.puzzle-card-lock) {
  opacity: 1;
  transition: opacity .38s ease;
}

.puzzle-card-lock {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #050505;
  color: #f5f5f2;
  font-size: clamp(12px, 1.35vw, 16px);
  font-style: normal;
  font-weight: 700;
  opacity: 0;
  text-align: center;
  transition: opacity .38s ease;
}

.archive-item.is-upselling .puzzle-card-preview > :not(.puzzle-card-lock) { opacity: 0; }
.archive-item.is-upselling .puzzle-card-lock { opacity: 1; }
.archive-item.is-upselling:hover .puzzle-card-lock,
.archive-item.is-upselling:focus-visible .puzzle-card-lock { text-decoration: underline; text-underline-offset: .18em; }

#current-card { width: min(210px, 68vw); }
#current-card .archive-item { cursor: default; }

#account-panel {
  position: fixed;
  z-index: 40;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(70px, 10vh, 110px) max(22px, env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) max(22px, env(safe-area-inset-left, 0px));
  background: #050505;
}

#close-account {
  position: fixed;
  z-index: 2;
  top: calc(18px + env(safe-area-inset-top, 0px));
  left: max(20px, env(safe-area-inset-left, 0px));
  border: 0;
  padding: 10px 0;
  background: transparent;
  color: #777773;
  font-size: 14px;
  cursor: pointer;
}

#account-guest,
#account-profile { width: min(520px, 100%); margin: 0 auto; }
.account-switch { display: flex; gap: 22px; margin-bottom: 38px; }
.account-switch button,
.account-form button,
#logout {
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: #f5f5f2;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}
.profile-actions { display: flex; align-items: center; gap: 16px; }
#delete-account {
  border: 0;
  border-radius: 2px;
  padding: 8px 12px;
  background: #b83232;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
#delete-account:hover,
#delete-account:focus-visible,
#confirm-delete-account:hover,
#confirm-delete-account:focus-visible { background: #d13d3d; outline: none; }

#delete-account-modal {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) max(22px, env(safe-area-inset-bottom, 0px)) max(22px, env(safe-area-inset-left, 0px));
  background: rgba(5, 5, 5, .88);
}

#delete-account-card {
  width: min(500px, 100%);
  border: 1px solid #343432;
  padding: clamp(24px, 5vw, 42px);
  background: #050505;
}

#delete-account-card h2 {
  margin: 0 0 22px;
  color: #f5f5f2;
  font-size: clamp(34px, 6vw, 54px);
  line-height: .95;
  letter-spacing: -.055em;
}

#delete-account-card p { margin: 0 0 16px; color: #92928e; font-size: 13px; line-height: 1.65; }
#delete-account-card #delete-account-message { min-height: 20px; margin-top: 22px; color: #d76a6a; }
.delete-account-actions { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.delete-account-actions button { border: 0; font-size: 16px; font-weight: 600; cursor: pointer; }
#confirm-delete-account { padding: 11px 14px; background: #b83232; color: #fff; }
#cancel-delete-account { padding: 8px 0; background: transparent; color: #f5f5f2; }
.delete-account-actions button:disabled { opacity: .45; cursor: wait; }
.account-switch button[aria-selected="false"] { color: #5f5f5c; }
.account-form { display: grid; gap: 22px; }
.account-form label { display: grid; gap: 8px; color: #777773; font-size: 13px; font-weight: 600; }
.account-form input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #343432;
  border-radius: 0;
  padding: 10px 0;
  background: transparent;
  color: #f5f5f2;
  font: inherit;
  font-size: 18px;
  outline: none;
}
.account-form input:focus { border-bottom-color: #f5f5f2; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 42px; }
.account-form .password-toggle {
  position: absolute;
  right: 0;
  bottom: 6px;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #777773;
}
.password-toggle::before {
  content: '';
  position: absolute;
  inset: 9px 5px;
  border: 1.5px solid currentColor;
  border-radius: 70% 15%;
  transform: rotate(45deg);
}
.password-toggle::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.password-toggle[aria-pressed="true"] { color: #f5f5f2; }
.password-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: -8px 0 0;
  padding: 0;
  color: #5f5f5c;
  font-size: 12px;
  font-weight: 600;
  list-style: none;
}
.password-requirements li { transition: color .18s ease; }
.password-requirements li::before { content: '○'; display: inline-block; width: 18px; }
.password-requirements li.is-complete { color: #b8b8b4; }
.password-requirements li.is-complete::before { content: '✓'; }
.account-form .account-text-action {
  justify-self: start;
  margin-top: -16px;
  padding: 0;
  color: #777773;
  font-size: 13px;
  font-weight: 600;
}
.account-form .account-text-action:hover,
.account-form .account-text-action:focus-visible { color: #f5f5f2; outline: none; }
.avatar-picker { min-width: 0; margin: 0; border: 0; padding: 0; }
.avatar-picker legend { margin-bottom: 12px; color: #777773; font-size: 13px; font-weight: 600; }
.avatar-picker > div {
  display: grid;
  grid-template-columns: repeat(6, 48px);
  justify-content: space-between;
  gap: 10px 0;
}
.avatar-option { position: relative; width: 100%; max-width: 48px; aspect-ratio: 1; }
.avatar-option input { position: absolute; opacity: 0; pointer-events: none; }
.avatar,
.avatar-option span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid #343432;
  border-radius: 50%;
  background: #0b0b0b;
  color: #f5f5f2;
  font-size: 17px;
  overflow: hidden;
}
.avatar img,
.avatar-option img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-option input:checked + span { border-color: #f5f5f2; box-shadow: 0 0 0 2px #050505, 0 0 0 3px #f5f5f2; }
#account-message, #profile-message { min-height: 20px; margin: 24px 0 0; color: #777773; font-size: 13px; line-height: 1.5; }
.profile-identity { display: flex; align-items: center; gap: 16px; margin-bottom: 30px; }
.profile-identity > .avatar { width: 58px; height: 58px; flex: 0 0 auto; }
.profile-identity strong, .profile-identity small { display: block; }
.profile-name-line { display: flex; align-items: center; gap: 10px; }
.profile-identity strong { font-size: 24px; }
.profile-identity small { margin-top: 4px; color: #777773; font-size: 13px; }
.everything-mark {
  position: relative;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: block;
  border-radius: 1px;
  background: #f5f5f2;
  outline: none;
  cursor: help;
}
.everything-mark::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid #050505;
}
.everything-mark::after {
  content: 'Everything.';
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  border: 1px solid #343432;
  padding: 5px 7px;
  background: #050505;
  color: #f5f5f2;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
}
.everything-mark:hover::after,
.everything-mark:focus-visible::after { opacity: 1; }
.profile-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 34px; background: #292927; }
.profile-stat { position: relative; min-width: 0; padding: 14px 10px; background: #050505; }
.profile-stat strong, .profile-stat span { display: block; }
.profile-stat strong { font-size: 22px; }
.profile-stat span { margin-top: 5px; color: #777773; font-size: 11px; }
.profile-stat-label { position: relative; outline: none; }
.profile-stat-label::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(220px, 72vw);
  border: 1px solid #343432;
  padding: 6px 8px;
  background: #050505;
  color: #f5f5f2;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
}
.profile-stat:nth-child(odd) .profile-stat-label::after { left: 0; transform: none; }
.profile-stat:nth-child(even) .profile-stat-label::after { right: 0; left: auto; transform: none; }
.profile-stat-label:hover::after,
.profile-stat-label:focus-visible::after { opacity: 1; }
.profile-history { margin: 42px 0 28px; }
.profile-calendar { width: 100%; }
.profile-calendar-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin-bottom: 14px;
}
.profile-calendar-header strong {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
.profile-calendar-header button {
  width: 44px;
  height: 44px;
  border: 1px solid #343432;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #f5f5f2;
  font-size: 17px;
  cursor: pointer;
}
.profile-calendar-header button:last-child { justify-self: end; }
.profile-calendar-header button:disabled { color: #3e3e3b; cursor: default; }
.profile-calendar-header button:not(:disabled):hover,
.profile-calendar-header button:not(:disabled):focus-visible {
  border-color: #f5f5f2;
  outline: none;
}
.profile-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.profile-calendar-weekday {
  display: grid;
  place-items: center;
  min-height: 28px;
  color: #666662;
  font-size: 12px;
  font-weight: 600;
}
.profile-calendar-day,
.profile-calendar-empty {
  aspect-ratio: 1;
  min-width: 0;
}
.profile-calendar-day {
  display: grid;
  place-items: center;
  border: 1px solid #292927;
  border-radius: 0;
  padding: 0;
  background: #050505;
  color: #666662;
  font-family: inherit;
  font-size: clamp(12px, 2.5vw, 14px);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.profile-calendar-day.has-puzzle {
  color: #aaa9a5;
  cursor: pointer;
}
.profile-calendar-day.has-puzzle:not(.is-solved):hover,
.profile-calendar-day.has-puzzle:not(.is-solved):focus-visible {
  border-color: #aaa9a5;
  color: #f5f5f2;
  outline: none;
}
.profile-calendar-day.is-solved {
  border-color: #f5f5f2;
  background: #f5f5f2;
  color: #050505;
  font-weight: 700;
}
.profile-calendar-day.is-solved:hover,
.profile-calendar-day.is-solved:focus-visible {
  outline: 2px solid #f5f5f2;
  outline-offset: 2px;
}
#logout { color: #777773; }

#paywall {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.82);
}

#paywall-card {
  width: min(430px, 92vw);
  padding: 38px;
  border: 1px solid #f5f5f2;
  background: #050505;
  text-align: center;
}

#paywall-card p {
  margin: 0 0 30px;
  color: #aaa9a4;
  font-size: 16px;
  line-height: 1.45;
}

#paywall-card #paywall-message {
  min-height: 20px;
  margin: -14px 0 18px;
  color: #777773;
  font-size: 13px;
}

#paywall-card #paywall-message:empty { display: none; }

#buy-everything {
  display: block;
  width: 100%;
  margin-bottom: 22px;
  border: 1px solid #f5f5f2;
  padding: 13px 18px;
  background: #f5f5f2;
  color: #050505;
  font-size: 16px;
  font-weight: 700;
}
#buy-everything:hover, #buy-everything:focus-visible { background: #050505; color: #f5f5f2; outline: none; }
#buy-everything:disabled { opacity: .55; cursor: wait; }

#close-paywall {
  font-size: 16px;
}

#show-promo-code {
  display: block;
  margin: 14px auto 0;
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: #777773;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#show-promo-code:hover,
#show-promo-code:focus-visible { color: #f5f5f2; outline: none; }

#promo-code-form { margin-top: 14px; }

#promo-code-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #777773;
  border-radius: 0;
  padding: 10px 4px;
  background: transparent;
  color: #f5f5f2;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

#promo-code-input:focus { border-bottom-color: #f5f5f2; outline: none; }

#paywall-card #promo-code-message {
  min-height: 18px;
  margin: 10px 0 0;
  color: #777773;
  font-size: 13px;
}

#everything-archive {
  position: fixed;
  z-index: 21;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.9);
}

#everything-archive-card {
  width: min(1060px, 94vw);
  max-height: min(860px, 90dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #292927;
  padding: clamp(24px, 4vw, 48px);
  background: #050505;
}

.everything-archive-heading {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 34px;
}

.everything-archive-heading h2 {
  grid-column: 2;
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

#close-everything-archive {
  grid-column: 1;
  justify-self: start;
  border: 0;
  padding: 10px 0;
  background: transparent;
  color: #777773;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#close-everything-archive:hover,
#close-everything-archive:focus-visible { color: #f5f5f2; outline: none; }

#everything-ranges {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 24px;
}

#everything-ranges button,
#everything-period button {
  min-width: 58px;
  height: 38px;
  border: 1px solid #292927;
  border-radius: 0;
  padding: 0 12px;
  background: transparent;
  color: #777773;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

#everything-ranges button[aria-pressed="true"] {
  border-color: #f5f5f2;
  background: #f5f5f2;
  color: #050505;
}

#everything-ranges button:not([aria-pressed="true"]):hover,
#everything-ranges button:not([aria-pressed="true"]):focus-visible,
#everything-period button:not(:disabled):hover,
#everything-period button:not(:disabled):focus-visible {
  border-color: #aaa9a5;
  color: #f5f5f2;
  outline: none;
}

#everything-period {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  width: min(760px, 100%);
  margin: 0 auto 20px;
}

#everything-period strong {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

#everything-period button {
  min-width: 44px;
  width: 44px;
  padding: 0;
}

#everything-period button:last-child { justify-self: end; }
#everything-period button:disabled { color: #343432; cursor: default; }

#everything-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: min(900px, 100%);
  margin: 0 auto;
}

.everything-empty {
  grid-column: 1 / -1;
  margin: 60px 0;
  color: #777773;
  text-align: center;
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.045em;
}

  @media (max-width: 540px) {
  body { grid-template-rows: calc(70px + env(safe-area-inset-top, 0px)) minmax(0, 1fr); }
  body.is-home { grid-template-rows: minmax(0, 1fr); }
  header {
    grid-template-columns: 1fr auto 1fr;
    padding: calc(17px + env(safe-area-inset-top, 0px)) max(15px, env(safe-area-inset-right, 0px)) 0 max(15px, env(safe-area-inset-left, 0px));
  }
  #home { grid-column: 2; justify-self: center; }
  body.is-home #home {
    left: 50%;
    top: calc(38% - 40px);
    font-size: clamp(36px, 12vw, 52px);
  }
  #progress { grid-column: 3; }
  #account-button { top: calc(14px + env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); }
  #modes button { font-size: clamp(29px, 11vw, 50px); }
  body.is-home #modes { transform: translateY(24px); }
  .coming-soon.is-revealing small { font-size: clamp(13px, 4vw, 17px); }
  #finished {
    gap: 9px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px));
  }
  #finished h2 { font-size: clamp(38px, 11vw, 48px); }
  #finished #current-card { width: min(180px, 52vw); }
  #finished #archive {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  #finished #archive .puzzle-card-meta > span { font-size: clamp(8px, 2.2vw, 10px); }
  #solo-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  #solo-today { width: min(760px, 90vw); margin-bottom: 20px; }
  #solo-today .archive-item { width: calc((100% - 18px) / 3); }
  #solo-list .puzzle-card-meta > span,
  #solo-today .puzzle-card-meta > span { font-size: clamp(8px, 2.4vw, 11px); }
  .profile-summary { grid-template-columns: repeat(2, 1fr); }
  .avatar-picker > div { grid-template-columns: repeat(6, minmax(42px, 48px)); justify-content: space-between; column-gap: 0; }
  #retry, #more, #solo-more, #close-paywall { min-width: 44px; min-height: 44px; }
  #paywall { padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
  #everything-archive {
    place-items: stretch;
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }
  #everything-archive-card { width: 100%; max-height: 100%; padding: 22px 16px 32px; }
  .everything-archive-heading { margin-bottom: 26px; }
  #everything-ranges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
  #everything-ranges button { min-width: 0; padding: 0 5px; }
  #everything-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  #cookie-banner {
    padding: max(10px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  }
  #cookie-banner-card { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
  .cookie-banner-actions { grid-template-columns: 1fr 1fr; min-width: 0; }
  #close-cookie-settings { grid-column: 1 / -1; }
}

@media (min-width: 541px) and (min-height: 720px) {
  #finished { overflow-y: hidden; }
}

@media (hover: none) and (pointer: coarse) {
  #keyboard-toggle:not([hidden]) {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  body.turnstile-active #keyboard-toggle {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  body.is-home #home {
    top: 18%;
    font-size: clamp(28px, 4vw, 34px);
  }
  body.is-home #modes {
    gap: 0;
    padding-top: 0;
    transform: translateY(42px);
  }
  #modes button {
    padding: 4px 12px;
    font-size: clamp(24px, 3.8vw, 32px);
  }
}
