/* Glass surfaces: blurred translucent layer + soft top-left gloss + 1px lit edge. */
.card, .tile, .toast, .pick, .install-card {
  background: var(--gloss), var(--surface);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3); backdrop-filter: blur(var(--blur)) saturate(1.3);
}
.card { border-radius: var(--radius); padding: 18px; }

.auth { max-width: 420px; width: 100%; margin: 0 auto; padding: 24px 20px; }
.auth .brand { margin-bottom: 18px; }
.auth h1 { margin-bottom: 4px; }
.auth > .muted { margin-bottom: 18px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--gloss), var(--surface-2); color: var(--text); font-weight: 650; cursor: pointer;
  box-shadow: inset 0 1px 0 var(--edge);
  text-decoration: none;
}
.btn:hover { border-color: var(--border-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary {
  background: var(--grad); color: var(--on-primary); border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 8px 22px var(--glow);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
}
.btn--primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .6) 50%, transparent 62%);
  transform: translateX(-120%); animation: btn-sheen 5.5s ease-in-out infinite;
}
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); box-shadow: none; }
.btn--ghost { background: transparent; box-shadow: none; }
.btn--block { width: 100%; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px;
  background: var(--input-bg); border: 1px solid var(--border); outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .18);
}
select.input { appearance: none; }
textarea.input { min-height: 96px; resize: vertical; }
.input::placeholder { color: var(--muted); opacity: .7; }
.input:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--glow); }
.field__error { color: var(--danger); font-size: .8rem; min-height: 1em; }
.field__hint { color: var(--muted); font-size: .78rem; }

.links { display: flex; justify-content: space-between; margin-top: 16px; font-size: .9rem; }
.notice { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--ok) 14%, transparent); border: 1px solid var(--ok); color: var(--ok); }

#toasts { position: fixed; top: calc(var(--safe-t) + 12px); left: 0; right: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: 90%; padding: 11px 16px; border-radius: 14px; }
.toast--error { border-color: var(--danger); }
.toast--success { border-color: var(--ok); }

/* ---------- Home ---------- */
.hero-card {
  position: relative; overflow: hidden; display: block; padding: 22px; border-radius: var(--radius);
  background: var(--grad); color: var(--on-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 14px 34px var(--glow);
}
.hero-card h2 { font-size: 1.3rem; margin-bottom: 4px; }
.hero-card p { opacity: .85; font-weight: 500; }
.hero-card .pill { margin-top: 12px; background: rgba(10, 8, 4, .78); color: #f4d675; }
.hero-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .5) 50%, transparent 62%);
  transform: translateX(-120%); animation: btn-sheen 7s ease-in-out 1.5s infinite;
}
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: var(--radius); color: var(--text); font-size: .85rem; font-weight: 600; }
.tile svg { stroke: var(--accent-text); }
.tile--disabled { opacity: .5; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .7rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

.install-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); }
.install-card strong { display: block; }
.install-card > div { flex: 1; }

/* ---------- Empty state ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; text-align: center; }
.empty__icon { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: var(--gloss), var(--surface-2); border: 1px solid var(--border-strong); box-shadow: 0 0 28px var(--glow); color: var(--accent-text); }

/* ---------- Pickers (frames, themes) ---------- */
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 6px 10px; border-radius: 16px; border-width: 2px; cursor: pointer; font-size: .75rem; font-weight: 600; color: var(--muted); }
.pick.is-selected { border-color: var(--primary); color: var(--text); box-shadow: 0 0 0 3px var(--glow), inset 0 1px 0 var(--edge); }
.pick.is-locked { opacity: .5; }
.pick__lock { position: absolute; top: 6px; right: 8px; font-size: .65rem; }
.swatch { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border-strong); }
.swatch--gold { background: radial-gradient(circle at 30% 25%, #f4d675, #b07a10 45%, #07070a 46%); }
.swatch--pearl { background: radial-gradient(circle at 30% 25%, #ffffff, #e4e4e8 50%, #111113 51%); }
.swatch--chrome { background: radial-gradient(circle at 30% 25%, #ffffff, #8c9bb5 45%, #05060a 46%); }

/* Edit profile: centred live preview */
.preview { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.center.stack > .btn { align-self: center; }

/* ---------- Home: coins, 3 shortcuts, small create-room button ---------- */
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.home-user > div { min-width: 0; }
.home-user strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 999px;
  background: var(--gloss), var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
  box-shadow: inset 0 1px 0 var(--edge), 0 0 18px var(--glow);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}
.coin-chip strong { font-variant-numeric: tabular-nums; font-size: .95rem; }
.coin { display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35)); }
.shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.shortcuts .tile { padding: 20px 6px 16px; gap: 10px; }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: .92rem; border-radius: 12px; }
.create-room { align-self: center; }

/* ---------- Profile (compact: cover, ringed avatar, small cards) ---------- */
.profile { display: flex; flex-direction: column; gap: 12px; }
.profile__cover {
  position: relative; margin: 0 calc(var(--gutter) * -1); height: calc(124px + var(--safe-t)); padding: calc(var(--safe-t) + 10px) 14px 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  border-radius: 0 0 50% 50% / 0 0 28px 28px; overflow: hidden;
  background:
    radial-gradient(60% 90% at 78% 8%, rgba(244, 214, 117, .38), transparent 60%),
    repeating-linear-gradient(115deg, transparent 0 26px, rgba(244, 214, 117, .09) 26px 28px, transparent 28px 61px),
    linear-gradient(135deg, #050507, #1b1710 55%, #0a0a0c);
  background-size: cover; background-position: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.profile__cover.has-image { background-size: cover; background-position: center; }
.profile__cover.has-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, .05) 45%, rgba(0, 0, 0, .25)); pointer-events: none; }
.profile__cover.has-image .profile__crown-mark { display: none; }
.profile__crown-mark { position: absolute; right: 8%; top: 36%; color: rgba(244, 214, 117, .38); transform: rotate(8deg); pointer-events: none; }
.profile__crown-mark svg { stroke-width: 1.2; }
.profile__round { position: relative; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .4); color: #fff; cursor: pointer; }
.profile__menu { position: absolute; z-index: 3; top: calc(var(--safe-t) + 54px); right: 14px; padding: 6px; border-radius: 14px; background: #15130d; border: 1px solid rgba(244, 214, 117, .35); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.profile__menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 0; background: none; color: #ffb4b4; font-weight: 650; cursor: pointer; border-radius: 10px; }

.profile__head { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: -44px; gap: 2px; }
.profile__avatar { position: relative; z-index: 2; border-radius: 50%; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--primary), 0 8px 24px var(--glow); }
.profile__avatar .avatar__img { border: 2px solid #07070a; }
.profile__edit { position: absolute; right: 0; top: 52px; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--primary); background: transparent; color: var(--accent-text); font-weight: 650; font-size: .9rem; cursor: pointer; }
.profile__code { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 0 6px; border: 0; background: none; color: var(--muted); font-size: .88rem; cursor: pointer; }
.profile__code strong { font-weight: 500; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.profile__name { display: inline-flex; align-items: center; gap: 8px; font-size: 1.35rem; }
.profile__name svg { stroke: var(--primary); }
.conn { display: flex; justify-content: center; gap: 36px; margin-top: 8px; }
.conn > div { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.conn strong { font-size: 1.15rem; }
.conn span { font-size: .78rem; }

.profile__bio { align-self: center; width: min(100%, 460px); padding-left: 12px; border-left: 3px solid var(--primary); }
.profile__bio-label { color: var(--accent-text); font-weight: 600; font-size: .85rem; }
.profile__bio p { margin-top: 1px; font-size: .98rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.secs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sec { padding: 12px 14px; border-radius: 16px; background: var(--gloss), var(--surface); border: 1px solid var(--border); box-shadow: inset 0 1px 0 var(--edge), var(--shadow); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }
.sec__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sec__head svg { stroke: var(--primary); }
.sec__head h3 { font-size: .92rem; }
.slots { display: flex; gap: 8px; }
.slot { width: 36px; height: 36px; border: 1.5px dashed var(--border-strong); background: var(--surface-2); }
.slot--round { border-radius: 50%; }
.slot--square { border-radius: 10px; }
.sec__note { margin-top: 6px; }

/* Edit profile: background preview with the avatar sitting on its edge */
.cover-preview { align-self: stretch; height: 92px; border-radius: 16px; border: 1px solid var(--border);
  background: radial-gradient(60% 90% at 78% 8%, rgba(244, 214, 117, .38), transparent 60%), linear-gradient(135deg, #050507, #1b1710 55%, #0a0a0c);
  background-size: cover; background-position: center; }
.cover-preview__avatar { margin-top: -42px; border-radius: 50%; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--primary); }
.center .row--wrap { justify-content: center; }

/* Pearl White = plain white, no gold */
:root[data-theme="pearl"] .profile__cover { background: linear-gradient(135deg, #e6e6ea, #cfcfd6); box-shadow: none; }
:root[data-theme="pearl"] .profile__cover.has-image { background-size: cover; background-position: center; }
:root[data-theme="pearl"] .profile__crown-mark { color: rgba(0, 0, 0, .22); }
:root[data-theme="pearl"] .profile__round { background: rgba(0, 0, 0, .45); }
:root[data-theme="pearl"] .btn--primary::after { display: none; }
:root[data-theme="pearl"] .btn--primary { text-shadow: none; box-shadow: none; }
:root[data-theme="pearl"] .profile__avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #111113; }
:root[data-theme="pearl"] .cover-preview { background: linear-gradient(135deg, #e6e6ea, #cfcfd6); background-size: cover; background-position: center; }

/* Title picker */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 12px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: .8rem; }
.chip.is-selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--glow); }
.profile__title { position: relative; z-index: 3; margin-top: -12px; }
.profile__title:empty { display: none; }
.profile__title + .profile__code { margin-top: 6px; }
.auth__mascot { display: block; width: 84px; height: 84px; margin: 0 0 12px; border-radius: 22px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
