:root {
    --bg1: #edf6f3;
    --bg2: #f7f1e8;
    --ink: #142824;
    --muted: #5a6f69;
    --teal: #0b6e72;
    --teal-dark: #084f52;
    --coral: #c85a3c;
    --gold: #c4922a;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-strong: rgba(255, 255, 255, 0.92);
    --line: rgba(20, 40, 36, 0.1);
    --shadow: 0 28px 70px rgba(12, 50, 46, 0.14);
    --radius: 26px;
    --font: "IranSans", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg1);
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(1000px 560px at 8% -10%, #bfe8df 0%, transparent 55%),
        radial-gradient(900px 520px at 100% 0%, #f0d2b4 0%, transparent 48%),
        radial-gradient(700px 400px at 70% 100%, #d8ebe4 0%, transparent 45%),
        linear-gradient(165deg, var(--bg1), var(--bg2));
}

.page-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(11, 110, 114, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11, 110, 114, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
}

.page-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
}

.brand {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal);
}

h1 {
    margin: 0 0 12px;
    font-size: clamp(1.85rem, 3.4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.lead, .muted {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.hero-points {
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.hero-points li {
    position: relative;
    padding-right: 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

.hero-points li::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 4px rgba(11, 110, 114, 0.12);
}

.hero-panel {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 34px;
    align-items: center;
    animation: rise 0.75s ease both;
}

.hero-panel.compact { width: min(820px, 100%); }

.hero-copy { padding: 8px 4px; }

.entry-form,
.admin-shell,
.wait-panel,
.room-shell,
.list-block {
    background: var(--surface);
    border: 1px solid var(--line);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.entry-form {
    padding: 30px;
    display: grid;
    gap: 16px;
    background: var(--surface-strong);
    animation: rise 0.75s ease both;
    animation-delay: 0.08s;
}

.form-kicker {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.04em;
}

.entry-form label {
    display: grid;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
}

.entry-form input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 16px;
    padding: 14px 15px;
    font: inherit;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.entry-form input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 5px rgba(11, 110, 114, 0.12);
    transform: translateY(-1px);
}

.btn-primary,
.btn-ghost,
.btn-ok,
.btn-no,
.ctrl-btn {
    font: inherit;
    border: none;
    cursor: pointer;
    border-radius: 16px;
    transition: transform 0.15s ease, background 0.2s, opacity 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: #fff;
    padding: 14px 18px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(11, 110, 114, 0.28);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(11, 110, 114, 0.34);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.55);
    color: var(--ink);
    border: 1px solid var(--line);
    padding: 11px 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-ghost:hover { background: #fff; }

.alert {
    background: #fde8e2;
    color: #8a3a28;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.92rem;
}

.wait-panel {
    width: min(480px, 100%);
    text-align: center;
    padding: 52px 30px;
    position: relative;
    overflow: hidden;
    animation: rise 0.7s ease both;
    background: var(--surface-strong);
}

.pulse-ring {
    width: 84px;
    height: 84px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: rgba(11, 110, 114, 0.12);
    position: relative;
}

.pulse-ring::before {
    content: "";
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: var(--teal);
    animation: pulse 1.6s ease infinite;
}

.status-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.7rem;
    font-weight: 700;
}

.status-icon.reject {
    background: #fde8e2;
    color: var(--coral);
}

.wait-dots {
    margin-top: 26px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.wait-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--teal);
    animation: bounce 1.2s ease infinite;
}

.wait-dots span:nth-child(2) { animation-delay: 0.15s; }
.wait-dots span:nth-child(3) { animation-delay: 0.3s; }

.admin-shell {
    width: min(1040px, 100%);
    padding: 30px;
    animation: rise 0.55s ease both;
    background: var(--surface-strong);
}

.admin-top,
.room-top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
}

.list-block {
    padding: 22px;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.55);
}

.list-block h2 {
    margin: 0 0 16px;
    font-size: 1.08rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: var(--coral);
    color: #fff;
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 2px 9px;
}

.badge.soft {
    background: rgba(11, 110, 114, 0.14);
    color: var(--teal-dark);
}

.person-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.person-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--line);
    transition: transform 0.15s ease, box-shadow 0.15s;
}

.person-list li:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(12, 50, 46, 0.08);
}

.person-list li span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 2px;
}

.person-list.simple li { justify-content: space-between; }

.row-actions { display: flex; gap: 8px; }

.btn-ok {
    background: var(--teal);
    color: #fff;
    padding: 8px 12px;
}

.btn-no {
    background: #f3e0da;
    color: #8a3a28;
    padding: 8px 12px;
}

.btn-sm { padding: 8px 12px; font-size: 0.85rem; }

.empty { color: var(--muted); margin: 0; }

.room-shell {
    width: min(1180px, 100%);
    padding: 22px;
    min-height: min(88vh, 940px);
    display: flex;
    flex-direction: column;
    animation: rise 0.55s ease both;
    background: var(--surface-strong);
}

.room-shell.wide { width: min(1280px, 100%); }

.room-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.ctrl-btn {
    min-width: 84px;
    height: 44px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 0.88rem;
    font-weight: 600;
}

.ctrl-btn.off { background: #f5ebe7; color: #8a3a28; }
.ctrl-btn.locked { opacity: 0.55; cursor: not-allowed; }
.ctrl-btn.accent {
    background: linear-gradient(135deg, #0b6e72, #147a62);
    color: #fff;
    border: none;
    min-width: 120px;
}

.media-hint {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.92rem;
}

.media-hint.wait {
    background: rgba(196, 146, 42, 0.12);
    color: #8a6418;
}

.media-hint.ok {
    background: rgba(11, 110, 114, 0.1);
    color: var(--teal-dark);
}

.room-body {
    flex: 1;
    display: grid;
    gap: 16px;
    min-height: 0;
}

.room-body.with-side {
    grid-template-columns: 1fr 280px;
}

.member-side {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
}

.member-side h2 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.side-lead {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.6;
}

.member-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    margin-bottom: 8px;
}

.member-row .muted-sm {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 2px;
}

.perm-ok {
    color: var(--teal);
    font-size: 0.82rem;
    font-weight: 700;
}

.video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    align-content: start;
}

.video-tile {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(160deg, #123833, #0c2a26);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 34px rgba(8, 40, 36, 0.2);
    animation: fadeIn 0.45s ease both;
}

.video-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: transparent;
    transform: scaleX(-1);
    position: relative;
    z-index: 1;
}

.video-tile.screen-share video {
    transform: none;
    object-fit: contain;
    background: #0c2a26;
}

.video-tile.no-media video { opacity: 0; }

.avatar-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,0.08), transparent 40%),
        linear-gradient(160deg, #164942, #0d2f2b);
}

.avatar-fallback::before {
    content: "";
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 -18px 0 rgba(0, 0, 0, 0.12);
}

.tile-name {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    background: rgba(8, 30, 28, 0.7);
    color: #fff;
    font-size: 0.82rem;
    padding: 6px 10px;
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.admin-notify-box {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 9999;
    display: grid;
    gap: 12px;
    width: min(360px, calc(100vw - 36px));
    pointer-events: none;
}

.admin-notify-card {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(8, 40, 36, 0.18);
    padding: 16px;
    animation: notifyIn 0.35s ease both;
}

.admin-notify-card.busy { opacity: 0.7; }

.admin-notify-head {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--coral);
    margin-bottom: 8px;
}

.admin-notify-body strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.admin-notify-body span {
    color: var(--muted);
    font-size: 0.86rem;
}

.admin-notify-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.admin-notify-actions .btn-ok,
.admin-notify-actions .btn-no {
    flex: 1;
    padding: 10px 12px;
    border-radius: 12px;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.7; }
}

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40% { transform: translateY(-6px); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes notifyIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
    .hero-panel,
    .admin-grid,
    .room-body.with-side {
        grid-template-columns: 1fr;
    }

    .admin-top,
    .room-top {
        flex-direction: column;
    }

    .page-shell {
        align-items: flex-start;
    }
}
