@font-face {
    font-family: 'Vazir';
    src:
        url('../fonts/Vazir.woff2') format('woff2'),
        url('../fonts/Vazir.woff') format('woff'),
        url('../fonts/vazir.woff2') format('woff2'),
        url('../fonts/vazir.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
    font-family: 'Vazir', Tahoma, Arial, sans-serif !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #dff8cf 0, #f9efd8 38%, #eef8e5 100%);
    color: #24402d;
}

.page {
    min-height: 100vh;
    padding: 32px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.center {
    align-items: center;
}

.glass {
    width: 100%;
    background: rgba(255, 255, 255, .34);
    border: 1px solid rgba(255, 255, 255, .62);
    box-shadow: 0 24px 80px rgba(74, 112, 68, .18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 28px;
}

.poll-card {
    max-width: 720px;
    padding: 34px;
}

.admin-card {
    max-width: 720px;
    padding: 28px;
}

.wide {
    max-width: 1200px;
    padding: 28px;
}

h1 {
    margin: 0 0 16px;
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.7;
}

.poll-title {
    text-align: center;
}

.badge-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.badge {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(122, 181, 96, .20);
    border: 1px solid rgba(95, 156, 74, .22);
    color: #315f28;
}

.vote-message {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    color: #276b39;
    background: rgba(106, 176, 88, .16);
    border: 1px solid rgba(89, 152, 70, .18);
}

.vote-message:empty {
    display: none;
}

.participants,
.hint {
    color: #56715b;
    text-align: center;
}

.options {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.option-btn {
    position: relative;
    overflow: hidden;
    width: 100%;
    border: 1px solid rgba(67, 128, 62, .2);
    background: rgba(255, 255, 255, .56);
    border-radius: 20px;
    padding: 18px 20px;
    font-size: 17px;
    color: #24402d;
    text-align: right;
    cursor: pointer;
    transition: .2s ease;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(79, 123, 67, .16);
}

.bar {
    display: none;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(78, 151, 55, .40), rgba(203, 165, 74, .62));
    z-index: 0;
    transition: width .35s ease;
}

.option-text,
.percent,
.count {
    position: relative;
    z-index: 1;
}

.percent,
.count {
    display: none;
    font-weight: bold;
}

.has-results .bar,
.has-results .percent {
    display: block;
}

.has-results .option-btn {
    cursor: default;
}

.has-results .selected {
    border-color: rgba(73, 142, 59, .55);
    box-shadow: 0 0 0 3px rgba(127, 187, 102, .16);
}

.show-numbers .count {
    display: block;
}

.show-numbers .percent {
    display: none;
}

.channel-link {
    display: block;
    text-align: center;
    margin-top: 18px;
    color: #2f7a3e;
    font-weight: bold;
    text-decoration: none;
}

.channel-link:hover {
    text-decoration: underline;
}

.form {
    display: grid;
    gap: 16px;
}

.form label {
    display: grid;
    gap: 8px;
    font-weight: bold;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(72, 117, 62, .22);
    border-radius: 16px;
    padding: 13px 14px;
    background: rgba(255, 255, 255, .62);
    color: #24402d;
    font-size: 15px;
}

button,
.btn {
    font-family: 'Vazir', Tahoma, Arial, sans-serif !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 16px;
    background: #6ea64f;
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(87, 138, 61, .20);
}

.btn.danger {
    background: #b94a48;
}

.btn.ghost {
    background: rgba(255, 255, 255, .55);
    color: #426b35;
    border: 1px solid rgba(91, 141, 70, .25);
    box-shadow: none;
}

.btn.small {
    padding: 9px 12px;
    border-radius: 13px;
    font-size: 14px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.topbar > div {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.alert {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 100, 100, .15);
    border: 1px solid rgba(210, 80, 80, .24);
    margin-bottom: 14px;
}

.success {
    padding: 14px;
    border-radius: 16px;
    background: rgba(117, 185, 89, .14);
    border: 1px solid rgba(78, 148, 61, .22);
    margin-bottom: 14px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

th,
td {
    text-align: right;
    padding: 12px;
    background: rgba(255, 255, 255, .38);
    vertical-align: top;
}

th:first-child,
td:first-child {
    border-radius: 0 14px 14px 0;
}

th:last-child,
td:last-child {
    border-radius: 14px 0 0 14px;
}

.link-input {
    direction: ltr;
    text-align: left;
    min-width: 280px;
}

.report-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.report-list li {
    margin-bottom: 6px;
    white-space: nowrap;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

.option-edit-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.option-votes {
    font-size: 13px;
    color: #5b775d;
    white-space: nowrap;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(29, 48, 31, .32);
    z-index: 9999;
}

.modal-backdrop.show {
    display: flex;
}

.modal-box {
    width: min(420px, 100%);
    padding: 24px;
    border-radius: 24px;
    text-align: center;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(255, 255, 255, .72);
    box-shadow: 0 24px 80px rgba(35, 60, 38, .24);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.modal-box h2 {
    margin: 0 0 10px;
    color: #276b39;
    font-size: 22px;
    line-height: 1.8;
}

.modal-box p {
    margin: 0 0 18px;
    color: #56715b;
    line-height: 1.9;
}

@media(max-width: 640px) {
    .page {
        padding: 16px;
    }

    .poll-card,
    .admin-card,
    .wide {
        padding: 20px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .option-btn {
        font-size: 15px;
        padding: 15px;
    }
}