/* ============================================================
   PROFILE TEMPLATE / DEFAULT
   ============================================================ */

body.tpl-default {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

/* ─── КОНТЕЙНЕР ─── */
.tpl-default-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ─── HERO ─── */
.tpl-default-hero {
    padding: 24px 0 32px;
}

.hero-block {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
}

.hero-avatar {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), #0d3b1e);
    border: 3px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.hero-info {
    flex: 1;
    min-width: 220px;
}

.hero-name {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 4px 0;
    color: var(--text);
}

.hero-handle {
    font-size: 0.95rem;
    color: #7a8699;
    font-weight: 500;
    margin-bottom: 12px;
}

.hero-bio {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.55;
    margin: 0 0 14px 0;
    max-width: 560px;
}

.hero-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-social {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 40px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.hero-social i { font-size: 14px; }

.hero-social:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.hero-social-yt i { color: #ff2d2d; }

.hero-live {
    position: absolute;
    bottom: 4px;
    left: 76px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid var(--bg);
    animation: pfLivePulse 2s infinite;
}

@keyframes pfLivePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50%      { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ─── STREAM ─── */
.tpl-default-stream {
    background: rgba(20, 20, 28, 0.7);
    border: 1px solid rgba(255, 45, 45, 0.2);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.stream-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.stream-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.stream-live {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.stream-name {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stream-open {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 40px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.stream-open i { color: #ff2d2d; font-size: 13px; }
.stream-open:hover { background: rgba(255, 45, 45, 0.1); border-color: rgba(255, 45, 45, 0.3); }

.stream-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
}

.stream-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ─── GRID ─── */
.tpl-default-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

.tpl-default-donate {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.tpl-default-sidebar {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 20px;
}

/* ─── GOAL ─── */
.donate-goal {
    margin-bottom: 24px;
}

.donate-goal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.donate-goal-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.donate-goal-percent {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.donate-goal-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 10px;
}

.donate-goal-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 20px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.donate-goal-amounts {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #7a8699;
}

.donate-goal-amounts b { color: #cbd5e1; font-weight: 600; }

.donate-goal-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.donate-goal-tab {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 40px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.donate-goal-tab:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.donate-goal-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* ─── AMOUNT ─── */
.donate-amount { margin-bottom: 16px; }

.donate-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #7a8699;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.donate-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.donate-preset {
    padding: 14px 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.donate-preset:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.donate-preset.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.donate-input,
.donate-textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: inherit;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
    resize: none;
}

.donate-input::placeholder,
.donate-textarea::placeholder { color: #64748b; }

.donate-input:focus,
.donate-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

.donate-input[type=number] { text-align: center; font-weight: 600; }
.donate-input[type=number]::-webkit-outer-spin-button,
.donate-input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.donate-input[type=number] { -moz-appearance: textfield; appearance: textfield; }



@keyframes pfSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.donate-counter {
    text-align: right;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

/* ─── SUBMIT ─── */
.donate-submit {
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    transition: all 0.2s;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.donate-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.donate-submit i { transition: transform 0.2s; }
.donate-submit:hover i { transform: translateX(4px); }

.donate-hint {
    text-align: center;
    font-size: 11px;
    color: #64748b;
    margin-top: 10px;
    font-weight: 500;
}

/* ─── SIDEBAR ─── */
.sidebar-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    margin-bottom: 16px;
}

.sidebar-tab {
    flex: 1;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: 9px;
    color: #7a8699;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.sidebar-tab:hover { color: #cbd5e1; }

.sidebar-tab.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 440px;
    overflow-y: auto;
    padding-right: 4px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.15s;
}

.sidebar-item:hover { background: rgba(255, 255, 255, 0.03); }

.sidebar-rank {
    width: 28px;
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    flex-shrink: 0;
    text-align: center;
}

.sidebar-item:nth-child(1) .sidebar-rank { color: #ffd700; font-size: 18px; }
.sidebar-item:nth-child(2) .sidebar-rank { color: #c0c0c0; font-size: 18px; }
.sidebar-item:nth-child(3) .sidebar-rank { color: #cd7f32; font-size: 18px; }

.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-amount {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.sidebar-comment {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.sidebar-time {
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

.sidebar-feed-info { flex: 1; min-width: 0; }

.sidebar-empty {
    text-align: center;
    padding: 40px 16px;
    color: #64748b;
    font-size: 12px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
    .tpl-default-grid { grid-template-columns: 1fr; }
    .tpl-default-sidebar { position: static; }
}

@media (max-width: 640px) {
    .tpl-default-container { padding: 0 16px 100px; }
    .hero-avatar { width: 72px; height: 72px; }
    .hero-live { left: 54px; }
    .hero-name { font-size: 1.5rem; }
    .tpl-default-donate { padding: 20px 16px; border-radius: 20px; }
    .donate-presets { grid-template-columns: repeat(2, 1fr); }
    .donate-submit { padding: 16px 20px; font-size: 15px; }
}

/* ─── Поля в донате (метка + подпись) ─── */
.donate-field {
    margin-bottom: 10px;
}

.donate-field:last-child {
    margin-bottom: 0;
}

.donate-sublabel {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #7a8699;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.donate-toggle b {
    color: var(--accent);
    font-weight: 700;
}