:root {
  color-scheme: dark;
  --bg: #111315;
  --surface: #1b1f23;
  --surface-strong: #232a30;
  --text: #f5f1e7;
  --muted: #b5b0a4;
  --line: #363c42;
  --gold: #f1d35b;
  --mint: #4ac7a5;
  --red: #ff6f61;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 300px),
    linear-gradient(135deg, #111315 0%, #172018 44%, #211918 100%);
  color: var(--text);
}

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

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1080px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 36px;
}

.page-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(241, 211, 91, 0.38);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), #f6a84b);
  color: #15110a;
  display: grid;
  place-items: center;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-link,
button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  font-weight: 900;
  cursor: pointer;
}

button.primary {
  border-color: rgba(241, 211, 91, 0.4);
  background: var(--gold);
  color: #15110a;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
  gap: 16px;
  padding-top: 38px;
}

.profile-main {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--mint);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 8px;
  font-size: clamp(42px, 8vw, 78px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  line-height: 1.1;
}

.panel,
.info-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(27, 31, 35, 0.92);
  box-shadow: var(--shadow);
}

.panel {
  margin-top: 22px;
  padding: 20px;
  display: grid;
  gap: 18px;
}

.panel p,
.info-panel dt,
.info-panel dd,
label,
#nicknameHelp {
  color: var(--muted);
}

.button-row,
.input-row,
.profile-top,
.guest-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button-row,
.profile-top,
.guest-panel {
  justify-content: space-between;
}

.nickname-form {
  display: grid;
  gap: 8px;
}

label {
  font-size: 13px;
  font-weight: 900;
}

.input-row input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
}

.input-row button {
  flex: 0 0 86px;
}

#nicknameHelp,
.form-status {
  min-height: 20px;
  font-size: 13px;
  line-height: 1.45;
}

.form-status[data-type="success"] {
  color: var(--mint);
}

.form-status[data-type="error"] {
  color: var(--red);
}

.guest-panel {
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid rgba(74, 199, 165, 0.22);
  border-radius: 8px;
  background: rgba(74, 199, 165, 0.08);
}

.guest-panel span {
  color: var(--mint);
  font-weight: 900;
}

.info-panel {
  padding: 18px;
}

.info-panel dl {
  margin: 16px 0 0;
  display: grid;
  gap: 12px;
}

.info-panel div {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.info-panel dt {
  font-size: 13px;
  font-weight: 900;
}

.info-panel dd {
  margin: 0;
  max-width: 190px;
  color: var(--text);
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .profile-layout {
    grid-template-columns: 1fr;
    padding-top: 22px;
  }

  .button-row,
  .input-row,
  .profile-top,
  .guest-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row button,
  .input-row button,
  .profile-top button,
  .guest-panel button {
    width: 100%;
  }
}
