:root {
    --bg: #07070b;
    --bg-soft: #101018;
    --card: #151521;
    --card-2: #1b1b2a;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f4f4f7;
    --text-soft: #b7b7c7;
    --muted: #77778a;
    --primary: #9146ff;
    --primary-hover: #7c35dd;
    --success: #28c76f;
    --danger: #ff4d6d;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(145, 70, 255, 0.18), transparent 35%),
        linear-gradient(135deg, #050507, #0b0b12);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(7, 7, 11, 0.86);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.logo span {
    color: var(--primary);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-soft);
    padding: 10px 14px;
    border-radius: 999px;
    transition: 0.2s ease;
}

.main-nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
}

.main-content {
    padding: 44px 0;
}

.page-head {
    margin-bottom: 28px;
}

.page-head h1 {
    margin: 0 0 10px;
    font-size: clamp(32px, 4vw, 54px);
    letter-spacing: -0.05em;
}

.page-head p {
    margin: 0;
    color: var(--text-soft);
    font-size: 17px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card,
.panel {
    background: linear-gradient(145deg, rgba(21, 21, 33, 0.96), rgba(14, 14, 22, 0.96));
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 22px;
}

.stat-label {
    color: var(--text-soft);
    font-size: 14px;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 34px;
    color: var(--primary);
}

.stat-card p {
    margin: 6px 0 0;
    color: var(--muted);
}

.panel {
    padding: 24px;
}

.compact-panel {
    padding: 20px;
}

.panel h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

.panel p {
    color: var(--text-soft);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.btn {
    border: 0;
    background: var(--primary);
    color: #fff;
    padding: 11px 16px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-hover);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn.secondary,
.small-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.btn.secondary:hover,
.small-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.14);
}

.btn.danger {
    background: rgba(255, 77, 109, 0.16);
    color: var(--danger);
}

.btn.danger:hover {
    background: rgba(255, 77, 109, 0.28);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 700;
}

td {
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 700;
}

.badge.success {
    background: rgba(40, 199, 111, 0.14);
    color: var(--success);
}

.badge.danger {
    background: rgba(255, 77, 109, 0.14);
    color: var(--danger);
}

.muted {
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 22px 0;
    color: var(--muted);
    background: rgba(0, 0, 0, 0.2);
}

.alert {
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.alert p {
    margin: 0;
}

.alert.success {
    background: rgba(40, 199, 111, 0.12);
    color: var(--success);
}

.alert.danger {
    background: rgba(255, 77, 109, 0.12);
    color: var(--danger);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-grid.single {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full,
.full {
    grid-column: 1 / -1;
}

label {
    color: var(--text-soft);
    font-weight: 700;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.055);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(145, 70, 255, 0.7);
    box-shadow: 0 0 0 4px rgba(145, 70, 255, 0.12);
}

select option {
    background: #151521;
    color: #fff;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: auto;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

.small-btn {
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.small-btn:hover {
    background: var(--primary-hover);
}

.small-btn.danger {
    background: rgba(255, 77, 109, 0.16);
    color: var(--danger);
}

.small-btn.danger:hover {
    background: rgba(255, 77, 109, 0.28);
}

/* GIVEAWAY */

.giveaway-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.7fr);
    gap: 24px;
    align-items: start;
}

.giveaway-card {
    min-height: 640px;
    background: #1b1d24;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 8px;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr auto;
    box-shadow: var(--shadow);
}

.giveaway-toolbar {
    height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 14px;
}

.giveaway-search {
    width: min(260px, 100%);
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.035);
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    color: var(--muted);
}

.giveaway-search input {
    border: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    font-size: 14px;
}

.giveaway-search input:focus {
    box-shadow: none;
    border: 0;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
}

.giveaway-stage {
    position: relative;
    min-height: 500px;
    padding: 18px;
}

.empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    color: var(--text);
    padding: 24px;
}

.empty-state.small {
    position: static;
    min-height: 420px;
}

.empty-icon {
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(255, 255, 255, 0.55);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 900;
    letter-spacing: 4px;
    margin-bottom: 24px;
}

.empty-state h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
    color: #fff;
    font-weight: 700;
}

.giveaway-live-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 14px;
    background: rgba(145, 70, 255, 0.12);
    border: 1px solid rgba(145, 70, 255, 0.22);
}

.giveaway-live-head strong {
    display: block;
    font-size: 17px;
}

.giveaway-live-head small {
    color: var(--text-soft);
}

.live-dot {
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 999px;
    box-shadow: 0 0 0 8px rgba(40, 199, 111, 0.12);
}

.participant-list {
    display: grid;
    gap: 10px;
}

.participant-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.participant-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
}

.participant-row strong {
    display: block;
}

.participant-row small {
    color: var(--muted);
}

.giveaway-bottom {
    min-height: 64px;
    border-top: 1px solid rgba(255, 255, 255, 0.065);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 16px;
}

.winner-btn {
    border: 0;
    background: #9a9da6;
    color: #1c1e24;
    border-radius: 5px;
    padding: 10px 18px;
    font-weight: 800;
    cursor: pointer;
}

.winner-btn:hover {
    filter: brightness(1.08);
}

.winner-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.giveaway-count {
    color: #fff;
    font-weight: 800;
}

.giveaway-side {
    display: grid;
    gap: 18px;
}

.giveaway-info-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.065);
    margin-bottom: 10px;
}

.giveaway-info-box span {
    color: var(--text-soft);
}

.giveaway-info-box strong {
    color: var(--text);
}

.side-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.side-actions form,
.side-actions button {
    width: 100%;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.065);
}

.history-item strong,
.history-item small {
    display: block;
}

.history-item small {
    color: var(--muted);
    margin-top: 4px;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .giveaway-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 0;
    }
}

@media (max-width: 720px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .giveaway-card {
        min-height: 560px;
    }

    .giveaway-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .giveaway-count {
        font-size: 14px;
    }
}

@media (max-width: 620px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-nav {
        width: 100%;
    }

    .main-nav a {
        padding: 9px 10px;
    }

    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

.entry-check {
    display: flex;
    align-items: center;
    justify-content: center;
}

.entry-check input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.participant-row.disabled-entry {
    opacity: 0.42;
    filter: grayscale(1);
}

.participant-row.disabled-entry .participant-avatar {
    background: rgba(255, 255, 255, 0.16);
}

.settings-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-avatar {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(145, 70, 255, 0.55);
}

.help-text {
    color: var(--muted);
    font-size: 13px;
}

.top-users {
    list-style: none;
    padding: 0;
    margin: 0;
}

.top-users li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.login-hero {
    min-height: calc(100vh - 190px);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(620px, 100%);
    background: linear-gradient(145deg, rgba(21, 21, 33, 0.96), rgba(14, 14, 22, 0.96));
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 38px;
    text-align: center;
}

.login-card h1 {
    font-size: clamp(34px, 5vw, 62px);
    margin: 18px 0 14px;
    letter-spacing: -0.05em;
}

.login-card p {
    color: var(--text-soft);
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 26px;
}

.twitch-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    padding: 14px 22px;
    border-radius: 16px;
    font-weight: 800;
}

.twitch-login-btn:hover {
    background: var(--primary-hover);
}

.top-users {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: grid;
    gap: 10px;
}

.top-users li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--border);
}

.top-users strong,
.top-users small {
    display: block;
}

.top-users small {
    color: var(--muted);
    margin-top: 4px;
}

.top-users span {
    color: var(--text-soft);
    font-weight: 700;
}