body {
    background: #77c9f8 !important;
    margin: 0;
    text-align: center;
}

.ast-primary-header-bar {
    background: #91bd35 !important;
    box-shadow: none !important;
}

.ast-primary-header-bar,
#content.site-content {
    border: none !important;
    box-shadow: none !important;
}

#primary {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.ast-article-single {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
}

.site-header::after,
.ast-primary-header-bar::after {
    display: none !important;
    content: none !important;
}

.entry-header {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.entry-content br:first-child {
    display: none;
}

.entry-content h1 {
    margin-bottom: 0px;
}

.entry-content p {
    margin-bottom: 0px;
}

.entry-content a {
    display: inline-block;
    margin-bottom: 0px;
}

h1 {
    margin-bottom: 2vh !important;
    color: white !important;
    -webkit-text-stroke: 2px #1175ad;
}

.menu-container-game {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    font-family: "Arial Black", sans-serif !important;
    font-weight: 900 !important;
    padding: 0 0;
}

.tombol-kayu {
    font-family: "Arial Black", Impact, sans-serif;
    font-size: 20px;
    color: #2a1a0a;
    letter-spacing: 2px;
    text-transform: uppercase;
    width: 70vw;
    max-width: 350px;
    aspect-ratio: 3 / 0.45;
    margin-top: 0;
    margin-bottom: 1vh;
    padding: 0;
    cursor: pointer;
    border: none;
    outline: none;
    background: transparent url("astra-assets/tombol-kayu.png") no-repeat
        center / cover !important;
    box-shadow: none !important;
    transition: all 0.1s ease;
}

.tombol-kayu:focus,
.tombol-kayu:focus-visible {
    outline: none;
    box-shadow: none !important;
}

.tombol-kayu:hover {
    transform: translateY(-5px);
    background: transparent url("astra-assets/tombol-kayu.png") no-repeat
        center / cover !important;
    box-shadow: none !important;
}

.tombol-kayu:active {
    transform: translateY(0px);
}

/* Modal Styles */
.library-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85); /* Darker overlay for focus */
    display: none; /* Controlled by JS flex/none */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px); /* Modern touch */
}

.library-modal-content {
    background: #77c9f8;
    width: 95%;
    max-width: 800px;
    height: 90vh; /* Taller on mobile */
    border-radius: 20px;
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    border: 3px solid #1175ad;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 22px;
    -webkit-text-stroke: 1px #1175ad;
    text-shadow: 2px 2px 0px #1175ad;
}

.modal-close-btn {
    background: #ef4444;
    color: white;
    border: 2px solid #b91c1c;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 0 #b91c1c;
    transition: all 0.1s;
}

.modal-close-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #b91c1c;
}

.modal-search-container {
    margin-bottom: 15px;
}

#vocab-search {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 3px solid #1175ad;
    font-size: 16px; /* Prevents auto-zoom on iOS */
    box-sizing: border-box;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.modal-table-container {
    flex: 1;
    overflow: auto; /* Allow horizontal scroll on small screens */
    background: white;
    border-radius: 15px;
    border: 2px solid #1175ad;
    -webkit-overflow-scrolling: touch;
}

.vocab-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 450px; /* Ensure columns don't squash too much */
}

.vocab-table th {
    background: #91bd35;
    color: white;
    padding: 14px 10px;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 14px;
    text-transform: uppercase;
}

.vocab-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 15px;
}

.col-title {
    font-weight: 800;
    color: #1175ad;
    width: 30%;
}

.col-phonetic {
    font-style: italic;
    color: #64748b;
    font-size: 13px;
    width: 25%;
}

.col-meaning {
    width: 45%;
}

/* Flashcard Modal Specifics */
.modal-back-btn {
    background: #1175ad;
    color: white;
    border: 2px solid #075985;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 0 #075985;
}

.modal-back-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #075985;
}

.modal-body-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
    -webkit-overflow-scrolling: touch;
}

.flashcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding-bottom: 20px;
}

.flashcard-item {
    background: white;
    border: 3px solid #1175ad;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #1175ad;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100px;
}

.flashcard-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 0 #1175ad;
}

.flashcard-item:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1175ad;
}

.flash-item-title {
    font-weight: 900;
    color: #1175ad;
    font-size: 16px;
    margin-bottom: 5px;
    line-height: 1.2;
}

.flash-item-count {
    font-size: 12px;
    color: #64748b;
    font-weight: bold;
}

.loading-spinner {
    text-align: center;
    padding: 50px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 1px 1px 0 #1175ad;
}

/* Read Lesson Detail Specifics */
#read-detail-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    color: #1e293b;
    line-height: 1.8;
    font-size: 16px;
    border: 2px solid #1175ad;
    text-align: left;
}

#read-detail-content h1, #read-detail-content h2, #read-detail-content h3 {
    color: #1175ad;
    margin-top: 0;
}

#read-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 10px 0;
}

/* Schedule Detail Specifics */
.schedule-detail-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #1175ad;
    text-align: left;
}

.schedule-section {
    margin-bottom: 20px;
}

.schedule-section:last-child {
    margin-bottom: 0;
}

.schedule-section h4 {
    margin: 0 0 10px 0;
    color: #1175ad;
    border-bottom: 2px solid #77c9f8;
    padding-bottom: 5px;
    font-size: 18px;
}

.schedule-section ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: circle;
}

.schedule-section li {
    margin-bottom: 5px;
    color: #1e293b;
    font-weight: bold;
}

/* Tablet & Mobile Adjustments */
@media screen and (max-width: 600px) {
    .library-modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        border: none;
        padding: 10px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .vocab-table td, .vocab-table th {
        padding: 10px 8px;
        font-size: 14px;
    }

    .flashcard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .flash-item-title {
        font-size: 14px;
    }
}
