body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f4f4f4;
}
.controls {
    margin-bottom: 20px;
}
.controls input[type="text"] {
    padding: 5px;
    font-size: 16px;
    width: 200px;
    margin-right: 10px;
}
.content {
    display: flex;
    gap: 20px;
}
.list-container {
    flex: 1;
    max-height: 500px;
    overflow-y: auto;
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.wheel-container {
    flex: 1;
    position: relative;
    height: 500px;
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    overflow: hidden;
}
.wheel-group {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 50px auto 0;
}
#wheel {
    width: 400px;
    height: 400px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
#spin-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    font-size: 18px;
    background-color: #ff4444;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    z-index: 20;
}
#spin-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}
#result {
    text-align: center;
    margin-top: 20px;
    font-size: 18px;
    font-weight: bold;
}
ul {
    list-style: none;
    padding: 0;
}
li {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
}
li:last-child {
    border-bottom: none;
}
li.highlighted {
    background-color: #e3f2fd;
    font-weight: bold;
}
.rating {
    color: #ff9800;
}
#range-value {
    margin-left: 10px;
    font-weight: bold;
}
.pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 20px solid #ff4444;
    z-index: 10;
}
.wheel-text {
    font-size: 12px;
    font-weight: bold;
    fill: white;
    text-anchor: middle;
    dominant-baseline: middle;
}
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}
.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    text-align: center;
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}
#directions-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}
#directions-link:hover {
    background-color: #0056b3;
}

@media (max-width: 768px) {
    .content {
        flex-direction: column;
    }
    .wheel-container {
        order: -1; /* Move wheel-container to the top */
        height: auto;
        width: 100%;
        margin-bottom: 20px;
        padding: 20px; /* Ensure enough padding for containment */
    }
    .list-container {
        height: auto;
        width: 100%;
        margin-bottom: 20px;
    }
    .wheel-group {
        width: 100%;
        max-width: 300px; /* Constrain max size */
        aspect-ratio: 1 / 1; /* Maintain square shape */
        height: auto;
        margin: 30px auto;
        position: relative;
    }
    #wheel {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%); /* Keep centered */
    }
    #spin-btn {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%); /* Center in wheel */
        margin: 0;
        width: 60px; /* Smaller for mobile */
        height: 60px;
        font-size: 16px;
    }
    #spin-btn:hover {
        transform: translate(-50%, -50%) scale(1.1);
    }
    .pointer {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        z-index: 10;
    }
    .controls input[type="text"] {
        width: 100%;
        margin-bottom: 10px;
    }
    #directions-link {
        width: 100%;
    }
}
