:root { 
    --primary: #4f46e5; 
    --primary-hover: #4338ca; 
    --bg: #f8fafc; 
    --surface: #ffffff; 
    --text: #1e293b; 
    --muted: #64748b; 
}

body { 
    font-family: 'M PLUS Rounded 1c', sans-serif; 
    background-color: var(--bg); 
    color: var(--text); 
    margin: 0; 
    padding: 0; 
    overflow-x: hidden;
}

/* Home View */
#homeView {
    position: fixed;
    inset: 0;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s;
}
.home-title {
    font-family: 'Bungee Inline', cursive; 
    font-size: 4.5rem; 
    color: #000000;
    margin: 0; 
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-align: center;
}
.home-subtitle {
    font-family: 'Zen Maru Gothic', sans-serif; 
    color: var(--muted); 
    margin-top: 15px; 
    margin-bottom: 70px;
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1.5;
}
.start-btn {
    font-family: 'Zen Maru Gothic', sans-serif; 
    font-weight: 900; 
    font-size: 1.5rem; 
    background: var(--primary); 
    color: #ffffff; 
    border: none;
    padding: 15px 50px; 
    border-radius: 9999px; 
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3); 
    transition: all 0.3s ease;
}
.start-btn:hover {
    transform: translateY(-4px); 
    background: var(--primary-hover); 
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.45); 
}

/* Content View */
#contentView {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}
header { 
    padding: 15px 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(10px); 
    position: sticky; 
    top: 0; 
    z-index: 50; 
    border-bottom: 1px solid #e2e8f0;
}
.logo-wrapper { display: flex; flex-direction: column; }
.logo { font-family: 'Bungee Inline', cursive; font-size: 1.5rem; color: #000000; line-height: 1.2; }
.logo-sub { font-family: 'Zen Maru Gothic', sans-serif; color: var(--muted); margin-top: 4px; line-height: 1.3; }

.header-actions { display: flex; gap: 10px; align-items: center; }

/* How to use Button */
.help-btn {
    background: #f1f5f9; color: var(--text); border: none; padding: 10px 18px; border-radius: 9999px; 
    font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: 0.2s; text-align: center;
}
.help-btn:hover { background: #e2e8f0; transform: translateY(-2px); }

.login-btn { background: var(--text); color: white; padding: 10px 20px; border-radius: 9999px; font-weight: 600; cursor: pointer; border: none; transition: 0.2s; font-size: 0.85rem; }
.login-btn:hover { transform: translateY(-2px); }

main { padding: 40px 5%; max-width: 1200px; margin: 0 auto; }
h2 { font-size: 1.4rem; font-weight: 900; margin-bottom: 20px; color: var(--text); border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.card { background: var(--surface); border-radius: 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); cursor: pointer; transition: all 0.3s; border: 1px solid #e2e8f0; overflow: hidden; position: relative; }
.card:hover { transform: translateY(-8px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.card-img-wrapper { width: 100%; height: 160px; overflow: hidden; }
.card-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.card:hover .card-img-wrapper img { transform: scale(1.05); }

/* Modals */
.modal { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px); justify-content: center; align-items: center; z-index: 100; }
.modal-content { background: white; padding: 30px; border-radius: 24px; width: 90%; max-width: 500px; position: relative; max-height: 85vh; overflow-y: auto; font-family: 'M PLUS Rounded 1c', sans-serif; }
.close-btn { position: absolute; top: 20px; right: 20px; font-size: 1.5rem; cursor: pointer; border: none; background: none; color: var(--muted); }

.hide-ruby rt { display: none !important; }
.ruby-text { font-size: 1.4rem; line-height: 2.5; margin-top: 20px; color: var(--text); }
rt { font-size: 0.5em; color: var(--primary); font-weight: 400; }

.modal-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 15px; flex-wrap: wrap; }
.sub-btn { background: #f1f5f9; color: var(--text); padding: 8px 16px; border-radius: 9999px; font-size: 0.85rem; font-weight: 700; border: none; cursor: pointer; transition: 0.2s; }
.sub-btn:hover { background: #e2e8f0; }

.switch-label { font-size: 0.85rem; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; background: #f1f5f9; padding: 8px 16px; border-radius: 9999px; }
.switch-label input { display: none; }
.switch-box { width: 34px; height: 18px; background: #cbd5e1; border-radius: 9999px; position: relative; transition: 0.3s; }
.switch-box::before { content: ''; width: 14px; height: 14px; background: white; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: 0.3s; }
.switch-label input:checked + .switch-box { background: var(--primary); }
.switch-label input:checked + .switch-box::before { left: 18px; }

.sub-window { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.2); justify-content: center; align-items: center; z-index: 200; animation: fadeIn 0.2s ease; }
.sub-window-content { background: #ffffff; padding: 30px; border-radius: 24px; width: 85%; max-width: 400px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15); position: relative; max-height: 70vh; overflow-y: auto; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }