/* =========================================================
   KANA TABLE (styled like KANA MENU)
   ========================================================= */

body {
    background: linear-gradient(to bottom, #fffafa, #f0f0f0);
    overflow-y: auto;
    font-family: 'Noto Sans JP', sans-serif;
}

/* Main container */
.kana-page {
    width: 94%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 8rem;
    opacity: 0;
    transform: translateY(10px);
    animation: fade-in 1.2s ease-out forwards;
}

@keyframes fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   TITLES (Hiragana / Katakana act as main title)
   ========================================================= */

.kana-type-title {
    margin: 0;
    padding-top: 1rem;

    font-size: clamp(2.4rem, 5vw, 3.5rem);
    font-weight: 700;
    text-align: center;
    color: #5c2a2a;
    letter-spacing: 0.05em;

    text-shadow: 0 1px 1px rgba(0,0,0,0.05);

    animation: idle-float-h1 5s ease-in-out infinite alternate,
               texture-flicker-h1 16s ease-in-out infinite alternate;
    animation-delay: 0.2s, 0.1s;
}

@keyframes idle-float-h1 {
    from { transform: translateY(6px); }
    to   { transform: translateY(-6px); }
}

@keyframes texture-flicker-h1 {
    0%   { background-position: 0% 0%; }
    50%  { background-position: 1% 1%; }
    100% { background-position: 0% 0%; }
}

/* Section wrapper */
.kana-section {
    margin-bottom: 1.5rem;
}

/* =========================================================
   SUBCATEGORY BUTTONS — styled like menu buttons
   ========================================================= */

.kana-subcat-toggle {
    width: 90%;
    max-width: 550px;
    padding: 1.2rem 1rem;

    font-size: 1.3rem;
    font-weight: bold;
    color: #5c2a2a;
    letter-spacing: 0.04em;

    background:
        linear-gradient(to bottom, rgba(249, 194, 194, 0.9), rgba(244, 122, 122, 0.9)),
        url('../../../includes/assets/textures/paper-texture.jpg');
    background-size: 200%;
    background-blend-mode: overlay;

    border: 2px solid #b48a8a;      /* thin border */
    border-radius: 1rem;

    box-shadow: 0 5px 10px rgba(0,0,0,0.12);
    cursor: pointer;
    margin: 0.7rem auto;

    transition: all 0.25s ease;
    display: block;
}

.kana-subcat-toggle:hover {
    transform: translateY(-3px);
    background: linear-gradient(to bottom, #f9c2c2, #f6baba);
}

/* =========================================================
   INNER PANEL (Box around kana grids)
   ========================================================= */

.kana-panel {
    width: 95%;
    max-width: 800px;
    margin: 0.5rem auto 1.5rem;

    padding: 1.3rem 1rem;

    background:
        linear-gradient(to bottom right, rgba(255,255,255,0.9), rgba(250,227,227,0.9)),
        url('../../../includes/assets/textures/paper-texture.jpg');
    background-size: 200%;
    border-radius: 1rem;

    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: none;
}

.kana-panel.open {
    display: block;
}

/* =========================================================
   KANA GRID
   ========================================================= */

.kana-strict-grid {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.kana-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.8rem;
}

/* Each kana cell */
.kana-cell {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.8rem 0.5rem;

    border-radius: 0.8rem;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);

    text-align: center;
    cursor: pointer;
    transition: 0.2s ease;
}

.kana-cell:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.14);
}

.kana-char {
    font-size: 2.1rem;
    font-weight: bold;
    color: #5c2a2a;
}

.kana-romaji {
    font-size: 1rem;
    color: #7a4b4b;
}

body.romaji-off .kana-romaji {
    display: none;
}

/* Empty cell (keeps grid alignment) */
.kana-cell.empty {
    visibility: hidden;
    box-shadow: none;
}

/* Message when there is no data */
.kana-empty-msg {
    font-size: 1rem;
    color: #777;
    margin-top: 0.5rem;
}

/* =========================================================
   BOTTOM BAR
   ========================================================= */

.kana-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 0.97),
        rgba(255, 255, 255, 0.80),
        rgba(255, 255, 255, 0)
    );
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.08);

    border-top: 2px solid rgba(180, 138, 138, 0.6); /* ← NEW LINE */

    padding: 0.6rem 0;
    display: flex;
    justify-content: center;
    z-index: 1001;
}

/* inner buttons = same style as the pink menu cards */
.bottom-btn {
    flex: 1 1 0;
    max-width: 520px;

    margin: 0 0.5rem;
    padding: 0.9rem 1rem;

    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;

    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #5c2a2a;

    border-radius: 0.9rem;
    border: 2px solid #b48a8a;      /* thin border */

    background:
        linear-gradient(to bottom, rgba(249, 194, 194, 0.9), rgba(244, 122, 122, 0.9)),
        url('../../../includes/assets/textures/paper-texture.jpg');
    background-size: 200%;
    background-blend-mode: overlay;

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    cursor: pointer;

    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.bottom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
    background: linear-gradient(to bottom, #f9c2c2, #f6baba);
}

.bottom-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* label inside ROMAJI button */
.romaji-label {
    display: inline-block;
    min-width: 140px;
    text-align: center;
    white-space: nowrap;
}

/* strike-through when romaji is OFF */
.bottom-btn.romaji-off-btn .romaji-label {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

/* =========================================================
   MOBILE RESPONSIVE
   ========================================================= */

@media (max-width: 700px) {
    .kana-subcat-toggle {
        width: 100%;
        font-size: 1.1rem;
    }

    .kana-char {
        font-size: 1.6rem;
    }

    .kana-bottom-bar {
        padding: 0.5rem 0.3rem;
    }

    .bottom-btn {
        font-size: 1rem;
        padding: 0.7rem 0.8rem;
    }
}
