:root {
  color-scheme: dark;
  --bg: #07110f;
  --bg-deep: #040a09;
  --surface: rgba(14, 28, 25, 0.78);
  --surface-solid: #0d1b18;
  --surface-raised: #122520;
  --surface-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(206, 255, 235, 0.11);
  --line-strong: rgba(206, 255, 235, 0.2);
  --text: #eefcf5;
  --muted: #91aaa0;
  --subtle: #647d73;
  --green: #77f2b4;
  --green-deep: #31c982;
  --mint: #b9ffd8;
  --cyan: #71e6e1;
  --purple: #a995ff;
  --danger: #ff7f91;
  --warning: #ffd27a;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.18);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --header-height: 72px;
  --max-width: 1180px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #edf6f1;
  --bg-deep: #e3eee8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-raised: #f4fbf7;
  --surface-soft: rgba(5, 39, 29, 0.045);
  --line: rgba(5, 39, 29, 0.11);
  --line-strong: rgba(5, 39, 29, 0.2);
  --text: #10261f;
  --muted: #567066;
  --subtle: #748a82;
  --green: #20a66b;
  --green-deep: #158b58;
  --mint: #0f7147;
  --cyan: #168f91;
  --purple: #6755c7;
  --danger: #c93c55;
  --warning: #a56509;
  --shadow: 0 28px 80px rgba(23, 56, 43, 0.13);
  --shadow-soft: 0 16px 38px rgba(23, 56, 43, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(44, 214, 139, 0.09), transparent 30rem),
    radial-gradient(circle at 88% 35%, rgba(98, 215, 211, 0.06), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient,
.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.ambient {
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.09;
}

.ambient-one {
  top: 7%;
  left: -250px;
  background: var(--green);
}

.ambient-two {
  top: 52%;
  right: -280px;
  left: auto;
  background: var(--cyan);
}

.noise {
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding: 10px max(18px, env(safe-area-inset-left)) 10px max(18px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(22px) saturate(1.25);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(119, 242, 180, 0.3);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(119, 242, 180, 0.17), rgba(113, 230, 225, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 9px 24px rgba(31, 190, 117, 0.1);
  color: var(--green);
}

.brand-mark svg {
  width: 23px;
  stroke: none;
  fill: currentColor;
}

.brand-name {
  font-size: 1.03rem;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.brand-name span {
  color: var(--green);
}

.main-nav {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-status {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.status-dot,
.sync-state i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 12%, transparent);
}

.header-status.is-online .status-dot,
.sync-state.is-synced i {
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 13%, transparent), 0 0 15px color-mix(in srgb, var(--green) 50%, transparent);
}

.header-status.is-offline .status-dot,
.sync-state.is-offline i,
.sync-state.is-error i {
  background: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 12%, transparent);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
  transform: translateY(-1px);
}

.icon-button:active {
  transform: translateY(0) scale(0.98);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.icon-button.labelled {
  width: auto;
  min-width: 42px;
  gap: 7px;
  padding: 0 11px;
  font-size: 0.76rem;
  font-weight: 750;
}

.icon-button.labelled span {
  display: none;
}

.icon-button.danger:hover {
  border-color: color-mix(in srgb, var(--danger) 38%, transparent);
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  color: var(--danger);
}

.sun-icon,
html[data-theme="dark"] .sun-icon {
  display: none;
}

html[data-theme="light"] .sun-icon {
  display: block;
}

html[data-theme="light"] .moon-icon {
  display: none;
}

main,
.site-footer {
  width: min(var(--max-width), calc(100% - 36px));
  margin-inline: auto;
}

.hero {
  display: grid;
  min-height: min(790px, calc(100svh - var(--header-height)));
  align-items: center;
  gap: 42px;
  padding: 76px 0 86px;
}

.hero-copy {
  max-width: 690px;
}

.eyebrow,
.section-kicker,
.tool-label,
.game-chip {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border: 1px solid rgba(119, 242, 180, 0.18);
  border-radius: 999px;
  background: rgba(119, 242, 180, 0.055);
}

.eyebrow-pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

.eyebrow-pulse::after {
  position: absolute;
  inset: -4px;
  border: 1px solid var(--green);
  border-radius: inherit;
  content: "";
  animation: pulse 2.2s ease-out infinite;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin: 24px 0 20px;
  font-size: clamp(3.35rem, 14vw, 6.8rem);
  font-weight: 880;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.gradient-text {
  color: var(--green);
  background: linear-gradient(100deg, var(--green), var(--cyan) 58%, var(--mint));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  max-width: 620px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: clamp(1.03rem, 3vw, 1.25rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 820;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button svg {
  width: 19px;
  height: 19px;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0) scale(0.985);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--green), #4cd99a);
  color: #062116;
  box-shadow: 0 12px 32px rgba(51, 218, 141, 0.17);
}

.button-primary:hover {
  box-shadow: 0 15px 38px rgba(51, 218, 141, 0.25);
}

html[data-theme="light"] .button-primary {
  color: #fff;
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.button.compact {
  min-height: 42px;
  padding-inline: 14px;
  font-size: 0.82rem;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 19px;
  padding: 0;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  list-style: none;
}

.trust-list li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.trust-list span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(119, 242, 180, 0.2);
  border-radius: 50%;
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 900;
}

.hero-visual {
  display: none;
}

.section {
  padding: 82px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 32px;
}

.section-heading h2 {
  margin: 8px 0 0;
  font-size: clamp(2.1rem, 8vw, 3.75rem);
  font-weight: 860;
  letter-spacing: -0.055em;
  line-height: 1;
}

.section-intro {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.notes-shell {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(119, 242, 180, 0.045), transparent 35%),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.notes-loading {
  display: grid;
  min-height: 440px;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
}

.loading-lock {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 21px;
  background: var(--surface-raised);
  color: var(--green);
  animation: breathe 2s ease-in-out infinite;
}

.loading-lock svg {
  width: 29px;
}

.auth-card {
  min-height: 440px;
}

.auth-visual {
  display: none;
}

.auth-copy {
  width: 100%;
  max-width: 520px;
  margin: auto;
  padding: 34px 22px 38px;
}

.auth-copy h3 {
  margin: 7px 0 9px;
  font-size: clamp(1.8rem, 8vw, 2.7rem);
  font-weight: 850;
  letter-spacing: -0.05em;
}

.auth-copy > p {
  margin-bottom: 25px;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form label,
.coordinate-fields label {
  display: grid;
  gap: 7px;
}

.auth-form label > span,
.coordinate-fields label > span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

input,
textarea {
  outline: none;
}

.auth-form input,
.coordinate-fields input,
.search-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg-deep) 48%, transparent);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.auth-form input,
.coordinate-fields input {
  min-height: 48px;
  padding: 0 14px;
}

.auth-form input:focus,
.coordinate-fields input:focus,
.search-box:focus-within {
  border-color: color-mix(in srgb, var(--green) 52%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 9%, transparent);
  background: var(--surface-solid);
}

.auth-warning {
  padding: 12px 14px;
  margin: 0 !important;
  border: 1px solid color-mix(in srgb, var(--warning) 20%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--warning) 6%, transparent);
  color: var(--muted) !important;
  font-size: 0.75rem;
}

.auth-warning strong {
  color: var(--warning);
}

.form-error {
  padding: 10px 13px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--danger) 23%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--danger) 7%, transparent);
  color: var(--danger);
  font-size: 0.79rem;
}

.auth-form .button {
  width: 100%;
  margin-top: 3px;
}

.privacy-caption {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 20px;
  color: var(--subtle);
  font-size: 0.72rem;
}

.privacy-caption svg {
  width: 17px;
  color: var(--green);
}

.notes-app {
  min-height: 580px;
}

.notes-toolbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.sync-state {
  display: none;
  align-items: center;
  gap: 9px;
  min-width: 125px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 720;
}

.notes-actions {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.notes-actions::-webkit-scrollbar {
  display: none;
}

.notes-actions .button {
  flex: 0 0 auto;
}

.notes-actions .icon-button {
  flex: 0 0 auto;
}

.notes-workspace {
  display: grid;
}

.notes-sidebar {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
}

.search-box svg {
  width: 18px;
  flex: 0 0 auto;
  color: var(--subtle);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}

.search-box input::placeholder {
  color: var(--subtle);
}

.note-list {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.note-list-item {
  position: relative;
  display: grid;
  width: min(76vw, 250px);
  min-width: min(76vw, 250px);
  gap: 5px;
  padding: 13px 14px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.note-list-item:hover {
  border-color: var(--line);
  transform: translateY(-1px);
}

.note-list-item.is-active {
  border-color: rgba(119, 242, 180, 0.25);
  background: rgba(119, 242, 180, 0.085);
}

.note-list-item.is-pinned::after {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 11px var(--green);
  content: "";
}

.note-list-title {
  padding-right: 10px;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-list-preview {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-list-date {
  color: var(--subtle);
  font-size: 0.65rem;
}

.empty-list {
  margin: 18px 4px;
  color: var(--subtle);
  font-size: 0.76rem;
}

.note-editor-wrap {
  min-width: 0;
}

.editor-empty {
  display: grid;
  min-height: 380px;
  place-content: center;
  justify-items: center;
  padding: 34px 22px;
  text-align: center;
}

.editor-empty > span {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin-bottom: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
  color: var(--green);
}

.editor-empty svg {
  width: 29px;
}

.editor-empty h3 {
  margin-bottom: 6px;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.editor-empty p {
  max-width: 330px;
  margin-bottom: 19px;
  color: var(--muted);
  font-size: 0.83rem;
}

.note-editor {
  min-height: 430px;
  padding: 16px 17px 14px;
}

.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.editor-topbar > div {
  display: flex;
  gap: 5px;
}

.editor-topbar .icon-button {
  width: 38px;
  height: 38px;
}

.editor-date {
  color: var(--subtle);
  font-size: 0.7rem;
}

.note-title-input,
.note-content-input {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
}

.note-title-input {
  padding: 5px 0 12px;
  color: var(--text);
  font-size: clamp(1.55rem, 7vw, 2.35rem);
  font-weight: 820;
  letter-spacing: -0.045em;
}

.note-title-input::placeholder,
.note-content-input::placeholder {
  color: color-mix(in srgb, var(--subtle) 60%, transparent);
}

.note-content-input {
  min-height: 285px;
  padding: 7px 0;
  resize: vertical;
  color: color-mix(in srgb, var(--text) 90%, var(--muted));
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.72;
}

.editor-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 0.65rem;
}

.editor-footer span:last-child {
  color: var(--green);
}

.security-note {
  display: flex;
  max-width: 760px;
  align-items: flex-start;
  gap: 9px;
  margin: 16px auto 0;
  color: var(--subtle);
  font-size: 0.69rem;
  text-align: left;
}

.security-note svg {
  width: 16px;
  min-width: 16px;
  margin-top: 2px;
  color: var(--green);
}

.game-shell {
  position: relative;
  display: grid;
  gap: 30px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(169, 149, 255, 0.08), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.game-shell::before {
  position: absolute;
  top: -180px;
  right: -140px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(169, 149, 255, 0.07);
  filter: blur(55px);
  content: "";
}

.game-copy {
  position: relative;
  z-index: 1;
}

.game-chip {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid rgba(169, 149, 255, 0.2);
  border-radius: 999px;
  background: rgba(169, 149, 255, 0.07);
  color: var(--purple);
}

.game-copy h3 {
  margin: 17px 0 9px;
  font-size: clamp(2rem, 9vw, 3.25rem);
  font-weight: 860;
  letter-spacing: -0.055em;
  line-height: 1;
}

.game-copy > p {
  max-width: 440px;
  color: var(--muted);
  font-size: 0.88rem;
}

.score-row {
  display: flex;
  max-width: 340px;
  gap: 10px;
  margin: 23px 0 18px;
}

.score-row > div {
  display: grid;
  min-width: 112px;
  gap: 2px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.score-row span {
  color: var(--subtle);
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-row strong {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.game-message {
  min-height: 1.4em;
  margin: 12px 0 0 !important;
  color: var(--purple) !important;
  font-size: 0.74rem !important;
}

.game-stage {
  position: relative;
  z-index: 1;
  width: min(100%, 410px);
  margin-inline: auto;
}

.canvas-frame {
  position: relative;
  padding: 9px;
  overflow: hidden;
  border: 1px solid rgba(169, 149, 255, 0.25);
  border-radius: 20px;
  background: #050a0e;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.32), inset 0 0 30px rgba(169, 149, 255, 0.055);
}

[data-game-canvas] {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 13px;
  background: #07100f;
  image-rendering: pixelated;
  touch-action: none;
}

.scanlines {
  position: absolute;
  inset: 9px;
  border-radius: 13px;
  pointer-events: none;
  opacity: 0.08;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(255, 255, 255, 0.18) 4px);
}

.game-controls {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: 15px;
}

.game-controls > div {
  display: flex;
  gap: 6px;
}

.game-controls button {
  display: grid;
  width: 51px;
  height: 45px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 100ms ease, color 100ms ease, transform 100ms ease;
}

.game-controls button:active {
  background: rgba(169, 149, 255, 0.16);
  color: var(--purple);
  transform: scale(0.94);
}

.game-controls svg {
  width: 22px;
}

.compact-section {
  padding-bottom: 105px;
}

.coordinate-card {
  display: grid;
  gap: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.coordinate-heading {
  display: flex;
  align-items: center;
  gap: 13px;
}

.coordinate-heading h3 {
  margin: 3px 0 0;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
}

.world-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(119, 242, 180, 0.18);
  border-radius: 14px;
  background: rgba(119, 242, 180, 0.07);
  color: var(--green);
}

.world-icon svg {
  width: 23px;
}

.segment-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg-deep) 42%, transparent);
}

.segment-control button {
  min-height: 41px;
  padding: 5px 8px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
  cursor: pointer;
}

.segment-control button.is-active {
  background: var(--surface-raised);
  color: var(--green);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.11);
}

.coordinate-fields {
  display: grid;
  gap: 13px;
}

.coordinate-result {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 70px;
  padding: 10px 15px;
  border: 1px solid rgba(119, 242, 180, 0.16);
  border-radius: 13px;
  background: rgba(119, 242, 180, 0.055);
}

.coordinate-result > span {
  color: var(--subtle);
  font-size: 0.68rem;
}

.coordinate-result strong {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.coordinate-result i {
  color: var(--green);
  font-size: 0.66rem;
  font-style: normal;
}

.site-footer {
  display: grid;
  gap: 22px;
  padding: 33px 0 max(36px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}

.site-footer p {
  margin: 4px 0 0;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-meta button {
  padding: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 500;
  max-width: calc(100% - 36px);
  padding: 11px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 730;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--green) 42%, transparent);
  outline-offset: 3px;
}

@keyframes pulse {
  0% {
    opacity: 0.7;
    transform: scale(0.7);
  }
  80%,
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes breathe {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(119, 242, 180, 0);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 32px rgba(119, 242, 180, 0.12);
    transform: scale(1.025);
  }
}

@media (min-width: 600px) {
  :root {
    --header-height: 78px;
  }

  .site-header {
    padding-inline: max(28px, env(safe-area-inset-left)) max(28px, env(safe-area-inset-right));
  }

  .brand-mark {
    width: 41px;
    height: 41px;
  }

  .brand-name {
    font-size: 1.12rem;
  }

  .header-status {
    display: inline-flex;
  }

  main,
  .site-footer {
    width: min(var(--max-width), calc(100% - 64px));
  }

  .hero {
    padding-block: 92px 104px;
  }

  h1 {
    font-size: clamp(4.8rem, 13vw, 6.8rem);
  }

  .section {
    padding-block: 104px;
  }

  .section-heading {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.55fr);
    align-items: end;
  }

  .section-intro {
    justify-self: end;
  }

  .auth-copy {
    padding: 50px 42px 55px;
  }

  .notes-toolbar {
    padding-inline: 17px;
  }

  .sync-state {
    display: inline-flex;
  }

  .notes-actions {
    width: auto;
    justify-content: flex-end;
  }

  .icon-button.labelled span {
    display: inline;
  }

  .note-list-item {
    width: 245px;
    min-width: 245px;
  }

  .note-editor {
    padding: 22px 26px 17px;
  }

  .note-content-input {
    min-height: 320px;
  }

  .security-note {
    justify-content: center;
    text-align: center;
  }

  .game-shell {
    padding: 36px;
  }

  .coordinate-card {
    grid-template-columns: minmax(190px, 0.75fr) minmax(280px, 1fr);
    align-items: center;
    padding: 27px;
  }

  .coordinate-fields {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr 1.1fr;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .footer-meta {
    justify-content: flex-end;
  }
}

@media (min-width: 820px) {
  .notes-workspace {
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 520px;
  }

  .notes-sidebar {
    padding: 16px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .note-list {
    display: grid;
    max-height: 448px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .note-list-item {
    width: 100%;
    min-width: 0;
  }

  .editor-empty {
    min-height: 518px;
  }

  .note-editor {
    display: grid;
    min-height: 518px;
    grid-template-rows: auto auto 1fr auto;
  }

  .note-content-input {
    min-height: 300px;
    resize: none;
  }
}

@media (min-width: 1040px) {
  .site-header {
    width: min(100%, 1440px);
    margin-inline: auto;
    border-right: 1px solid transparent;
    border-left: 1px solid transparent;
  }

  .main-nav {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .main-nav a {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 720;
    transition: color 160ms ease, background 160ms ease;
  }

  .main-nav a:hover {
    background: var(--surface-soft);
    color: var(--text);
  }

  .hero {
    grid-template-columns: minmax(0, 1.12fr) minmax(370px, 0.72fr);
    gap: 60px;
  }

  .hero-visual {
    display: block;
  }

  .note-orbit {
    position: relative;
    min-height: 480px;
    perspective: 1200px;
  }

  .note-orbit::before,
  .note-orbit::after {
    position: absolute;
    border-radius: 50%;
    content: "";
  }

  .note-orbit::before {
    inset: 15% 2% 5%;
    border: 1px solid var(--line);
    transform: rotate(-12deg);
  }

  .note-orbit::after {
    top: 47%;
    left: 50%;
    width: 340px;
    height: 340px;
    background: rgba(62, 225, 147, 0.075);
    filter: blur(60px);
    transform: translate(-50%, -50%);
  }

  .floating-note {
    position: absolute;
    display: grid;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }

  .floating-note > span {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: var(--line);
  }

  .note-back {
    top: 12%;
    right: 4%;
    width: 230px;
    height: 280px;
    gap: 14px;
    align-content: center;
    padding: 28px;
    opacity: 0.38;
    transform: rotate(12deg) translateZ(-90px);
  }

  .note-mid {
    top: 30%;
    left: 1%;
    width: 240px;
    height: 255px;
    gap: 13px;
    align-content: center;
    padding: 29px;
    opacity: 0.58;
    transform: rotate(-10deg) translateZ(-30px);
  }

  .note-mid i {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    border-radius: 15px;
    background: rgba(169, 149, 255, 0.23);
  }

  .note-front {
    top: 16%;
    left: 50%;
    z-index: 2;
    width: 300px;
    min-height: 335px;
    gap: 16px;
    align-content: start;
    padding: 31px;
    transform: translateX(-43%) rotate(3deg);
    animation: float-note 6s ease-in-out infinite;
  }

  .note-front strong {
    margin: 16px 0 6px;
    font-size: 1.55rem;
    letter-spacing: -0.04em;
  }

  .note-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .note-topline b {
    width: 32px;
    height: 7px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 14px rgba(119, 242, 180, 0.5);
  }

  .note-topline small {
    color: var(--green);
    font-size: 0.66rem;
    font-weight: 780;
  }

  .note-lock {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-top: 20px;
    margin-top: 8px;
    border-top: 1px solid var(--line);
    color: var(--subtle);
    font-size: 0.68rem;
  }

  .note-lock svg {
    width: 16px;
    color: var(--green);
  }

  .auth-card {
    display: grid;
    grid-template-columns: minmax(290px, 0.75fr) minmax(480px, 1.25fr);
  }

  .auth-visual {
    position: relative;
    display: grid;
    min-height: 560px;
    place-content: center;
    justify-items: center;
    gap: 18px;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background:
      radial-gradient(circle at 50% 45%, rgba(119, 242, 180, 0.13), transparent 45%),
      linear-gradient(145deg, rgba(119, 242, 180, 0.055), transparent);
  }

  .auth-visual::before,
  .auth-visual::after {
    position: absolute;
    width: 290px;
    height: 290px;
    border: 1px solid var(--line);
    border-radius: 50%;
    content: "";
  }

  .auth-visual::after {
    width: 390px;
    height: 390px;
    opacity: 0.55;
  }

  .auth-icon {
    z-index: 1;
    display: grid;
    width: 94px;
    height: 94px;
    place-items: center;
    border: 1px solid rgba(119, 242, 180, 0.26);
    border-radius: 30px;
    background: rgba(119, 242, 180, 0.09);
    box-shadow: 0 0 55px rgba(119, 242, 180, 0.1);
    color: var(--green);
  }

  .auth-icon svg {
    width: 43px;
  }

  .auth-step {
    z-index: 1;
    color: var(--muted);
    font-size: 0.69rem;
    font-weight: 790;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .unlock-visual {
    background:
      radial-gradient(circle at 50% 45%, rgba(113, 230, 225, 0.12), transparent 45%),
      linear-gradient(145deg, rgba(113, 230, 225, 0.045), transparent);
  }

  .auth-copy {
    padding: 64px 62px;
  }

  .notes-toolbar {
    min-height: 68px;
    padding-inline: 21px;
  }

  .notes-workspace {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .notes-sidebar {
    padding: 18px;
  }

  .note-editor {
    padding: 25px 34px 18px;
  }

  .game-shell {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.72fr);
    align-items: center;
    min-height: 530px;
    padding: 48px 54px;
  }

  .game-stage {
    justify-self: end;
    margin: 0;
  }

  .game-copy h3 {
    font-size: 3.65rem;
  }

  .coordinate-card {
    grid-template-columns: 0.8fr 1fr 1.55fr;
    gap: 28px;
    padding: 31px 34px;
  }

  .coordinate-fields {
    grid-column: auto;
    grid-template-columns: 1fr 1fr 1.1fr;
  }

  @keyframes float-note {
    0%,
    100% {
      transform: translateX(-43%) rotate(3deg) translateY(0);
    }
    50% {
      transform: translateX(-43%) rotate(1.5deg) translateY(-12px);
    }
  }
}

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