/* Free giveaway picker (/tools/giveaway-picker): template/giveaway_picker.inc.php, js/giveaway_picker.js */

.gp-page {
    --gp-primary: #4a3aff;
    --gp-primary-dark: #3a2ae0;
    --gp-ink: #1f2937;
    --gp-muted: #6b7280;
    --gp-line: #e5e7eb;
    --gp-soft: #f5f3ff;
    --gp-error: #b91c1c;
    font-family: Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--gp-ink);
    max-width: 1160px;
    margin: 0 auto;
    padding: 120px 20px 0;
    box-sizing: border-box;
}

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

/* The site's global CSS floats headings and list items left: keep them in the normal flow here */
.gp-page h1,
.gp-page h2,
.gp-page h3,
.gp-page li,
.gp-page p {
    float: none;
}

.gp-result li {
    text-align: center;
}

.gp-hero {
    text-align: center;
    margin-bottom: 32px;
}

.gp-hero h1 {
    font-size: 48px;
    line-height: 1.1;
    font-weight: 600;
    color: #222;
    margin: 0 0 16px;
}

.gp-lede {
    font-size: 19px;
    line-height: 1.6;
    color: #374151;
    max-width: 640px;
    margin: 0 auto;
}

/* Two columns: the list and the rules on the left, the wheel and the result on the right */
.gp-tool {
    display: grid;
    grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.gp-stage {
    display: grid;
    gap: 24px;
    justify-items: center;
    min-width: 0;
}

.gp-wheel-slot {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 22px; /* room for the needle above the wheel */
}

.gp-idle[hidden] {
    display: none;
}

.gp-card {
    background: #fff;
    border: 1px solid #eff0f6;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(20, 20, 43, 0.08);
    padding: 28px;
}

.gp-field {
    margin-bottom: 18px;
}

.gp-label-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.gp-label {
    font-size: 17px;
    font-weight: 600;
    color: var(--gp-ink);
    padding: 0;
}

.gp-label-sm {
    display: block;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 6px;
}

.gp-hint {
    font-weight: 400;
    color: var(--gp-muted);
    font-size: 14px;
}

.gp-count {
    font-size: 14px;
    color: var(--gp-muted);
}

.gp-textarea,
.gp-input {
    width: 100%;
    font: inherit;
    font-size: 16px; /* 16px keeps iOS from zooming in */
    color: var(--gp-ink);
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 12px 14px;
}

.gp-textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.5;
}

.gp-input {
    min-height: 46px;
}

.gp-textarea:focus,
.gp-input:focus {
    outline: none;
    border-color: var(--gp-primary);
    box-shadow: 0 0 0 3px rgba(74, 58, 255, 0.2);
}

.gp-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 15px;
}

.gp-upload-label {
    color: var(--gp-muted);
}

.gp-file {
    font: inherit;
    font-size: 14px;
    max-width: 100%;
    min-height: 44px;
    line-height: 44px;
}

.gp-file::file-selector-button {
    min-height: 44px;
    margin-right: 12px;
    padding: 0 18px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--gp-primary);
    background: #fff;
    border: 1px solid #c7c2ff;
    border-radius: 10px;
    cursor: pointer;
}

.gp-file::file-selector-button:hover {
    background: var(--gp-soft);
}

.gp-csv-line {
    flex-basis: 100%;
    font-size: 14px;
    color: var(--gp-muted);
}

.gp-csv-status:empty {
    display: none;
}

/* The site menu is fixed at the top: leave room for it when the page scrolls or focuses one of these */
#gp-result,
#gp-entries,
#gp-winners,
#gp-alternates,
#gp-filter {
    scroll-margin-top: 96px;
}

[aria-invalid="true"] {
    border-color: var(--gp-error);
}

.gp-settings {
    border: 0;
    border-top: 1px solid var(--gp-line);
    margin: 8px 0 0;
    padding: 18px 0 0;
    min-width: 0;
}

.gp-settings legend {
    float: left;
    width: 100%;
    margin-bottom: 12px;
}

.gp-grid {
    clear: both;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.gp-checks {
    margin-bottom: 18px;
}

.gp-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-size: 16px;
    cursor: pointer;
}

.gp-check input {
    width: 20px;
    height: 20px;
    accent-color: var(--gp-primary);
    margin: 0;
}

.gp-help {
    font-size: 14px;
    color: var(--gp-muted);
    margin: -6px 0 0 30px;
}

.gp-error {
    color: var(--gp-error);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 0 16px;
    font-size: 15px;
}

.gp-error[hidden] {
    display: none;
}

.gp-privacy {
    text-align: center;
    font-size: 14px;
    color: var(--gp-muted);
    margin: 12px 0 0;
}

.gp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 24px;
    border-radius: 10px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.gp-btn:focus-visible,
.gp-text-link:focus-visible,
.gp-wheel-skip:focus-visible,
.gp-check input:focus-visible,
.gp-file:focus-visible {
    outline: 3px solid var(--gp-primary);
    outline-offset: 2px;
}

.gp-btn-primary {
    background: var(--gp-primary);
    color: #fff;
}

.gp-btn-primary:hover {
    background: var(--gp-primary-dark);
    color: #fff;
}

.gp-btn-primary:disabled {
    opacity: 0.6;
    cursor: wait;
}

.gp-btn-secondary {
    background: #fff;
    color: var(--gp-primary);
    border-color: #c7c2ff;
}

.gp-btn-secondary:hover {
    background: var(--gp-soft);
}

.gp-btn-light {
    background: #fff;
    color: var(--gp-primary);
}

.gp-btn-light:hover {
    background: var(--gp-soft);
    color: var(--gp-primary);
}

.gp-btn-block {
    width: 100%;
    font-size: 18px;
    min-height: 54px;
}

.gp-result {
    width: 100%;
    text-align: center;
}

.gp-result[hidden] {
    display: none;
}

.gp-result h2 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 18px;
    outline: none;
}

.gp-result-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gp-primary);
    margin: 0 0 8px;
}

.gp-winner-list,
.gp-alternate-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    overflow-wrap: anywhere;
}

.gp-winner-list li {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.35;
    padding: 4px 0;
}

.gp-person-note {
    display: block;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--gp-muted);
}

.gp-alternate-list li {
    font-size: 18px;
    color: #374151;
    padding: 2px 0;
}

.gp-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 28px;
    border-top: 1px solid var(--gp-line);
    padding-top: 16px;
    margin: 0 0 20px;
    font-size: 15px;
}

.gp-facts dt {
    color: var(--gp-muted);
    font-weight: 400;
}

.gp-facts dd {
    margin: 2px 0 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.gp-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.gp-next {
    border-top: 1px solid var(--gp-line);
    margin-top: 24px;
    padding-top: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.gp-next p {
    margin: 0;
    color: #374151;
}

.gp-text-link {
    color: var(--gp-primary);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 8px 4px;
}

.gp-content {
    max-width: 760px;
    margin: 64px auto;
    font-size: 17px;
    line-height: 1.7;
    color: #374151;
}

.gp-content h2 {
    font-size: 30px;
    font-weight: 600;
    color: #222;
    line-height: 1.25;
    margin: 48px 0 16px;
}

.gp-content p {
    margin: 0 0 16px;
}

.gp-steps {
    list-style: decimal;
    padding-left: 24px;
    margin: 0;
}

.gp-steps li {
    margin-bottom: 10px;
}

.gp-faq h3 {
    font-size: 19px;
    font-weight: 600;
    color: var(--gp-ink);
    margin: 28px 0 6px;
}

.gp-closing {
    background: var(--gp-primary);
    color: #fff;
    border-radius: 24px;
    padding: 48px 28px;
    text-align: center;
    max-width: 760px;
    margin: 0 auto 80px;
}

.gp-closing h2 {
    font-size: 32px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 12px;
}

.gp-closing p {
    font-size: 18px;
    margin: 0 0 24px;
    color: rgba(255, 255, 255, 0.9);
}

.gp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Spinning wheel (same look as Live Draw) */
.gp-wheel-overlay {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-family: Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.gp-wheel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 20px;
}

.gp-wheel-skip {
    min-height: 44px;
    padding: 8px 18px;
    background: #fff;
    border: 1px solid var(--gp-primary);
    border-radius: 999px;
    color: var(--gp-primary);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
}

.gp-wheel-skip:hover {
    background: var(--gp-soft);
}

.gp-wheel-counter {
    color: var(--gp-muted);
    font-size: 14px;
    font-weight: 500;
}

.gp-wheel-container {
    position: relative;
    display: inline-block;
}

.gp-wheel-canvas {
    display: block;
    border-radius: 50%;
    max-width: 100%;
    height: auto;
    box-shadow: 0 12px 28px rgba(20, 20, 43, 0.18);
}

.gp-wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 36px solid var(--gp-ink);
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));
}

.gp-wheel-cap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff 0%, #e5e7eb 100%);
    border: 3px solid #d1d5db;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.gp-wheel-reveal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: max-content;
    max-width: 90%;
    padding: 16px 28px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.78); /* a dark pill, so the slice labels under the name do not compete with it */
    text-align: center;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
}

.gp-wheel-reveal.gp-show {
    opacity: 1;
}

.gp-wheel-reveal-label {
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.gp-wheel-reveal-name {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    overflow-wrap: anywhere;
    text-shadow: 0 0 30px rgba(74, 58, 255, 0.6), 0 2px 8px rgba(0, 0, 0, 0.6);
}

@media (max-width: 900px) {
    .gp-tool {
        grid-template-columns: minmax(0, 1fr);
    }

    /* the wheel and the result come first, so the wheel is on screen before the list */
    .gp-stage {
        order: -1;
    }
}

@media (max-width: 640px) {
    /* the entry count, with its "duplicates removed" hint, goes on its own line under the label */
    .gp-count {
        flex-basis: 100%;
    }

    .gp-page {
        padding-top: 32px;
    }

    .gp-hero h1 {
        font-size: 34px;
    }

    .gp-lede {
        font-size: 17px;
    }

    .gp-card {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .gp-actions .gp-btn {
        flex: 1 1 100%;
    }

    .gp-next .gp-btn {
        width: 100%;
    }

    .gp-content h2 {
        font-size: 25px;
    }

    .gp-wheel-reveal-name {
        font-size: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gp-wheel-reveal,
    .gp-btn {
        transition: none;
    }
}

/* Wide screens: keep the Pick button on screen while the form is taller than the window */
@media (min-width: 901px) {
    .gp-pickbar {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin: 0 -28px -28px;
        padding: 14px 28px 18px;
        background: #fff;
        border-top: 1px solid #eff0f6;
        border-radius: 0 0 20px 20px;
    }
    .gp-pickbar .gp-privacy { margin: 8px 0 0; }
}

.gp-range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-top: 6px;
    font-size: 15px;
}

.gp-range-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex-basis: 100%;
}

.gp-range-lab {
    color: var(--gp-muted);
}

.gp-range-input {
    width: 84px;
}
