/* The games' look (Multipoly): a light rim round everything raised, a hard drop under it. */
:root {
  --backdrop:
    radial-gradient(90% 55% at 0% 0%, #ffe3c8 0%, transparent 60%),
    radial-gradient(80% 60% at 100% 10%, #e3dcff 0%, transparent 60%),
    radial-gradient(90% 60% at 50% 110%, #d9f1e0 0%, transparent 60%), #f6f1e8;
  --surface: #ffffff;
  --surface-2: #f2ede4;
  --text: #221c33;
  --muted: #7b7390;
  --accent: #6a48f4;
  --danger: #e2493a;
  --success: #25a55f;
  --rim: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --backdrop:
      radial-gradient(90% 55% at 0% 0%, #3a2150 0%, transparent 60%),
      radial-gradient(80% 60% at 100% 10%, #1f2a55 0%, transparent 60%), #14121d;
    --surface: #211e2e;
    --surface-2: #2d2940;
    --text: #efedf6;
    --muted: #a39db8;
    --accent: #8a6dff;
    --rim: color-mix(in srgb, var(--accent) 45%, var(--surface));
    color-scheme: dark;
  }
}

:root {
  --accent-hi: color-mix(in srgb, var(--accent) 72%, white);
  --accent-lo: color-mix(in srgb, var(--accent) 68%, black);
  --edge: color-mix(in srgb, var(--surface-2) 82%, black);
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --drop: color-mix(in srgb, var(--text) 16%, transparent);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--backdrop);
  background-attachment: fixed;
  color: var(--text);
  font:
    700 16px/1.4 'Nunito',
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
}

.card {
  width: 100%;
  max-width: 420px;
  padding: 22px 20px 24px;
  border: 3px solid var(--rim);
  border-radius: 26px;
  background: var(--surface);
  box-shadow:
    0 5px 0 var(--drop),
    0 16px 40px rgb(20 10 40 / 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border: 3px solid var(--rim);
  border-radius: 15px;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent) 60%, var(--accent-lo));
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 0 var(--accent-lo);
  box-shadow: 0 3px 0 var(--accent-lo);
}

.wordmark {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.tagline,
.sub,
.note,
small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.15;
}

.sub {
  margin: -6px 0 12px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span:first-child {
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 2.5px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--text) 6%, transparent);
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

.pw {
  position: relative;
  display: block;
}

.pw input {
  padding-right: 54px;
}

.eye {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 12px;
  background: transparent center / 24px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b7390' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  cursor: pointer;
}

.eye.on {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a48f4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E");
}

.row {
  display: flex;
  gap: 8px;
}

.row input {
  flex: 1;
  min-width: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.6rem 1.15rem;
  border: 2.5px solid var(--rim);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  color: var(--text);
  font: inherit;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  box-shadow:
    inset 0 -4px 0 color-mix(in srgb, var(--text) 7%, transparent),
    0 4px 0 var(--edge),
    0 7px 14px rgb(20 10 40 / 0.12);
  transition:
    transform 0.08s,
    box-shadow 0.08s;
}

.btn:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 -2px 0 color-mix(in srgb, var(--text) 7%, transparent),
    0 1px 0 var(--edge);
}

.btn.primary,
.btn.danger {
  --ink: var(--accent-lo);
  background: linear-gradient(
    180deg,
    var(--accent-hi),
    var(--accent) 55%,
    color-mix(in srgb, var(--accent) 88%, black)
  );
  color: #fff;
  text-shadow:
    0 2px 0 var(--ink),
    1.5px 0 0 var(--ink),
    -1.5px 0 0 var(--ink),
    0 -1.5px 0 var(--ink);
  box-shadow:
    inset 0 -5px 0 rgb(0 0 0 / 0.16),
    inset 0 3px 0 rgb(255 255 255 / 0.25),
    0 5px 0 var(--ink),
    0 9px 18px color-mix(in srgb, var(--ink) 35%, transparent);
}

.btn.danger {
  --accent: var(--danger);
  --accent-hi: color-mix(in srgb, var(--danger) 72%, white);
  --ink: color-mix(in srgb, var(--danger) 62%, black);
}

.btn.big {
  min-height: 58px;
  font-size: 20px;
}

.btn.link {
  min-height: 44px;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.switch {
  margin: 6px 0 0;
  text-align: center;
}

a {
  color: var(--accent);
  font-weight: 900;
}

.msg {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
}

.msg.error {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  color: color-mix(in srgb, var(--danger) 80%, var(--text));
}

.msg.ok {
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  color: color-mix(in srgb, var(--success) 70%, var(--text));
}

.person {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface-2);
}

.avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border: 3px solid var(--rim);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffcf6b, #f59e2b);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  text-shadow: 0 2px 0 #b9650f;
  box-shadow: 0 3px 0 var(--drop);
}

.pname {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.plogin {
  color: var(--muted);
}

.box {
  margin: 4px 0 16px;
  padding: 0 14px;
  border: 2.5px solid var(--line);
  border-radius: 18px;
}

.box summary {
  padding: 12px 0;
  font-weight: 900;
  cursor: pointer;
}

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

.actions form {
  flex: 1 1 140px;
  display: flex;
}

.actions .btn {
  flex: 1;
}

.langs {
  display: flex;
  gap: 6px;
}

.lang {
  min-width: 44px;
  padding: 6px 10px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.lang.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 0 var(--drop);
}
