:root { --jp-red: #b3262f; }
body { font-family: "Noto Sans JP", "Yu Gothic", "Meiryo", "Hiragino Sans", system-ui, -apple-system, "Segoe UI", sans-serif; background: #f6f6f8; }
.navbar-brand .jp { color: #ffd9dc; font-weight: 700; }
.bg-brand { background: var(--jp-red) !important; }
.btn-brand { background: var(--jp-red); border-color: var(--jp-red); color: #fff; }
.btn-brand:hover { background: #8f1d25; border-color: #8f1d25; color: #fff; }
.text-brand { color: var(--jp-red) !important; }
.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.progress { height: 12px; }
.chapter-content { line-height: 1.8; }
.chapter-content table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: .95rem; }
.chapter-content th, .chapter-content td { border: 1px solid #d5d5da; padding: .35rem .6rem; vertical-align: top; }
.chapter-content th { background: #f3e9ea; }
.chapter-content blockquote { border-left: 4px solid var(--jp-red); background: #fff6f6; padding: .5rem 1rem; margin: 1rem 0; }
.chapter-content h2 { font-size: 1.35rem; margin-top: 2rem; padding-bottom: .3rem; border-bottom: 2px solid var(--jp-red); }
.chapter-content h3 { font-size: 1.1rem; margin-top: 1.5rem; color: var(--jp-red); }
.chapter-content div.table-wrap { overflow-x: auto; }
.q-body { font-size: 1.1rem; }
.q-passage { background: #fafafa; border: 1px solid #ddd; border-radius: .5rem; padding: .75rem 1rem; }
.option-label { cursor: pointer; border: 1px solid #dee2e6; border-radius: .5rem; padding: .5rem .75rem; display: block; margin-bottom: .4rem; background: #fff; }
.option-label:hover { background: #fff6f6; }
.option-input:checked + .option-label { border-color: var(--jp-red); background: #ffecee; }
.exam-bar { position: sticky; top: 0; z-index: 1030; }
.timer { font-variant-numeric: tabular-nums; font-size: 1.4rem; font-weight: 700; }
.timer.danger { color: #dc3545; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .45; } }
.nav-grid a { width: 2.2rem; margin: 0 .2rem .35rem 0; }
.review-correct { border-color: #198754 !important; background: #e9f7ef !important; }
.review-wrong { border-color: #dc3545 !important; background: #fdecee !important; }
.admin-sidebar { min-height: calc(100vh - 56px); background: #2b2d33; }
.admin-sidebar .nav-link { color: #c9cad1; border-radius: .4rem; }
.admin-sidebar .nav-link.active, .admin-sidebar .nav-link:hover { background: #3b3e47; color: #fff; }
.score-ring { font-size: 3.2rem; font-weight: 800; line-height: 1; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }

.audio-btn { white-space: nowrap; line-height: 1.5; margin: .1rem .1rem; font-size: .9rem; }
.audio-btn.active { background: var(--jp-red); color: #fff; border-color: var(--jp-red); }
.listening-box audio { display: none; }

/* ===== Game susun kata ===== */
.tile { display: inline-flex; align-items: center; justify-content: center; min-width: 3.6rem; height: 3.6rem; padding: 0 .7rem; margin: .25rem; font-size: 2rem; line-height: 1; border-radius: .75rem; background: #fff; border: 2px solid #d9a3a8; box-shadow: 0 3px 0 #d9a3a8; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; transition: transform .12s, box-shadow .12s; font-weight: 600; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #d9a3a8; }
.tile:focus-visible { outline: 3px solid #0d6efd; outline-offset: 2px; }
.tile.dragging { opacity: .25; }
.tile.locked { cursor: default; transform: none; box-shadow: 0 3px 0 #9fd3b4; border-color: #9fd3b4; }
.tile-ghost { position: fixed; z-index: 3000; pointer-events: none; opacity: .92; transform: scale(1.12) rotate(-4deg); box-shadow: 0 10px 24px rgba(0,0,0,.3); margin: 0; }
.slot { display: inline-flex; align-items: center; justify-content: center; min-width: 4.2rem; height: 4.4rem; margin: .3rem; border: 2px dashed #b3262f; border-radius: .85rem; background: #fff6f6; transition: background .12s; }
.slot.over { background: #ffdfe2; border-style: solid; }
.slot .tile { margin: 0; }
.slots.correct .slot { border-color: #198754; background: #e9f7ef; border-style: solid; }
.slots.correct .tile { border-color: #198754; box-shadow: 0 3px 0 #198754; animation: pop .35s ease; }
.slots.wrong { animation: shake .4s; }
.slots.wrong .slot { border-color: #dc3545; }
.tray { min-height: 5.2rem; border: 2px dashed #ccc; border-radius: .85rem; padding: .4rem; background: #fafafa; transition: background .12s; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.tray.over { background: #eef3ff; border-color: #6c8cff; }
.game-question .romaji { font-size: 2rem; font-weight: 700; color: var(--jp-red); letter-spacing: .03em; }
.game-score { font-size: 3.5rem; font-weight: 800; line-height: 1; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes pop { 50% { transform: scale(1.18); } }
