.profile-hero { display: grid; grid-template-columns: 300px minmax(0, 1fr); overflow: hidden; margin-bottom: 8px; }
.profile-stage {
  --look: rgb(235, 70, 70);
  position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 300px; margin: 0; padding: 24px 0 34px;
  background: radial-gradient(160px 200px at 50% 60%, color-mix(in srgb, var(--look) 38%, transparent), transparent 75%), #090c12;
  border-right: 1px solid var(--line);
}
.profile-stage::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(98deg, rgba(240, 240, 245, 0.03) 0 2px, transparent 2px 24px);
}
.profile-stage::after {
  content: ''; position: absolute; left: 50%; bottom: 26px; width: 190px; height: 16px; margin-left: -95px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--look) 55%, transparent), transparent);
}
.profile-stage .fighter-svg { position: relative; z-index: 1; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.6)); animation: pop 0.45s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(0.96); opacity: 0.2; } to { transform: none; opacity: 1; } }
.profile-stage figcaption { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; z-index: 1; font-size: 0.8rem; color: var(--dim); }
.profile-main { padding: 28px 30px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.profile-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile-id h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3.4rem); overflow-wrap: anywhere; }
.profile-id .presence { margin-top: 6px; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 10px; }
.fact { min-width: 120px; padding: 12px 16px; background: rgba(8, 10, 15, 0.55); border: 1px solid var(--line); border-radius: 8px; }
.fact strong { display: block; font: 800 2rem/1 var(--font-display); letter-spacing: 0.02em; }
.fact span { color: var(--muted); font-size: 0.82rem; }
.fact.elo strong { color: var(--bolt); }
.fact.flash strong { animation: flash 0.9s ease-out; }
@keyframes flash { 0% { color: #fff; text-shadow: 0 0 14px var(--bolt); } 100% { text-shadow: none; } }
.xp-bar { height: 6px; margin-top: 8px; background: var(--line); transform: skewX(-20deg); overflow: hidden; }
.xp-fill { display: block; height: 100%; background: var(--blue); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.season-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.season-badge.podium { border-color: var(--bolt); color: var(--bolt); }
.profile-section { padding: 40px 0 0; }
.profile-section > h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.profile-section > h2 .muted { font: 600 1rem/1 var(--font-text); text-transform: none; letter-spacing: 0; }
@media (max-width: 760px) {
  .profile-hero { grid-template-columns: 1fr; }
  .profile-stage { min-height: 230px; border-right: 0; border-bottom: 1px solid var(--line); }
  .profile-main { padding: 22px 18px; }
  .fact { flex: 1 1 calc(50% - 10px); min-width: 0; }
}

.friends-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.friends-aside { display: grid; gap: 18px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-title h2 { font-size: 1.5rem; margin: 0; }
.count-pill { padding: 2px 10px; border-radius: 12px; background: var(--panel-3); color: var(--muted); font: 700 0.8rem/1.4 var(--font-text); }
.count-pill.hot { background: var(--red); color: #fff; }
.person-list { display: grid; gap: 8px; }
.person {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; transition: border-color 0.15s, background 0.15s;
}
.person:hover { border-color: var(--line-2); background: var(--panel-2); }
.person.compact { grid-template-columns: auto minmax(0, 1fr) auto; padding: 8px 10px; }
.person .who { min-width: 0; }
.person .who a { font-weight: 700; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who a:hover { color: var(--bolt); }
.person .who .presence, .person .who .tiny { display: flex; overflow: hidden; white-space: nowrap; }
.person .who .presence span:last-child { overflow: hidden; text-overflow: ellipsis; }
.person .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.person.offline { opacity: 0.72; }
.requests-banner { margin-bottom: 24px; border-color: rgba(235, 70, 70, 0.45); background: linear-gradient(180deg, rgba(235, 70, 70, 0.1), var(--panel)); }
.search-results { margin-top: 12px; }
.search-wide { max-width: none; }
.friends-aside .person { grid-template-columns: auto minmax(0, 1fr); }
.friends-aside .person .actions { grid-column: 1 / -1; justify-content: flex-start; }
.login-gate { max-width: 560px; margin: 20px auto; text-align: center; padding: 40px 28px; display: grid; justify-items: center; gap: 14px; }
.login-gate p { margin: 0; color: var(--muted); }
@media (max-width: 900px) {
  .friends-layout { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .person { grid-template-columns: auto minmax(0, 1fr); }
  .person .mini-fighter { display: none; }
  .person .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .person.compact .actions { grid-column: auto; }
}

.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--muted); text-decoration: none; font-weight: 600; }
.back-link::before { content: '←'; }
.clip-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: 'stage info' 'comments info'; gap: 0 24px; align-items: start; }
.clip-stage { grid-area: stage; padding: 0; overflow: hidden; background: #04060a; }
.clip-info { grid-area: info; }
.comments { grid-area: comments; min-width: 0; }
.clip-stage img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: #04060a; }
.clip-info { padding: 24px; display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.clip-info h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0; overflow-wrap: anywhere; }
.clip-facts { display: grid; gap: 6px; color: var(--muted); font-size: 0.92rem; }
.clip-facts b { color: var(--bone); font-weight: 600; }
.clip-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.like-big { --cut: 12px; padding: 13px 26px; font: 800 1.3rem/1 var(--font-display); letter-spacing: 0.06em; }
.like-big .heart { display: inline-flex; transition: transform 0.2s; }
.like-big .like-text { font: 700 0.85rem/1 var(--font-text); letter-spacing: 0.02em; text-transform: none; opacity: 0.85; margin-left: 4px; }
.like-big.liked .heart { animation: heart 0.4s ease-out; }
@keyframes heart { 50% { transform: scale(1.45); } }
.comments { margin-top: 28px; }
.comment-form { display: grid; gap: 10px; margin-bottom: 20px; }
.comment-form .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.comment-list { display: grid; gap: 10px; }
.comment { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.comment-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.comment-head a { font-weight: 700; text-decoration: none; }
.comment-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .text-button { font-size: 0.82rem; margin-left: auto; }
.comment.fresh { animation: pop 0.35s ease-out; }
@media (max-width: 900px) {
  .clip-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'stage' 'info' 'comments'; gap: 18px; }
  .clip-info { position: static; }
  .comments { margin-top: 10px; }
}

.link-page { width: 100%; max-width: 620px; margin: 0 auto; padding: 40px var(--gutter) 72px; }
.link-card { padding: 34px 32px 30px; text-align: center; overflow: hidden; }
.link-card h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); margin-bottom: 0.25em; }
.link-card .lead { color: var(--muted); margin: 0 auto 24px; max-width: 440px; }
.link-steps { display: flex; justify-content: center; gap: 6px; margin-bottom: 26px; flex-wrap: wrap; }
.link-step { display: flex; align-items: center; gap: 8px; padding: 6px 12px; color: var(--dim); font: 700 0.82rem/1 var(--font-text); letter-spacing: 0.06em; text-transform: uppercase; }
.link-step .n { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line-2); font-size: 0.8rem; }
.link-step.done { color: var(--green); }
.link-step.done .n { border-color: var(--green); background: var(--green); color: #07130b; }
.link-step.active { color: var(--bone); }
.link-step.active .n { border-color: var(--bolt); background: var(--bolt); color: #15120a; }
.code-tiles { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 4px 0 10px; }
.code-tile {
  width: 52px; height: 68px; display: grid; place-items: center; background: var(--arena); border: 1px solid var(--line-2);
  font: 800 2.6rem/1 var(--font-display); color: var(--bolt); border-radius: 6px; transform: skewX(var(--skew));
  animation: tile-in 0.4s ease-out backwards;
}
.code-dash { width: 14px; height: 4px; background: var(--muted); margin: 0 4px; transform: skewX(-24deg); }
@keyframes tile-in { from { opacity: 0; transform: skewX(var(--skew)) translateY(10px); } }
.code-question { font: 700 1.15rem/1.3 var(--font-text); margin: 18px 0 22px; }
.link-user { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 24px; background: var(--panel-3); margin-bottom: 20px; font-weight: 600; max-width: 100%; }
.link-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-actions { display: grid; justify-items: center; gap: 14px; }
.link-actions .btn-big { width: min(100%, 420px); }
.link-foot { margin-top: 22px; font-size: 0.9rem; color: var(--muted); }
.code-form { display: grid; gap: 14px; justify-items: center; }
.code-input {
  width: min(100%, 340px); text-align: center; padding: 14px; border-radius: 8px; border: 2px solid var(--line-2); background: var(--arena); color: var(--bolt);
  font: 800 2.4rem/1 var(--font-display); letter-spacing: 0.16em; text-transform: uppercase;
}
.code-input:focus { outline: none; border-color: var(--bolt); }
.code-input::placeholder { color: var(--line-2); }
.form-error { color: #ff8b8b; min-height: 1.4em; margin: 0; font-weight: 600; }
.result-icon { width: 104px; height: 104px; margin: 6px auto 18px; }
.result-icon circle { fill: none; stroke-width: 6; stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw 0.6s ease-out forwards; }
.result-icon path { fill: none; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 0.4s 0.45s ease-out forwards; }
.result-icon.ok circle, .result-icon.ok path { stroke: var(--green); }
.result-icon.err circle, .result-icon.err path { stroke: var(--red); }
.result-icon.ok { filter: drop-shadow(0 0 22px rgba(70, 200, 110, 0.35)); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.link-card.success { border-color: rgba(70, 200, 110, 0.5); background: linear-gradient(180deg, rgba(70, 200, 110, 0.1), var(--panel)); }
.link-card.failed { border-color: rgba(235, 70, 70, 0.45); }
.spinner { width: 20px; height: 20px; border: 3px solid rgba(21, 18, 10, 0.3); border-top-color: #15120a; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) {
  .link-card { padding: 26px 16px 22px; }
  .link-steps { gap: 0; flex-wrap: nowrap; }
  .link-step { padding: 6px 5px; gap: 5px; font-size: 0.68rem; letter-spacing: 0.03em; }
  .link-step .n { width: 20px; height: 20px; font-size: 0.7rem; }
  .code-tiles { gap: 4px; }
  .code-tile { width: 34px; height: 50px; font-size: 1.8rem; }
  .code-dash { width: 8px; margin: 0 2px; }
}

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