:root {
    --bg-color: var(--tg-theme-bg-color, #0f172a);
    --secondary-bg: var(--tg-theme-secondary-bg-color, #1e293b);
    --text-color: var(--tg-theme-text-color, #f8fafc);
    --hint-color: var(--tg-theme-hint-color, #94a3b8);
    --link-color: var(--tg-theme-link-color, #38bdf8);
    --button-color: var(--tg-theme-button-color, #2563eb);
    --button-text-color: var(--tg-theme-button-text-color, #ffffff);
    --card-border: rgba(255, 255, 255, 0.08);
    --success-color: #10b981;
    --accent-glow: rgba(37, 99, 235, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 16px;
}

.container {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: auto 0;
}

.header {
    text-align: center;
    padding: 10px 0;
}

.logo-badge {
    font-size: 40px;
    margin-bottom: 8px;
}

h1 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
}

.description {
    font-size: 14px;
    color: var(--hint-color);
    line-height: 1.4;
}

.card {
    background: var(--secondary-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--card-border);
}

.warning-card {
    text-align: center;
    border-color: rgba(245, 158, 11, 0.3);
}

.warning-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.warning-card h3 {
    margin-bottom: 8px;
    font-size: 18px;
}

.warning-card p {
    font-size: 14px;
    color: var(--hint-color);
    margin-bottom: 16px;
    line-height: 1.4;
}

.tg-btn, .main-button {
    display: block;
    width: 100%;
    background-color: var(--button-color);
    color: var(--button-text-color);
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s, transform 0.1s;
}

.tg-btn:active, .main-button:active {
    transform: scale(0.98);
}

.main-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--card-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-label:hover {
    border-color: var(--button-color);
    background: rgba(37, 99, 235, 0.05);
}

.option-label input[type="radio"] {
    display: none;
}

.custom-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--hint-color);
    margin-right: 12px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
}

.option-label input[type="radio"]:checked + .custom-radio {
    border-color: var(--button-color);
}

.option-label input[type="radio"]:checked + .custom-radio::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--button-color);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.option-text {
    font-size: 15px;
    line-height: 1.3;
}

/* Results */
.already-voted-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.check-icon {
    font-weight: bold;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 14px;
}

.result-item.selected-vote {
    border-color: var(--button-color);
    background: rgba(37, 99, 235, 0.08);
}

.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.result-percent {
    font-weight: 700;
    color: var(--link-color);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--button-color), #60a5fa);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.result-count {
    font-size: 12px;
    color: var(--hint-color);
    text-align: right;
}

.total-votes-bar {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--card-border);
    text-align: center;
    font-size: 14px;
    color: var(--hint-color);
}

.status-msg {
    margin-top: 14px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.status-msg.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.footer {
    text-align: center;
    font-size: 12px;
    color: var(--hint-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 12px;
}

.security-seal {
    opacity: 0.8;
}

.hidden {
    display: none !important;
}
