* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color: #384566;
    font-family: Arial, "Hiragino Sans", "Yu Gothic", sans-serif;
}

body {
    background: #62CDFF;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
}

.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.background {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.dictionary-background {
    justify-content: center;
    padding: 20px;
}

.dictionary-container {
    background: #ffffff;
    border-radius: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 0;
    max-width: 820px;
    min-height: calc(100vh - 40px);
    overflow: auto;
    padding: 28px;
    width: 100%;
}

.dictionary-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.brand {
    color: #62CDFF;
    font-size: 30px;
    font-weight: 800;
    text-decoration: none;
}

.dictionary-header nav {
    display: flex;
    gap: 18px;
}

.dictionary-header nav a {
    color: #384566;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.word-hero {
    background: #f2fbff;
    border: 2px solid #d9f4ff;
    border-radius: 24px;
    padding: 28px;
}

.dictionary-home-hero {
    background: #f2fbff;
    border: 2px solid #d9f4ff;
    border-radius: 24px;
    padding: 34px 28px;
}

.eyebrow {
    color: #AA77FF;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 8px;
}

h1 {
    color: #62CDFF;
    font-size: 62px;
    letter-spacing: 0;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.word-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.lead {
    color: #384566;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.45;
    margin-top: 14px;
}

.seo-summary {
    color: #56627e;
    font-size: 15px;
    line-height: 1.8;
    margin-top: 12px;
    max-width: 720px;
}

.hero-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.primary-link {
    background: #AA77FF;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 15px;
    font-weight: 800;
    justify-content: center;
    min-height: 42px;
    padding: 9px 18px;
    text-decoration: none;
}

.dictionary-lookup-panel {
    background: #ffffff;
    border: 2px solid #eef3f8;
    border-radius: 18px;
    margin-top: 18px;
    padding: 18px;
}

.dictionary-lookup-panel h2 {
    color: #AA77FF;
    font-size: 20px;
    line-height: 1.35;
    margin-bottom: 12px;
}

.dictionary-lookup-form {
    align-items: stretch;
    display: flex;
    gap: 8px;
}

.dictionary-lookup-form--large {
    margin-top: 22px;
}

.dictionary-lookup-form input {
    appearance: none;
    background: #ffffff;
    border: 2px solid #d9f4ff;
    border-radius: 999px;
    color: #384566;
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    min-height: 46px;
    min-width: 0;
    outline: none;
    padding: 10px 16px;
}

.dictionary-lookup-form--large input {
    min-height: 54px;
}

.dictionary-lookup-form input:focus {
    border-color: #AA77FF;
    box-shadow: 0 0 0 3px rgba(170, 119, 255, 0.18);
}

.dictionary-lookup-form button {
    appearance: none;
    background: #AA77FF;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    min-height: 46px;
    padding: 10px 18px;
}

.dictionary-lookup-form--large button {
    min-height: 54px;
    padding-left: 24px;
    padding-right: 24px;
}

.dictionary-lookup-hint {
    color: #56627e;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 10px;
}

.dictionary-suggest-list {
    background: #ffffff;
    border: 2px solid #d9f4ff;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(64, 84, 112, 0.12);
    display: grid;
    gap: 0;
    margin-top: 8px;
    overflow: hidden;
}

.dictionary-suggest-list[hidden] {
    display: none;
}

.dictionary-suggest-item {
    align-items: start;
    color: #384566;
    display: grid;
    gap: 6px;
    padding: 10px 14px;
    text-decoration: none;
}

.dictionary-suggest-item + .dictionary-suggest-item {
    border-top: 1px solid #eef3f8;
}

.dictionary-suggest-item:hover,
.dictionary-suggest-item:focus-visible {
    background: #f2fbff;
}

.dictionary-suggest-word {
    color: #3a94c6;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.dictionary-suggest-meaning {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 24px minmax(0, 1fr);
    min-width: 0;
}

.dictionary-suggest-pos {
    align-items: center;
    background: #f2fbff;
    border: 1px solid #bdeeff;
    border-radius: 6px;
    color: #3a94c6;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    height: 24px;
    justify-content: center;
    line-height: 1;
    width: 24px;
}

.dictionary-suggest-ja {
    color: #56627e;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sample-word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sample-word-list a {
    background: #f2fbff;
    border: 1px solid #d9f4ff;
    border-radius: 999px;
    color: #384566;
    display: inline-flex;
    font-size: 14px;
    font-weight: 800;
    padding: 8px 13px;
    text-decoration: none;
}

.empty-suggestion {
    color: #56627e;
    font-size: 15px;
    line-height: 1.7;
}

.search-result-list {
    display: grid;
    gap: 12px;
}

.search-result-card {
    background: #ffffff;
    border: 2px solid #eef3f8;
    border-radius: 18px;
    color: #384566;
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    text-decoration: none;
}

.search-result-card:hover {
    border-color: #d9f4ff;
}

.search-result-word {
    color: #62CDFF;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.search-result-meta {
    color: #48C000;
    font-size: 13px;
    font-weight: 800;
}

.search-result-ja {
    color: #384566;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.5;
}

.search-result-en {
    color: #56627e;
    font-size: 14px;
    line-height: 1.6;
}

.demo-notice,
.spelling-notice {
    background: #fff8db;
    border: 1px solid #eadb8f;
    border-radius: 12px;
    color: #5e4a00;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 16px;
    padding: 12px 14px;
}

.spelling-notice {
    background: #ffffff;
    border-color: #d9f4ff;
    color: #384566;
}

.content-section {
    margin-top: 34px;
}

.section-heading {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.section-heading span {
    background: #AA77FF;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    justify-content: center;
    min-width: 38px;
    padding: 4px 10px;
}

h2 {
    color: #AA77FF;
    font-size: 28px;
    letter-spacing: 0;
    line-height: 1.25;
}

.meaning-list {
    display: grid;
    gap: 14px;
}

.meaning-card {
    background: #ffffff;
    border: 2px solid #eef3f8;
    border-radius: 18px;
    padding: 20px;
}

.meaning-card__header {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pos {
    background: #eafff0;
    border: 1px solid #c6f3d1;
    border-radius: 999px;
    color: #48C000;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    padding: 5px 11px;
}

.sense {
    color: #7b86a0;
    font-size: 12px;
}

.meaning-ja {
    color: #384566;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.55;
    margin-bottom: 8px;
}

.meaning-en {
    color: #56627e;
    font-size: 16px;
    line-height: 1.75;
}

.meaning-definitions {
    color: #56627e;
    display: grid;
    font-size: 16px;
    gap: 8px;
    line-height: 1.75;
    list-style: none;
    margin: 0;
    padding: 0;
}

.meaning-definitions li {
    border-top: 1px solid #eef3f8;
    padding-top: 8px;
}

.meaning-definitions li:first-child {
    border-top: 0;
    padding-top: 0;
}

.example-list {
    display: grid;
    gap: 12px;
    list-style: none;
}

.example-item {
    background: #fffdf6;
    border: 2px solid #fff0bc;
    border-radius: 18px;
    padding: 18px 20px;
}

.example-label {
    color: #AA77FF;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px;
}

.example-en {
    color: #384566;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.65;
}

.example-en-row {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.example-en-row .example-en {
    flex: 1;
}

.example-ja {
    color: #66708a;
    font-size: 15px;
    line-height: 1.7;
    margin-top: 8px;
}

.audio-button {
    align-items: center;
    background: #62CDFF;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(98, 205, 255, 0.28);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    line-height: 1;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
    width: 34px;
}

.audio-button:hover {
    background: #4dbfec;
    box-shadow: 0 10px 22px rgba(98, 205, 255, 0.36);
    transform: translateY(-1px);
}

.audio-button.is-playing {
    background: #AA77FF;
}

.audio-button.is-ready {
    background: #48C000;
    box-shadow: 0 8px 18px rgba(72, 192, 0, 0.25);
}

.audio-button.is-loading {
    cursor: wait;
    opacity: 0.72;
    position: relative;
}

.typing-reset.is-loading {
    cursor: wait;
    opacity: 0.72;
}

.typing-reset.is-playing {
    background: #AA77FF;
    color: #ffffff;
}

.typing-reset.is-ready {
    background: #48C000;
    color: #ffffff;
}

.audio-button.is-loading span {
    opacity: 0;
}

.audio-button.is-loading::after {
    animation: audioSpin 0.7s linear infinite;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 999px;
    content: "";
    height: 14px;
    position: absolute;
    width: 14px;
}

.audio-button.is-error {
    background: #ff6b8a;
}

@keyframes audioSpin {
    to {
        transform: rotate(360deg);
    }
}

.word-audio-button {
    height: 42px;
    margin-top: 6px;
    width: 42px;
}

.mini-game {
    display: grid;
    gap: 14px;
}

.game-card {
    background: #f2fbff;
    border: 2px solid #d9f4ff;
    border-radius: 22px;
    padding: 20px;
}

.pronunciation-game {
    background: #f2fbff;
    border: 2px solid #d9f4ff;
    border-radius: 22px;
    padding: 20px;
}

.game-card__header {
    margin-bottom: 14px;
}

.game-label {
    color: #AA77FF;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 2px;
}

.game-card h3 {
    color: #62CDFF;
    font-size: 22px;
    letter-spacing: 0;
    line-height: 1.25;
}

.speed-stats {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
}

.speed-stats div {
    background: #ffffff;
    border: 2px solid #d9f4ff;
    border-radius: 16px;
    padding: 12px;
    text-align: center;
}

.speed-stats span {
    color: #7b86a0;
    display: block;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 3px;
}

.speed-stats strong {
    color: #AA77FF;
    display: block;
    font-size: 30px;
    line-height: 1;
}

.speed-stats strong.is-popping {
    animation: scorePop 0.32s ease;
}

@keyframes scorePop {
    0% {
        transform: scale(1);
    }

    60% {
        color: #48C000;
        transform: scale(1.22);
    }

    100% {
        transform: scale(1);
    }
}

.typing-orbs {
    align-items: center;
    background: linear-gradient(180deg, #ffffff 0%, #eaf9ff 100%);
    border: 2px solid #d9f4ff;
    border-radius: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 14px;
    min-height: 126px;
    overflow: hidden;
    padding: 20px;
    position: relative;
}

.typing-orbs::after {
    background:
        radial-gradient(circle at 20% 70%, rgba(170, 119, 255, 0.18) 0 10px, transparent 11px),
        radial-gradient(circle at 50% 78%, rgba(98, 205, 255, 0.2) 0 14px, transparent 15px),
        radial-gradient(circle at 78% 72%, rgba(72, 192, 0, 0.16) 0 11px, transparent 12px);
    bottom: 0;
    content: "";
    height: 52px;
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
}

.typing-orbs span {
    align-items: center;
    background: #ffffff;
    border: 2px solid #62CDFF;
    border-radius: 999px;
    color: #384566;
    display: inline-flex;
    font-size: 20px;
    font-weight: 800;
    height: 44px;
    justify-content: center;
    line-height: 1;
    position: relative;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
    width: 44px;
    z-index: 1;
}

.mini-game.is-hidden-spelling .typing-orbs span {
    color: transparent;
}

.mini-game.is-hidden-spelling .typing-orbs span::after {
    color: #62CDFF;
    content: "?";
}

.typing-orbs span.is-current {
    border-color: #AA77FF;
    box-shadow: 0 0 0 5px rgba(170, 119, 255, 0.14);
    color: #AA77FF;
    transform: translateY(-3px) scale(1.08);
}

.typing-orbs span.is-burst {
    animation: waterBurst 0.38s cubic-bezier(0.18, 0.9, 0.25, 1.1);
}

.typing-orbs span.is-gone {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.2) translateY(-12px);
}

.typing-orbs.is-bursting::before {
    animation: stageBurst 0.48s ease-out;
    background: radial-gradient(circle, rgba(170, 119, 255, 0.26) 0 12%, rgba(98, 205, 255, 0.16) 13% 26%, transparent 27%);
    content: "";
    height: 180px;
    left: 50%;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    z-index: 2;
}

@keyframes waterBurst {
    0% {
        background: #ffffff;
        border-color: #62CDFF;
        box-shadow: 0 0 0 0 rgba(98, 205, 255, 0.35);
        opacity: 1;
        transform: scale(1);
    }

    38% {
        background: #eaf9ff;
        border-color: #62CDFF;
        box-shadow:
            0 -14px 0 -9px rgba(98, 205, 255, 0.95),
            10px -10px 0 -10px rgba(98, 205, 255, 0.78),
            15px 0 0 -9px rgba(55, 177, 235, 0.72),
            10px 11px 0 -10px rgba(166, 232, 255, 0.85),
            0 15px 0 -9px rgba(98, 205, 255, 0.65),
            -11px 10px 0 -10px rgba(55, 177, 235, 0.72),
            -16px 0 0 -9px rgba(166, 232, 255, 0.86),
            -10px -11px 0 -10px rgba(98, 205, 255, 0.76),
            0 0 0 10px rgba(98, 205, 255, 0.12);
        color: #1688c4;
        opacity: 1;
        transform: translateY(-4px) scale(1.2);
    }

    100% {
        background: rgba(234, 249, 255, 0.4);
        border-color: rgba(98, 205, 255, 0.2);
        box-shadow:
            0 -34px 0 -13px rgba(98, 205, 255, 0),
            25px -25px 0 -13px rgba(98, 205, 255, 0),
            36px 0 0 -13px rgba(55, 177, 235, 0),
            24px 26px 0 -13px rgba(166, 232, 255, 0),
            0 36px 0 -13px rgba(98, 205, 255, 0),
            -26px 24px 0 -13px rgba(55, 177, 235, 0),
            -38px 0 0 -13px rgba(166, 232, 255, 0),
            -24px -25px 0 -13px rgba(98, 205, 255, 0),
            0 0 0 18px rgba(98, 205, 255, 0);
        opacity: 0;
        transform: translateY(-10px) scale(0.3);
    }
}

@keyframes stageBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.25);
    }

    45% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

.game-feedback {
    color: #56627e;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.6;
    margin-top: 12px;
}

.game-feedback.is-success {
    color: #48C000;
}

.speech-target {
    align-items: center;
    background: #ffffff;
    border: 2px solid #d9f4ff;
    border-radius: 18px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 14px;
}

.speech-target p {
    color: #62CDFF;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.dictionary-footer {
    border-top: 1px solid #d9f4ff;
    color: #758098;
    display: grid;
    font-size: 12px;
    gap: 4px;
    line-height: 1.6;
    margin-top: 34px;
    padding-top: 18px;
}

.typing-input-label {
    color: #384566;
    display: block;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px;
}

.typing-input-hint {
    color: #758098;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 10px;
}

.typing-input {
    background: #ffffff;
    border: 2px solid #d9f4ff;
    border-radius: 16px;
    color: #384566;
    font-size: 22px;
    font-weight: 800;
    min-height: 54px;
    outline: none;
    padding: 10px 14px;
    width: 100%;
}

.typing-input:focus {
    border-color: #AA77FF;
}

.typing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.typing-button,
.typing-reset {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    min-height: 42px;
    padding: 9px 18px;
}

.typing-button {
    background: #AA77FF;
    color: #ffffff;
}

.typing-reset {
    background: #ffffff;
    border: 1px solid #d9f4ff;
    color: #384566;
}

.typing-feedback {
    color: #56627e;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.6;
    margin-top: 12px;
}

.typing-feedback.is-success {
    color: #48C000;
}

@media (max-width: 900px) {
    .background {
        padding: 15px 20px;
    }

    .dictionary-container {
        border-radius: 30px;
        margin: 0;
        max-width: none;
        min-height: auto;
        overflow: visible;
        padding: 24px 20px;
    }
}

@media (max-width: 640px) {
    .dictionary-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .dictionary-header nav {
        flex-wrap: wrap;
    }

    .word-hero,
    .dictionary-home-hero {
        border-radius: 20px;
        padding: 22px 18px;
    }

    h1 {
        font-size: 44px;
    }

    .lead {
        font-size: 20px;
    }

    h2 {
        font-size: 24px;
    }

    .dictionary-lookup-form {
        flex-direction: column;
    }

    .dictionary-lookup-form button {
        width: 100%;
    }

    .speech-target {
        align-items: flex-start;
        flex-direction: column;
    }

    .speed-stats strong {
        font-size: 24px;
    }
}
