@font-face {
    font-family: 'Lost in South';
    src: url('assets/fonts/Lost in South Regular/Lost in South Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Remove default focus outline for mouse users, keep for keyboard */
*:focus:not(:focus-visible) {
    outline: none;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #DAE3E5;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: #04080fbf;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

header {
    background: white;
    width: 100%;
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

header .logo {
    width: 100px;
    height: auto;
    display: block;
}

header a:focus-visible {
    outline: 2px solid #294967;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.winner-text {
    font-family: 'Lost in South', cursive;
    color: #cf0c6f;
    font-size: 4rem;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    margin-top:.2em;
}

.reset-button-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem 0;
    display: flex;
    justify-content: flex-end;
}

.btn-reset {
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

section {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

section h2 {
    font-family: 'Tilt Warp', sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.disclosure-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: 'Tilt Warp', sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.disclosure-button:hover {
    opacity: 0.8;
}

.disclosure-button:focus-visible {
    outline: 2px solid #294967;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.disclosure-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.disclosure-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.875rem;
    color: #294967;
    flex-shrink: 0;
    transform: rotate(0deg); /* Default: points up when expanded */
}

.disclosure-button[aria-expanded="false"] .disclosure-icon {
    transform: rotate(180deg); /* Points down when collapsed */
}

.disclosure-content {
    overflow: hidden;
}

.disclosure-content[aria-hidden="true"] {
    display: none;
}

.count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: normal;
}

/* Input Section */
.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
}

#nameInput {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: 'Poppins', sans-serif;
}

#addBtn {
    flex-shrink: 0;
    min-width: 80px;
}

#nameInput:focus {
    outline: none;
    border-color: #294967;
}

#nameInput:focus-visible {
    outline: 2px solid #294967;
    outline-offset: 2px;
    border-radius: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.95);
}

.btn:focus-visible {
    outline: 2px solid #294967;
    outline-offset: 2px;
}

.btn-primary {
    background: #294967;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1e3447;
}

.btn-secondary {
    background: white;
    color: #294967;
    border: 2px solid #294967;
}

.btn-secondary:hover {
    background: #f8fafc;
}

.btn-spin {
    width: 100%;
    max-width: 400px;
    background: #294967;
    color: white;
    font-size: 1.25rem;
    padding: 1.125rem 2rem;
    margin-top: 0;
    box-shadow: var(--shadow-lg);
    font-weight: 600;
}

.btn-spin:hover:not(:disabled) {
    background: #1e3447;
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger {
    background: white;
    color: #294967;
    border: 2px solid #294967;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger:hover {
    background: #f8fafc;
}

.btn-edit {
    background: white;
    color: #294967;
    border: 2px solid #294967;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-edit:hover {
    background: #f8fafc;
}

/* Names List */
.names-list, .winners-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 100px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 2rem;
    font-style: italic;
    font-size: 0.95rem;
}

.name-item, .winner-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    gap: 1rem;
}

.name-item:hover, .winner-item:hover {
    box-shadow: var(--shadow);
}

.name-item.editing {
    background: #fef3c7;
}

.name-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    min-width: 0;
    word-break: break-word;
}

.name-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.name-input-edit {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #294967;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

.name-input-edit:focus-visible {
    outline: 2px solid #294967;
    outline-offset: 2px;
}

/* Picker Section */
.picker-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    margin-bottom: 1.5rem;
    min-height: 200px;
    padding: 1rem 1rem 2rem 1rem;
    background: var(--bg-color);
    border-radius: 0.75rem;
    border: 2px solid var(--border-color);
    position: relative;
    list-style: none;
}

.picker-credit {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    color: #04080fbf;
    z-index: 1;
    pointer-events: none;
}

.credit-text {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
}

.heart-icon {
    font-size: 0.75rem;
    line-height: 1;
}

.credit-logo {
    height: 12px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.picker-grid .empty-message {
    grid-column: 1 / -1;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.95rem;
}

.picker-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    transition: all 0.15s ease-out;
    word-break: break-word;
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.picker-item.highlighted {
    background: #BFFCE4;
    color: #112C26;
    border-color: #BFFCE4;
    transform: scale(1.15);
    z-index: 1;
    font-weight: 700;
    animation: neonGlow 0.3s ease-out, colorBurst 0.3s ease-out;
    box-shadow: 
        0 0 3px rgba(191, 252, 228, 0.12),
        0 0 6px rgba(191, 252, 228, 0.09),
        0 0 9px rgba(191, 252, 228, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.15);
    text-shadow: none;
}

.picker-item.winner {
    background: #D23B8E;
    color: #F1F6F7;
    border-color: #D23B8E;
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(210, 59, 142, 0.5);
    animation: winnerPulse 0.6s ease-in-out infinite;
}

@keyframes winnerPulse {
    0%, 100% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Modal */
body.modal-open {
    overflow: hidden;
}

body.modal-open header,
body.modal-open .reset-button-container,
body.modal-open .container,
body.modal-open footer {
    filter: blur(4px);
    transition: filter 0.3s ease;
    pointer-events: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2.5rem;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s;
    text-align: center;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header h2 {
    font-family: 'Tilt Warp', sans-serif;
    font-weight: 400;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

#winnerModal .modal-header h2 {
    font-family: 'Lost in South', cursive;
    color: #cf0c6f;
    font-size:2.5rem;
}

.modal-header h2:focus-visible {
    outline: 2px solid #294967;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.modal-body {
    margin: 2rem 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.winner-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #294967;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    box-sizing: border-box;
    animation: pulse 1s ease-in-out infinite;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.modal-footer .btn {
    flex: 1;
}

/* Responsive Design - Tablet and Desktop */
@media (min-width: 768px) {
    .container {
        padding: 2.5rem 2rem;
    }

    .header-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .reset-button-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    header .logo {
        width: 100px;
    }

    main {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        gap: 2.5rem;
    }

    .name-input-section {
        grid-column: 1 / -1;
    }

    .wheel-section {
        grid-column: 1 / -1;
    }

    .wheel-container {
        max-width: 500px;
    }

    section {
        padding: 2.5rem;
    }

    section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.75rem;
    }
}

@media (min-width: 768px) {
    .header-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .reset-button-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 3rem 2.5rem;
    }

    .header-container {
        padding-left: 5em;
        padding-right: 5em;
    }

    .reset-button-container {
        padding-left: 5em;
        padding-right: 5em;
    }

    main {
        display: flex;
        flex-direction: column;
        gap: 2.5rem;
    }

    .wheel-container {
        max-width: 400px;
    }

    section {
        padding: 2.5rem;
    }
}

/* Responsive Input */
@media (max-width: 480px) {
    .input-group {
        flex-direction: column;
    }
    
    #nameInput {
        min-width: 100%;
        width: 100%;
    }
    
    #addBtn {
        width: 100%;
        min-width: 100%;
    }
}

/* Responsive Modal */
@media (max-width: 767px) {
    .modal-content {
        max-width: 90%;
        padding: 2rem 1.5rem;
    }
    
    .winner-name {
        font-size: 1.5rem;
        padding: 1.25rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
}

/* Animations */
@keyframes neonGlow {
    0% {
        box-shadow: 
            0 0 2px rgba(191, 252, 228, 0.08),
            0 0 4px rgba(191, 252, 228, 0.05),
            0 0 6px rgba(191, 252, 228, 0.03),
            0 2px 6px rgba(0, 0, 0, 0.1);
    }
    100% {
        box-shadow: 
            0 0 3px rgba(191, 252, 228, 0.12),
            0 0 6px rgba(191, 252, 228, 0.09),
            0 0 9px rgba(191, 252, 228, 0.06),
            0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

@keyframes colorBurst {
    0% {
        background: #BFFCE4;
        transform: scale(1.1) rotate(0deg);
    }
    50% {
        background: #BFFCE4;
        transform: scale(1.2) rotate(2deg);
    }
    100% {
        background: #BFFCE4;
        transform: scale(1.15) rotate(0deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Footer */
footer {
    background: white;
    width: 100%;
    margin-top: 3rem;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-love-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-love-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0;
}

.footer-logo {
    height: 20px;
    width: auto;
    display: block;
}

.footer-link {
    color: var(--text-primary);
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight:500;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #294967;
    text-decoration: underline;
}

.footer-link:focus-visible {
    outline: 2px solid #294967;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

