:root {
    --bg: #f5f7fb;
    --card-bg: #ffffff;
    --accent: #5968f2;
    --accent-dark: #434dd4;
    --success: #1f9d55;
    --text: #1f2933;
    --muted: #64748b;
    --border: #e5e9f2;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
    color: var(--text);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    margin: 0 0 0.5rem;
    font-size: 2.5rem;
    font-weight: 700;
}

.header p {
    margin: 0;
    color: var(--muted);
}

.cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 25px 40px -30px rgba(20, 33, 61, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 48px -28px rgba(20, 33, 61, 0.42);
}

.card h2 {
    margin-top: 0;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.form-card {
    max-width: 440px;
    margin: 0 auto;
    padding: 1rem 1.15rem;
    border-radius: 16px;
}

.form-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

.highlight {
    background: linear-gradient(145deg, var(--accent), var(--accent-dark));
    color: #f8fafc;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.1rem 1.5rem;
    border-radius: 22px;
    box-shadow: 0 28px 50px -32px rgba(17, 24, 39, 0.55);
}

.highlight h2 {
    color: inherit;
    margin-bottom: 1rem;
    font-size: 1.35rem;
    letter-spacing: 0.4px;
}

.result-number {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
}

.result-number.forced {
    color: #ffe66d;
}

.result-meta {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    opacity: 0.85;
}

.result-placeholder {
    font-size: 1rem;
    opacity: 0.75;
}

.result-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.result-list li {
    background: rgba(248, 250, 252, 0.18);
    color: #f8fafc;
    padding: 0.85rem 1.9rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 3rem;
    letter-spacing: 0.9px;
    box-shadow: 0 20px 38px -26px rgba(15, 23, 42, 0.65);
}

.draw-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-card .field-group {
    display: grid;
    grid-template-columns: minmax(120px, 160px) 1fr;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.form-card .field-group label {
    font-weight: 600;
    font-size: 0.88rem;
}

.form-card .field-group input[type="number"],
.form-card .field-group input[type="password"] {
    padding: 0.45rem 0.65rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-card .field-group input[type="number"]:focus,
.form-card .field-group input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(89, 104, 242, 0.15);
    outline: none;
}

.form-card .action-button {
    margin-top: 0.35rem;
    padding: 0.75rem 1.1rem;
    font-size: 1rem;
    border-radius: 10px;
}

.form-card .secondary-button {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    border-radius: 10px;
}

.alerts {
    background: rgba(229, 62, 62, 0.1);
    border: 1px solid rgba(229, 62, 62, 0.4);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.alert {
    margin: 0.25rem 0;
    color: #c53030;
}

.notices {
    background: rgba(31, 157, 85, 0.12);
    border: 1px solid rgba(31, 157, 85, 0.35);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.notice {
    margin: 0.25rem 0;
    color: var(--success);
}

.info-banner {
    background: rgba(89, 104, 242, 0.12);
    border: 1px solid rgba(89, 104, 242, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--accent-dark);
}

.action-button {
    width: 100%;
    padding: 0.9rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.action-button:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.secondary-button {
    width: 100%;
    padding: 0.85rem 1.1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-dark);
    background: #e2e8f0;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.secondary-button:hover {
    background: #cbd5f5;
    color: var(--accent-dark);
}

.admin-action {
    margin-top: 1.5rem;
}

.secondary-action {
    margin-top: 0.75rem;
}

.admin-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.info-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;
}

.shortcut-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.link-button {
    display: inline-block;
    padding: 0.75rem 1.1rem;
    border-radius: 10px;
    background: var(--accent);
    color: #f8fafc;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
    text-align: center;
}

.link-button:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.logout-action {
    margin-top: auto;
}

.helper-text {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.status {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.status strong {
    color: var(--text);
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: #f1f5f9;
}

.history-number {
    font-size: 1.4rem;
    font-weight: 700;
}

.history-number.forced {
    color: var(--accent-dark);
}

.history-meta {
    color: var(--muted);
    font-size: 0.95rem;
}

.history-placeholder {
    color: var(--muted);
    margin: 0;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 1.5rem;
    }

    .link-button {
        width: 100%;
    }
}
