:root {
    --primary: #FFB3BA;
    /* Pastel pink */
    --secondary: #BAFFC9;
    /* Pastel green */
    --accent: #BAE1FF;
    /* Pastel blue */
    --yellow: #FFFFBA;
    /* Pastel yellow */
    --purple: #E8BAFF;
    /* Pastel purple */
    --orange: #FFDFBA;
    /* Pastel orange */

    --bg-gradient-1: #FFDEE9;
    --bg-gradient-2: #B5FFFC;

    --text-dark: #4a4a4a;
    --text-light: #7a7a7a;
    --white: #ffffff;
    --sidebar-bg: #ffffff;
    --sidebar-border: #f0e6ea;

    --tab-inactive: #f8f0f3;
    --tab-active: #ffffff;
    --border-color: #ffdce3;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
    /* Full app behaves like a fixed interface */
    display: flex;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Wheel Section */
.wheel-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
}

.wheel-container {
    position: relative;
    width: 95%;
    max-width: 90vh;
    /* Scaled mostly to screen height, allowing it to be huge */
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    /* make whole container clickable */
}

.wheel-container:hover .center-text h2 {
    transform: scale(1.05);
    color: #fff;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.8), 0 10px 40px rgba(0, 0, 0, 0.1);
    z-index: 10;
    transition: transform 0s;
}

.pointer.right-pointer {
    position: absolute;
    top: 50%;
    right: -30px;
    /* Stick out to the right */
    transform: translateY(-50%) scale(1.3);
    transform-origin: right center;
    z-index: 20;
    filter: drop-shadow(-4px 4px 6px rgba(0, 0, 0, 0.2));
    pointer-events: none;
}

.center-text {
    position: absolute;
    z-index: 15;
    pointer-events: none;
    text-align: center;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 30%, rgba(255, 255, 255, 0) 70%);
    padding: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spin-instruction {
    font-family: 'Fredoka', sans-serif;
    color: var(--text-dark);
    font-size: 2.8rem;
    font-weight: 600;
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.spin-instruction small {
    display: block;
    font-size: 1.2rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    margin-top: 10px;
    color: var(--text-light);
}

/* Sidebar */
.sidebar {
    width: 380px;
    background-color: var(--sidebar-bg);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 30;
}

.sidebar-tabs {
    display: flex;
    background-color: var(--tab-inactive);
    border-bottom: 2px solid var(--border-color);
}

.tab {
    flex: 1;
    text-align: center;
    padding: 18px 10px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    position: relative;
    border-top: 4px solid transparent;
}

.tab.active {
    background-color: var(--tab-active);
    color: #ff7f9c;
    /* Vivid pastel pink */
    border-top-color: #ff7f9c;
}

.tab:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.6);
}

.badge {
    background-color: #e0e0e0;
    color: #666;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 5px;
    vertical-align: middle;
}

.tab.active .badge {
    background-color: #ffdeeb;
    color: #ff7f9c;
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow: hidden;
}

.sidebar-content.hidden {
    display: none;
}

.toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-tool {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-dark);
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-tool:hover {
    background: var(--accent);
    border-color: #a3d4f7;
    color: #1a5b8c;
}

.options-toggle {
    margin-left: auto;
    /* push to right */
}

.options-panel {
    background: #fff9fa;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 15px;
    display: none;
}

.options-panel.show {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

textarea {
    flex: 1;
    width: 100%;
    resize: none;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 15px;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    line-height: 1.5;
    outline: none;
    background: #fafafa;
    transition: all 0.3s;
}

textarea:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 179, 186, 0.2);
}

.results-list {
    flex: 1;
    overflow-y: auto;
    background: #fafafa;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 10px;
}

.empty-state {
    text-align: center;
    color: var(--text-light);
    margin-top: 40px;
    font-style: italic;
}

.result-item {
    background: #fff;
    border: 1px solid #eee;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border-left: 4px solid var(--primary);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: #ebebeb;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.checkbox-container:hover input~.checkmark {
    background-color: #ddd;
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Buttons */
button {
    font-family: 'Fredoka', sans-serif;
}

.btn-primary {
    background: #ff8fab;
    /* Strong pastel pink */
    color: white;
    font-size: 1.1rem;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(255, 143, 171, 0.3);
}

.btn-primary:hover {
    background: #ff7597;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 143, 171, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: #ffdfba;
    color: #4a4a4a;
    font-size: 1.1rem;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #ffcca0;
}

/* Bottom Controls */
.bottom-controls {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bottom-checkbox {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.bottom-checkbox .checkmark {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.bottom-checkbox .checkmark:after {
    left: 8px;
    top: 4px;
    width: 6px;
    height: 12px;
    border-width: 0 3px 3px 0;
}

.action-buttons-row {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.btn-large {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    color: #4a4a4a;
}

.btn-large:hover {
    transform: translateY(-2px);
}

.btn-large:active {
    transform: translateY(0);
}

.btn-pink {
    background-color: #ffb3ba;
}

.btn-pink:hover {
    background-color: #ff9fa7;
}

.btn-orange {
    background-color: #ffdfba;
}

.btn-orange:hover {
    background-color: #ffcca0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, #ffffff, #fff5f7);
    border-radius: 20px;
    padding: 40px;
    width: 95%;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(255, 179, 186, 0.4);
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 4px solid var(--primary);
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header h2 {
    font-family: 'Fredoka', sans-serif;
    color: #ffaa00;
    /* happy yellow/orange */
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.modal-body h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 3.5rem;
    color: #4a4a4a;
    margin: 15px 0 30px 0;
    word-break: break-word;
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Responsive */
@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 600px;
    }

    .wheel-section {
        min-height: 500px;
    }
}

@media (max-width: 500px) {
    .spin-instruction {
        font-size: 2rem;
    }

    .pointer.right-pointer {
        right: -15px;
    }

    .pointer.right-pointer svg {
        width: 40px;
        height: 32px;
    }
}