:root {
    --bg-color: #121212;
    --card-color: #1e1e1e;
    --primary-color: #B8860B;
    --primary-glow: rgba(184, 134, 11, 0.5);
    --text-color: #e0e0e0;
    --text-muted-color: #888;
    --font-header: 'Unbounded', sans-serif;
    --font-body: 'Manrope', sans-serif;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --border-color: #333
}

*, :after, :before {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden
}

body.modal-open {
    overflow: hidden
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px
}

section {
    padding: 80px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .6s ease-out, transform .6s ease-out
}

section.visible {
    margin-top: 10rem;
    opacity: 1;
    transform: translateY(0)
}

h1, h2, h3 {
    font-family: var(--font-header);
    color: #fff;
    margin-bottom: 20px;
    text-align: center
}

h1 {
    font-size: 3.5rem
}

h2 {
    font-size: 2.5rem
}

p {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 30px;
    color: var(--text-muted-color)
}

img.emoji {
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    font-family: var(--font-header);
    font-size: 1rem;
    border-radius: 10px;
    transition: all .3s ease;
    box-shadow: 0 0 15px var(--primary-glow);
    border: 2px solid var(--primary-color);
    cursor: pointer
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 25px var(--primary-glow)
}

.btn.disabled {
    background-color: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    border-color: #444
}

.btn-outline {
    background-color: transparent;
    box-shadow: none
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 25px var(--primary-glow)
}

.btn-secondary {
    background: 0 0;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: none
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: #fff
}

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(ellipse at bottom, var(--primary-glow) 0, transparent 50%)
}

.hero h1 {
    text-shadow: 0 0 20px var(--primary-glow)
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 40px
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center
}

.philosophy-grid {
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px
}

.philosophy-card {
    background-color: var(--card-color);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all .3s ease
}

.philosophy-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px var(--primary-glow)
}

.philosophy-card .icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color)
}

.philosophy-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px
}

.philosophy-card p {
    font-size: .9rem;
    text-align: center
}

.races-grid {
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(340px, 1fr));
    gap: 30px;
    margin-top: 50px
}

.race-card {
    background-color: var(--card-color);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all .3s ease;
    display: flex;
    flex-direction: column
}

.race-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .3);
    border-color: var(--primary-color)
}

.race-card-header {
    padding: 20px;
    text-align: center
}

.race-card-header h3 {
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px
}

.race-card-body {
    padding: 0 25px 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column
}

.race-card-body > p {
    font-size: .95rem;
    text-align: left;
    margin-bottom: 20px;
    color: var(--text-muted-color);
    flex-grow: 1
}

.mc-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px
}

.mc-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .95rem
}

.mc-icon {
    width: 24px;
    height: 24px;
    image-rendering: pixelated
}

.race-card-footer {
    margin-top: auto;
    text-align: center
}

.rules-list {
    max-width: 800px;
    margin: 50px auto 0;
    background: var(--card-color);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--border-color)
}

.rules-list ol {
    counter-reset: rules-counter;
    list-style: none;
    padding-left: 0
}

.rules-list li {
    counter-increment: rules-counter;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    font-size: 1rem
}

.rules-list li:before {
    content: counter(rules-counter);
    font-family: var(--font-header);
    font-size: 1.5rem;
    margin-right: 20px;
    color: var(--primary-color);
    min-width: 30px;
    text-align: center
}

.purchase-box {
    max-width: 600px;
    margin: 50px auto 0;
    text-align: center;
    background: var(--card-color);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 30px var(--primary-glow)
}

.purchase-box .price {
    font-family: var(--font-header);
    font-size: 3rem;
    color: #fff;
    margin-bottom: 10px
}

.purchase-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center
}

.nickname-input {
    padding: 15px;
    font-size: 1rem;
    border-radius: 10px;
    border: 1px solid #444;
    background-color: var(--bg-color);
    color: var(--text-color);
    width: 100%;
    max-width: 400px;
    text-align: center;
    transition: all .3s ease
}

.nickname-input:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow)
}

#nickname-feedback {
    font-size: .9rem;
    height: 1.2em;
    transition: color .3s ease
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2;
    opacity: 0;
    transition: opacity .3s ease
}

.modal-backdrop.visible {
    display: flex;
    opacity: 1
}

.modal-content {
    background-color: var(--card-color);
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    border: 1px solid var(--border-color);
    position: relative;
    transform: scale(.95);
    transition: transform .3s ease
}

.modal-backdrop.visible .modal-content {
    transform: scale(1)
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: 0 0;
    border: 0;
    color: var(--text-muted-color);
    font-size: 2rem;
    cursor: pointer;
    transition: color .3s ease
}

.modal-close:hover {
    color: #fff
}

#modal-race-title {
    margin-bottom: 10px;
    text-align: left
}

#modal-race-lore {
    font-size: 1rem;
    text-align: left;
    margin-bottom: 30px;
    color: var(--text-color)
}

#modal-race-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px
}

#notification {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--card-color);
    color: #fff;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
    z-index: 3;
    align-items: center;
    gap: 15px
}

#closeNotification {
    background: 0 0;
    border: 0;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1
}

footer {
    margin-top: 10rem;
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted-color)
}

.footer-ips {
    margin-bottom: 20px
}

.footer-ips span {
    display: block;
    margin-bottom: 5px
}

.footer-ips strong {
    color: var(--text-color)
}

.footer-links a {
    color: var(--text-muted-color);
    text-decoration: none;
    margin: 0 10px;
    transition: color .3s ease
}

.footer-links a:hover {
    color: var(--primary-color)
}

.copyright {
    margin-top: 20px;
    font-size: .9rem
}

.modal-content.modal-lg {
    max-width: 850px
}

.wiki-header {
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px
}

.wiki-header .mc-icon.header-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0
}

.wiki-header h2 {
    text-align: left;
    margin: 0
}

.wiki-header p {
    text-align: left;
    margin: 5px 0 0;
    max-width: none
}

.wiki-tabs {
    display: flex;
    gap: 20px
}

.tab-buttons {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    padding-right: 20px;
    flex-shrink: 0
}

.tab-button {
    padding: 10px 15px;
    cursor: pointer;
    background: 0 0;
    border: 0;
    color: var(--text-muted-color);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all .3s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left
}

.tab-button:hover {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, .05)
}

.tab-button.active {
    color: var(--primary-color);
    background-color: var(--primary-glow);
    font-weight: 700
}

.tab-button .emoji {
    width: 1.2em;
    height: 1.2em
}

.tab-content-container {
    flex-grow: 1;
    min-width: 0
}

.loot-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap
}

.filter-button {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    color: var(--text-muted-color);
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: .9rem;
    transition: all .2s ease
}

.filter-button:hover {
    border-color: var(--primary-color);
    color: var(--text-color)
}

.filter-button.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 500
}

.tab-pane {
    display: none;
    animation: fadeIn .5s;
    height: 350px;
    overflow-y: auto;
    padding-right: 10px
}

.tab-pane::-webkit-scrollbar {
    width: 6px
}

.tab-pane::-webkit-scrollbar-track {
    background: 0 0
}

.tab-pane::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 6px
}

.tab-pane::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-color)
}

.tab-pane.active {
    display: block
}

@keyframes fadeIn {
    0% {
        opacity: 0
    }
    to {
        opacity: 1
    }
}

.loot-table {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px
}

.loot-item {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease
}

.loot-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, .2)
}

.loot-item .mc-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
    background-color: rgba(0, 0, 0, .2);
    padding: 5px;
    border-radius: 5px
}

.loot-item span {
    font-size: .9rem;
    color: var(--text-color);
    display: block
}

#global-tooltip {
    position: fixed;
    background-color: #000;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: .9rem;
    max-width: 200px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 9999;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow)
}

.rarity-treasure {
    border-color: #ffd700
}

.rarity-fish {
    border-color: #87ceeb
}

.rarity-junk {
    border-color: #8b4513
}

.wiki-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px
}

.factor-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .9rem;
    color: var(--text-muted-color)
}

.factor-info strong {
    color: var(--text-color)
}

.rules-header {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px
}

.rules-container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 15px
}

.rules-section {
    margin-bottom: 30px
}

.rules-section h3 {
    text-align: left;
    font-size: 1.3rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 15px
}

.rules-section p {
    text-align: left;
    max-width: none;
    color: var(--text-color);
    margin-bottom: 15px
}

.rules-section ol, .rules-section ul {
    list-style-position: inside;
    padding-left: 5px
}

.rules-section li {
    margin-bottom: 10px;
    color: var(--text-muted-color);
    line-height: 1.5
}

.rules-section li strong {
    color: var(--text-color);
    font-weight: 500
}

.rules-section ul li {
    list-style-type: none;
    display: flex;
    align-items: center;
    gap: 8px
}

.rules-section ul li .emoji, .rules-section ul li .mc-icon {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    flex-shrink: 0
}

.infographic-box {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap
}

.infographic-box.column {
    flex-direction: column;
    align-items: stretch;
    gap: 10px
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    color: var(--text-color)
}

.info-item .emoji, .info-item .mc-icon {
    width: 48px;
    height: 48px
}

.info-arrow {
    font-size: 2rem;
    color: var(--text-muted-color);
    font-family: var(--font-header)
}

.info-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color)
}

.infographic-box.column .info-line:last-child {
    border-bottom: none
}

.info-label {
    color: var(--text-muted-color);
    display: flex;
    align-items: center;
    gap: 8px
}

.info-value {
    color: var(--text-color);
    font-weight: 700;
    font-family: var(--font-header);
    font-size: 1.1rem
}

.info-value.highlight {
    color: var(--primary-color)
}

.rules-container::-webkit-scrollbar {
    width: 8px
}

.rules-container::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 10px
}

.rules-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 10px;
    border: 2px solid var(--bg-color)
}

.rules-container::-webkit-scrollbar-thumb:hover {
    background-color: #c787ff
}

/* Language Switcher */
.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 5px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-muted-color);
    font-family: var(--font-header);
    cursor: pointer;
    padding: 5px 10px;
    font-size: 0.9rem;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 15px;
}

.lang-btn.active {
    color: #fff;
    background-color: var(--primary-color);
    font-weight: 700;
}

.lang-btn:not(.active):hover {
    color: #fff;
}

.lang-separator {
    color: var(--text-muted-color);
    margin: 0 2px;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem
    }

    h2 {
        font-size: 2rem
    }

    section {
        padding: 60px 0
    }

    section.visible, footer {
        margin-top: 5rem
    }

    .hero-buttons {
        flex-direction: column
    }

    .philosophy-grid, .races-grid {
        grid-template-columns:1fr
    }

    .modal-content {
        padding: 20px 15px;
        width: 95%;
        max-height: 85vh;
        display: flex;
        flex-direction: column
    }

    .modal-close {
        top: 8px;
        right: 12px;
        font-size: 1.8rem
    }

    .rules-header, .wiki-header {
        flex-shrink: 0;
        padding-bottom: 15px;
        margin-bottom: 15px
    }

    .rules-header h2, .wiki-header h2 {
        font-size: 1.5rem
    }

    .rules-header p, .wiki-header p {
        font-size: .9rem
    }

    .rules-container {
        flex-grow: 1;
        overflow-y: auto;
        padding-right: 8px;
        min-height: 0
    }

    .rules-section h3 {
        font-size: 1.1rem
    }

    .rules-section li, .rules-section p {
        font-size: .9rem
    }

    .infographic-box {
        padding: 15px;
        flex-direction: column;
        gap: 15px
    }

    .info-arrow {
        transform: rotate(90deg);
        margin: -5px 0
    }

    .info-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px
    }

    .info-value {
        font-size: 1rem
    }

    #modal-race-features {
        overflow-y: auto;
        max-height: 40vh;
        padding-right: 5px
    }

    .wiki-tabs {
        flex-direction: column;
        flex-grow: 1;
        min-height: 0
    }

    .tab-buttons {
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 10px;
        margin-bottom: 10px;
        flex-shrink: 0
    }

    .tab-content-container {
        flex-grow: 1;
        min-height: 0;
        overflow-y: auto;
        padding-right: 8px
    }

    .tab-pane {
        display: block;
        height: auto;
        max-height: none
    }

    .loot-table {
        grid-template-columns:repeat(auto-fill, minmax(120px, 1fr))
    }

    .loot-item .mc-icon {
        width: 48px;
        height: 48px
    }
}

@media (max-width: 600px) {
    .info-arrow {
        display: none
    }

    .infographic-box {
        flex-direction: column
    }
}
