* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #1e1e2f;
    color: #ffffff;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    word-wrap: break-word;
    min-height: 100vh;
    line-height: 1.6;
}

header {
    background: #2a2a40;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.site-name {
    color: #00ffcc;
    margin: 0;
    font-size: 24px;
    text-decoration: none;
    white-space: nowrap;
    font-weight: bold;
}

nav {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #00ffcc;
    text-decoration: underline;
}

.nav-primary {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-auth {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.container {
    background: #2a2a40;
    border: 2px solid #00ffcc;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 1200px;
    margin: 2rem auto;
}

.converter-section {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.converter-section h1 {
    color: #00ffcc;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.writing-system-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.writing-system-tabs .tab {
    padding: 0.75rem 1.5rem;
    background: #1e1e2f;
    color: #ffffff;
    text-decoration: none;
    border: 2px solid #00ffcc;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.writing-system-tabs .tab:hover {
    background: #2a2a40;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 255, 204, 0.3);
}

.writing-system-tabs .tab.active {
    background: #00ffcc;
    color: #1e1e2f;
    border-color: #00e6b8;
}

.popular-names {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #1e1e2f;
    border-radius: 15px;
    border: 1px solid #444;
}

.popular-section h3 {
    color: #00ffcc;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.name-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.name-tag {
    background: #2a2a40;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #00ffcc;
    font-size: 0.9rem;
}

.name-tag:hover {
    background: #00ffcc;
    color: #1e1e2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 255, 204, 0.3);
}

.converter-form {
    margin: 2rem 0;
    padding: 2rem;
    background: #1e1e2f;
    border-radius: 15px;
    border: 1px solid #444;
}

.instruction {
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.instruction-jp {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.input-group input {
    flex: 1;
    padding: 1rem;
    font-size: 1.1rem;
    background: #2a2a40;
    border: 2px solid #00ffcc;
    border-radius: 8px;
    color: #ffffff;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #00e6b8;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.3);
}

.input-group input::placeholder {
    color: #888;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.btn-primary {
    background: #00ffcc;
    color: #1e1e2f;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 204, 0.4);
    background: #00e6b8;
}

.btn-primary:active {
    transform: translateY(0);
}

.result-display {
    margin-top: 2rem;
    padding: 2rem;
    background: #1e1e2f;
    border: 2px solid #00ffcc;
    border-radius: 15px;
    min-height: 100px;
    display: none;
}

.result-display.show {
    display: block;
}

.result-display h3 {
    color: #00ffcc;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.result-display .katakana {
    font-size: 2.5rem;
    color: #00ffcc;
    font-weight: bold;
    margin: 1rem 0;
    font-family: 'MS Gothic', 'MS PGothic', 'Hiragino Kaku Gothic Pro', 'Yu Gothic', sans-serif;
    letter-spacing: 0.1em;
}

.result-display .original-name {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.content-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #444;
}

.content-section h2 {
    color: #00ffcc;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.8rem;
}

.content-section h3 {
    color: #00ffcc;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.4rem;
}

.content-section p {
    margin-bottom: 1rem;
    color: #ffffff;
    text-align: justify;
    line-height: 1.8;
}

.usage-list {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.usage-list li {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.usage-list li strong {
    color: #00ffcc;
}

.features-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.features-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #ffffff;
    line-height: 1.8;
}

.features-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #00ffcc;
    font-weight: bold;
    font-size: 1.2rem;
}

footer {
    background-color: #1e1e2f;
    color: white;
    text-align: center;
    padding: 1em 0;
    position: relative;
    bottom: 0;
    width: 100%;
    overflow-x: hidden;
    margin-top: 50px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.footer-links a:hover {
    color: #00ffcc;
    text-decoration: underline;
}

.footer-copyright {
    color: #ffffff;
    font-size: 14px;
    margin-top: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        width: 100%;
    }

    .nav-primary, .nav-auth {
        width: 100%;
        justify-content: flex-start;
    }

    .converter-section h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .popular-names {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
    }

    .input-group {
        flex-direction: column;
        max-width: 100%;
    }

    .input-group input {
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .result-display .katakana {
        font-size: 2rem;
    }

    .content-section h2 {
        font-size: 1.5rem;
    }

    .content-section h3 {
        font-size: 1.2rem;
    }

    .usage-list {
        margin-left: 1.5rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0 1rem;
    }

    .container {
        padding: 1rem;
    }

    .converter-section {
        padding: 1rem 0;
    }

    .converter-section h1 {
        font-size: 1.75rem;
    }

    .converter-form {
        padding: 1.5rem;
    }

    .result-display {
        padding: 1.5rem;
    }

    .result-display .katakana {
        font-size: 1.75rem;
    }
}
