body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #222222;
    color: #ffffff;
}

h1,
h3 {
    font-weight: 700;
    margin: 20px 0;
    text-align: center;
}

h2 {
    font-weight: 700;
    margin: 20px 0;
    text-align: center;
}

.book-grid {
    display: block;
}

.book-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    flex: 0 0 150px;
    scroll-snap-align: start;
}

.book-item:hover {
    transform: scale(1.05);
}

.book-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.book-item p {
    margin: 10px 0 0;
    font-size: 16px;
    color: #ffffff;
}

#player-controls {
    margin-top: 20px;
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    background: #000000;
    border: 2px solid #ffd700;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.player-walkman {
    width: 250px;
    height: 340px;
    margin: 0 auto 15px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #222222;
    border: 2px solid #ffd700;
}

.screen {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 230px;
    height: 260px;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1c2526;
}

#current-chapter {
    font-size: 16px;
    text-align: center;
    margin: 5px 0;
    color: #ffffff;
}

#current-cover {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #ffd700;
}

.marquee-wrapper {
    width: 200px;
    height: 20px;
    overflow: hidden;
    position: absolute;
    bottom: 0px;
    display: none;
}

.marquee-active {
    display: block !important;
}

#book-marquee-text {
    display: inline-block;
    font-size: 14px;
    white-space: nowrap;
    position: absolute;
    color: #ffffff;
    animation: marquee 10s linear infinite;
}

#book-marquee-text:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

.player-info {
    margin: 10px 0;
    font-size: 16px;
    color: #ffffff;
    display: flex;
    gap: 10px;
    align-items: center;
}

#playback-speed {
    font-size: 14px;
    color: #ffd700;
}

#progress-bar {
    width: 100%;
    margin: 10px 0;
    background: #444;
    border-radius: 5px;
    height: 8px;
}

.player-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
}

.player-buttons button {
    padding: 8px;
    font-size: 16px;
    border-radius: 50%;
    border: none;
    background: #d7d7d7;
    color: #000000;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.player-buttons button:active {
    background: #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

.player-buttons button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.player-knobs {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
    width: 200px;
    margin: 10px 0;
}

.knob {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, #c0c0c0, #808080);
    border: 2px solid #ffd700;
    cursor: pointer;
    appearance: none;
}

#volume-control-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#volume-control {
    -webkit-appearance: slider-vertical;
    writing-mode: bt-lr;
    width: 30px;
    height: 100px;
    margin: 0;
    padding: 0;
}

#volume-control::-webkit-slider-runnable-track {
    width: 6px;
    background: linear-gradient(to top, #0000ff, #ff0000);
    border-radius: 3px;
}

#volume-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #ffd700;
    border-radius: 50%;
    margin-top: -5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#volume-control::-moz-range-track {
    width: 6px;
    background: linear-gradient(to top, #0000ff, #ff0000);
    border-radius: 3px;
}

#volume-control::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ffd700;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#volume-icon {
    font-size: 20px;
    color: #ffd700;
}

#menu-knob {
    font-size: 20px;
    line-height: 50px;
    text-align: center;
    color: #000000;
}

#logo {
    width: 100px;
    height: auto;
    margin: 10px auto 0;
    display: block;
    max-width: 100%;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.modal-content {
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.7);
    animation: scaleUp 0.3s ease forwards;
    background: #222222;
    color: #ffffff;
}

.modal-content h3 {
    margin: 0 0 15px;
    font-size: 20px;
    color: #ffffff;
}

.modal-content button {
    display: block;
    width: 100%;
    margin: 8px 0;
    padding: 12px;
    border-radius: 8px;
    text-align: left;
    font-size: 16px;
    border: none;
    transition: background 0.2s ease;
    background: #d7d7d7;
    color: #000000;
}

.modal-content button:hover {
    background: #006699;
}

#add-bookmark {
    width: 100%;
    margin-bottom: 15px;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.bookmark-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}

.bookmark-item p {
    flex: 1;
    margin: 0;
    font-size: 16px;
    color: #ffffff;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #ffffff;
}

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

@keyframes scaleUp {
    to {
        transform: scale(1);
    }
}

@media (max-width: 360px) {
    .player-walkman {
        width: 200px;
        height: 280px;
    }

    .screen {
        width: 180px;
        height: 200px;
    }

    #logo {
        width: 80px;
    }

    #volume-control {
        height: 80px;
    }
}

.genre-section {
    margin-bottom: 40px;
}

.genre-title {
    font-weight: 700;
    margin: 20px 0;
    text-align: center;
}

.series-title {
    font-weight: 500;
    margin: 10px 0;
    text-align: center;
}

.book-carousel {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 0;
    scroll-snap-type: x mandatory;
    max-width: 340px;
    margin: 0 auto;
}

.book-carousel::-webkit-scrollbar {
    height: 8px;
}

.book-carousel::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 4px;
}

.custom-paper {
    background-color: #fdf5e6;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 25px, #87cefa 25px, #87cefa 26px),
        repeating-linear-gradient(90deg, transparent, transparent 25px, #87cefa 25px, #87cefa 26px);
    background-size: 26px 26px;
    font-family: 'Caveat', cursive;
    font-size: 1.5em;
    color: #333;
    padding: 40px 20px 60px 20px;
    border: 2px solid #d2b48c;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    width: 80%;
    max-width: 300px;
    border-radius: 5px;
}

.custom-paper::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(transparent, #8b4513 30%, #000);
    clip-path: polygon(0 0, 100% 0, 95% 100%, 85% 70%, 75% 100%, 65% 80%, 55% 100%, 45% 70%, 35% 100%, 25% 80%, 15% 100%, 5% 70%, 0 100%);
}

.handwritten {
    line-height: 1.4;
    text-align: center;
}

.custom-button {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background: #d7d7d7;
    border: none;
    border-radius: 5px;
    font-family: 'Caveat', cursive;
    font-size: 1.2em;
    color: #000;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-button:hover {
    background: #ffd700;
}
