:root {
  --page-bg: #060b14;
  --header-bg: #030812;
  --panel-bg: #111a2b;
  --panel-dark: #0b1321;
  --panel-soft: #152136;

  --border: #273650;
  --border-light: #344764;

  --text: #f4f7fc;
  --muted: #9eb0ca;
  --cyan: #42c8ff;
  --green: #3fe29a;
  --gold: #ffc54a;
  --red: #ff7180;

  --radius-large: 20px;
  --radius-medium: 15px;
  --radius-small: 10px;

  --shadow:
    0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
  color-scheme: dark;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(
      circle at 80% 10%,
      rgba(70, 76, 220, 0.13),
      transparent 32rem
    ),
    radial-gradient(
      circle at 12% 60%,
      rgba(66, 200, 255, 0.07),
      transparent 27rem
    ),
    var(--page-bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

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

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.profile-site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(20px, 5vw, 68px);
  border-bottom: 1px solid var(--border);
  background: rgba(3, 8, 18, 0.96);
  backdrop-filter: blur(14px);
}

.profile-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.profile-brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(66, 200, 255, 0.42);
  border-radius: 13px;
  background:
    linear-gradient(
      145deg,
      rgba(66, 200, 255, 0.18),
      rgba(76, 86, 220, 0.18)
    );
  color: var(--cyan);
  font-weight: 850;
  letter-spacing: 0.03em;
}

.profile-brand strong,
.profile-brand small {
  display: block;
}

.profile-brand strong {
  font-size: 1.02rem;
}

.profile-brand small {
  margin-top: 3px;
  color: #9fbce3;
  font-size: 0.67rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.profile-header-actions a,
.profile-header-actions button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: #dbe5f4;
}

.profile-header-actions a {
  display: inline-flex;
  align-items: center;
}

.profile-header-actions a:hover,
.profile-header-actions button:hover {
  border-color: var(--cyan);
  background: rgba(66, 200, 255, 0.07);
  color: white;
}

#profileSignOutButton {
  border-color: rgba(255, 113, 128, 0.36);
  color: #ff9aa5;
}

.profile-access-message {
  width: calc(100% - 30px);
  max-width: 1400px;
  margin: 18px auto 0;
  padding: 13px 16px;
  border: 1px solid rgba(66, 200, 255, 0.28);
  border-radius: 11px;
  background: rgba(66, 200, 255, 0.07);
  color: #bcecff;
  font-size: 0.86rem;
  line-height: 1.5;
}

.profile-page {
  width: min(1400px, calc(100% - 30px));
  margin: 20px auto 42px;
}

.profile-eyebrow {
  margin: 0 0 9px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.profile-login-panel {
  display: grid;
  grid-template-columns:
    minmax(0, 0.9fr)
    minmax(390px, 1.1fr);
  overflow: hidden;
  min-height: 590px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.profile-login-introduction {
  position: relative;
  overflow: hidden;
  padding: clamp(35px, 6vw, 76px);
  border-right: 1px solid var(--border);
  background:
    linear-gradient(
      145deg,
      rgba(66, 200, 255, 0.09),
      transparent 48%
    ),
    var(--panel-dark);
}

.profile-login-introduction::after {
  position: absolute;
  right: -100px;
  bottom: -120px;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: rgba(66, 200, 255, 0.08);
  content: "";
}

.profile-login-introduction h1 {
  max-width: 470px;
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 0.93;
  letter-spacing: -0.065em;
}

.profile-login-introduction > p:not(.profile-eyebrow) {
  max-width: 550px;
  margin: 28px 0 0;
  color: #b2c4dd;
  font-size: 1.04rem;
  line-height: 1.7;
}

.profile-information-card {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin-top: 36px;
  padding: 20px;
  border: 1px solid rgba(255, 197, 74, 0.36);
  border-radius: var(--radius-medium);
  background: rgba(255, 197, 74, 0.07);
}

.profile-information-card strong {
  color: var(--gold);
}

.profile-information-card p {
  margin: 8px 0 0;
  color: #c4d0e1;
  line-height: 1.6;
}

.profile-login-form {
  align-self: center;
  width: min(540px, calc(100% - 50px));
  margin: 40px auto;
  padding: clamp(26px, 5vw, 42px);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--panel-dark);
}

.profile-login-form header {
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.profile-login-form h2 {
  margin: 0;
  font-size: 1.7rem;
}

.profile-login-form header p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.profile-login-form label,
.profile-settings-form label,
.profile-readonly-details label {
  display: block;
}

.profile-login-form label + label {
  margin-top: 18px;
}

.profile-login-form label > span,
.profile-settings-form label > span,
.profile-readonly-details label > span {
  display: block;
  margin-bottom: 8px;
  color: #d7e1f0;
  font-size: 0.79rem;
  font-weight: 780;
}

.profile-login-form input,
.profile-settings-form input,
.profile-readonly-details input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-small);
  outline: none;
  background: #080f1b;
  color: white;
}

.profile-login-form input:focus,
.profile-settings-form input:focus {
  border-color: var(--cyan);
  box-shadow:
    0 0 0 3px rgba(66, 200, 255, 0.12);
}

#profileLoginButton {
  width: 100%;
  min-height: 49px;
  margin-top: 24px;
  border: 1px solid rgba(66, 200, 255, 0.52);
  border-radius: var(--radius-small);
  background:
    linear-gradient(
      135deg,
      rgba(66, 200, 255, 0.22),
      rgba(73, 94, 230, 0.22)
    );
  color: white;
  font-weight: 850;
}

#profileLoginButton:hover {
  filter: brightness(1.17);
}

.profile-form-status {
  min-height: 23px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.profile-account-app {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.profile-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.profile-page-heading h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.profile-page-heading > div > p:last-child {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

#openDartsCounterProfileLink {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid rgba(66, 200, 255, 0.42);
  border-radius: 10px;
  background: rgba(66, 200, 255, 0.08);
  color: var(--cyan);
  font-weight: 800;
}

.profile-account-alert {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 197, 74, 0.4);
  border-radius: 12px;
  background: rgba(255, 197, 74, 0.07);
}

.profile-account-alert h2 {
  margin: 0;
  color: var(--gold);
  font-size: 1rem;
}

.profile-account-alert p {
  margin: 8px 0 0;
  color: #d2d8e2;
  line-height: 1.55;
}

.profile-summary-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.profile-summary-grid article {
  min-height: 120px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-dark);
}

.profile-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-summary-grid strong {
  display: block;
  margin-top: 15px;
  color: var(--cyan);
  font-size: 1.18rem;
  line-height: 1.35;
}

.profile-login-panel {
  display: grid;
  grid-template-columns:
    minmax(0, 0.9fr)
    minmax(390px, 1.1fr);
  overflow: hidden;
  min-height: 590px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.profile-login-introduction {
  position: relative;
  overflow: hidden;
  padding: clamp(35px, 6vw, 76px);
  border-right: 1px solid var(--border);
  background:
    linear-gradient(
      145deg,
      rgba(66, 200, 255, 0.09),
      transparent 48%
    ),
    var(--panel-dark);
}

.profile-login-introduction::after {
  position: absolute;
  right: -100px;
  bottom: -120px;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: rgba(66, 200, 255, 0.08);
  content: "";
}

.profile-login-introduction h1 {
  max-width: 470px;
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 0.93;
  letter-spacing: -0.065em;
}

.profile-login-introduction > p:not(.profile-eyebrow) {
  max-width: 550px;
  margin: 28px 0 0;
  color: #b2c4dd;
  font-size: 1.04rem;
  line-height: 1.7;
}

.profile-information-card {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin-top: 36px;
  padding: 20px;
  border: 1px solid rgba(255, 197, 74, 0.36);
  border-radius: var(--radius-medium);
  background: rgba(255, 197, 74, 0.07);
}

.profile-information-card strong {
  color: var(--gold);
}

.profile-information-card p {
  margin: 8px 0 0;
  color: #c4d0e1;
  line-height: 1.6;
}

.profile-login-form {
  align-self: center;
  width: min(540px, calc(100% - 50px));
  margin: 40px auto;
  padding: clamp(26px, 5vw, 42px);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--panel-dark);
}

.profile-login-form header {
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.profile-login-form h2 {
  margin: 0;
  font-size: 1.7rem;
}

.profile-login-form header p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.profile-login-form label,
.profile-settings-form label,
.profile-readonly-details label {
  display: block;
}

.profile-login-form label + label {
  margin-top: 18px;
}

.profile-login-form label > span,
.profile-settings-form label > span,
.profile-readonly-details label > span {
  display: block;
  margin-bottom: 8px;
  color: #d7e1f0;
  font-size: 0.79rem;
  font-weight: 780;
}

.profile-login-form input,
.profile-settings-form input,
.profile-readonly-details input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-small);
  outline: none;
  background: #080f1b;
  color: white;
}

.profile-login-form input:focus,
.profile-settings-form input:focus {
  border-color: var(--cyan);
  box-shadow:
    0 0 0 3px rgba(66, 200, 255, 0.12);
}

#profileLoginButton {
  width: 100%;
  min-height: 49px;
  margin-top: 24px;
  border: 1px solid rgba(66, 200, 255, 0.52);
  border-radius: var(--radius-small);
  background:
    linear-gradient(
      135deg,
      rgba(66, 200, 255, 0.22),
      rgba(73, 94, 230, 0.22)
    );
  color: white;
  font-weight: 850;
}

#profileLoginButton:hover {
  filter: brightness(1.17);
}

.profile-form-status {
  min-height: 23px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.profile-account-app {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.profile-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.profile-page-heading h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.profile-page-heading > div > p:last-child {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

#openDartsCounterProfileLink {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid rgba(66, 200, 255, 0.42);
  border-radius: 10px;
  background: rgba(66, 200, 255, 0.08);
  color: var(--cyan);
  font-weight: 800;
}

.profile-account-alert {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 197, 74, 0.4);
  border-radius: 12px;
  background: rgba(255, 197, 74, 0.07);
}

.profile-account-alert h2 {
  margin: 0;
  color: var(--gold);
  font-size: 1rem;
}

.profile-account-alert p {
  margin: 8px 0 0;
  color: #d2d8e2;
  line-height: 1.55;
}

.profile-summary-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.profile-summary-grid article {
  min-height: 120px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-dark);
}

.profile-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-summary-grid strong {
  display: block;
  margin-top: 15px;
  color: var(--cyan);
  font-size: 1.18rem;
  line-height: 1.35;
}

.profile-content-grid {
  display: grid;
  grid-template-columns:
    minmax(250px, 0.35fr)
    minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.profile-preview-card,
.profile-settings-form {
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--panel-dark);
}

.profile-preview-card {
  align-self: start;
  overflow: hidden;
}

.profile-preview-card header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(
      145deg,
      rgba(66, 200, 255, 0.11),
      transparent
    );
}

.profile-preview-card h2 {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

.profile-preview-card header > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.profile-preview-card dl {
  margin: 0;
  padding: 8px 24px 20px;
}

.profile-preview-card dl > div {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.profile-preview-card dl > div:last-child {
  border-bottom: 0;
}

.profile-preview-card dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-preview-card dd {
  margin: 7px 0 0;
  color: #e2eaf6;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.profile-settings-form {
  padding: clamp(22px, 4vw, 34px);
}

.profile-settings-form > header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.profile-settings-form h2 {
  margin: 0;
  font-size: 1.65rem;
}

.profile-settings-form > header > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.profile-settings-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.profile-settings-grid label > span small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.profile-settings-grid label > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.profile-readonly-details {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(21, 33, 54, 0.46);
}

.profile-readonly-details h3 {
  margin: 0;
  font-size: 1rem;
}

.profile-readonly-details > p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.profile-readonly-details > div {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.profile-readonly-details input {
  cursor: not-allowed;
  background: #0c1421;
  color: #97a8bf;
}

.profile-settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.profile-settings-actions button {
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  font-weight: 820;
}

#saveProfileSettingsButton {
  border-color: rgba(63, 226, 154, 0.42);
  background: rgba(63, 226, 154, 0.09);
  color: var(--green);
}

#resetProfileSettingsButton {
  background: var(--panel-soft);
  color: #d4dfef;
}

.profile-settings-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

#profileSettingsStatus {
  flex: 1 1 250px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.profile-site-footer {
  padding: 26px 20px;
  border-top: 1px solid var(--border);
  color: #8297b6;
  text-align: center;
  font-size: 0.78rem;
}

@media (max-width: 980px) {
  .profile-login-panel {
    grid-template-columns: 1fr;
  }

  .profile-login-introduction {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .profile-content-grid {
    grid-template-columns: 1fr;
  }

  .profile-preview-card {
    width: 100%;
  }

  .profile-summary-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .profile-site-header {
    align-items: flex-start;
    padding: 13px 15px;
  }

  .profile-brand small {
    display: none;
  }

  .profile-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .profile-header-actions a,
  .profile-header-actions button {
    min-height: 38px;
    padding: 0 11px;
    font-size: 0.8rem;
  }

  .profile-page {
    width: min(100% - 20px, 1400px);
  }

  .profile-access-message {
    width: calc(100% - 20px);
  }

  .profile-login-introduction {
    padding: 34px 25px;
  }

  .profile-login-introduction h1 {
    font-size: 3rem;
  }

  .profile-login-form {
    width: calc(100% - 28px);
    margin: 14px;
    padding: 22px;
  }

  .profile-account-app {
    padding: 20px 15px;
  }

  .profile-page-heading {
    display: block;
  }

  #openDartsCounterProfileLink {
    margin-top: 18px;
  }

  .profile-summary-grid,
  .profile-settings-grid,
  .profile-readonly-details > div {
    grid-template-columns: 1fr;
  }

  .profile-summary-grid article {
    min-height: 100px;
  }

  .profile-settings-form {
    padding: 20px 16px;
  }

  .profile-settings-actions button {
    flex: 1 1 150px;
  }
}
