@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&family=Orbitron:wght@400;700&display=swap');

:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --border-color: #30363d;
    --accent-color: #58a6ff;
    --text-color: #c9d1d9;
    --text-muted: #8b949e;
    --font-body: 'Noto Sans JP', sans-serif;
    --font-display: 'Orbitron', sans-serif;
    --red-color: #e94560;
    --orange-color: #f7b801;
    --yellow-color: #f7e01e;
    --green-color: #32e0c4;
    --purple-color: #a259ff;
    --white-color: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.15);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::-webkit-scrollbar {
    width: 12px;
}

body::-webkit-scrollbar-track {
    background: var(--bg-color);
}

body::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
    border: 3px solid var(--bg-color);
}

.app-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .game-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--white-color);
    margin: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile .username {
    font-weight: bold;
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.logout-button {
    font-size: 0.9rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.logout-button:hover {
    background-color: var(--border-color);
    color: var(--white-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.game-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    grid-template-areas: "progress upgrades" "progress controls";
    gap: 2rem;
    align-items: start;
}

.progress-container {
    grid-area: progress;
    position: sticky;
    top: calc(80px + 1.5rem);
}

.upgrades-container {
    grid-area: upgrades;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.controls-container {
    grid-area: controls;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-wrapper {
    width: 320px;
    height: 320px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.progress-ring-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
}

.progress-ring__bg {
    fill: none;
    stroke: #21262d;
    stroke-width: 10;
}

.progress-ring__circle {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
}

.resource-display {
    text-align: center;
    position: relative;
    z-index: 10;
    pointer-events: none;
    width: 75%;
    height: 75%;
    background-color: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.points-counter {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: white;
    margin: 0.5rem 0;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6), 0 0 12px var(--accent-color);
    white-space: nowrap;
    display: inline-block;
    transition: transform 0.1s ease-out;
}

.resource-display p {
    margin: 0.1rem 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.points-per-second {
    font-size: 1.1rem;
    color: var(--text-muted);
}

#prestige-exponent-display {
    font-family: var(--font-display);
    font-weight: bold;
}

.buy-amount-selector {
    display: flex;
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.buy-amount-btn {
    flex: 1;
    padding: 8px;
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.buy-amount-btn.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.buy-amount-btn:not(.active):hover {
    background-color: var(--border-color);
}

.circle-card {
    background: var(--card-bg);
    border-left: 5px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.circle-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.circle-info h4 {
    margin: 0;
    font-size: 1.2rem;
}

.circle-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.circle-actions {
    display: flex;
    gap: 0.75rem;
}

.action-button {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-button:hover:not(:disabled) {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.action-button:active:not(:disabled) {
    transform: translateY(0);
}

.action-button:disabled {
    color: #484f58;
    border-color: #484f58;
    cursor: not-allowed;
}

.ascend-button {
    color: var(--yellow-color);
    border-color: var(--yellow-color);
}

.ascend-button:hover:not(:disabled) {
    background-color: var(--yellow-color);
    color: var(--bg-color);
}

.ui-button {
    font-family: var(--font-body);
    font-weight: bold;
    font-size: 1.1rem;
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
}

.ui-button:hover:not(:disabled) {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ui-button:active:not(:disabled) {
    transform: translateY(0);
}

.prestige-button {
    background: var(--accent-color);
    color: white;
    border: none;
}

.prestige-button:hover:not(:disabled) {
    background: #79c0ff;
    border-color: #79c0ff;
}

.promotion-button {
    background: var(--purple-color);
    color: white;
    border: none;
}

.promotion-button:hover:not(:disabled) {
    background: #b87ffc;
    border-color: #b87ffc;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--accent-color);
}

.modal-close-button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close-button:hover {
    color: var(--white-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--card-bg);
}

.modal-body::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
    border: 2px solid var(--card-bg);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 1rem;
    background-color: #0d1117;
    border-radius: 0 0 12px 12px;
}

.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-list li {
    display: grid;
    grid-template-columns: 40px 50px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.ranking-list li:last-child {
    border-bottom: none;
}

.rank-number {
    font-family: var(--font-display);
    font-size: 1.2rem;
    text-align: center;
    color: var(--text-muted);
}

.rank-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.rank-name {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-points {
    font-family: var(--font-display);
    color: var(--accent-color);
    text-align: right;
}

.ranking-list li:nth-child(1) .rank-number { color: #ffd700; }
.ranking-list li:nth-child(2) .rank-number { color: #c0c0c0; }
.ranking-list li:nth-child(3) .rank-number { color: #cd7f32; }

.ranking-list li.current-user {
    background-color: rgba(88, 166, 255, 0.1);
    border-left: 3px solid var(--accent-color);
    margin: 0 -1.5rem;
    padding-left: calc(1.5rem - 3px);
    padding-right: 1.5rem;
}

.promotion-options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.promotion-option {
    background-color: #0d1117;
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    border-radius: 6px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.promotion-option:hover {
    border-color: var(--accent-color);
    border-left-color: var(--accent-color) !important;
    transform: scale(1.02);
}

.promotion-option h4 {
    margin: 0 0 0.5rem;
    color: var(--text-color);
}

.promotion-option p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.promotion-option-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.promotion-level {
    font-family: var(--font-display);
    font-weight: bold;
}

.promote-button {
    background-color: var(--purple-color);
    color: white;
    border: none;
}

.promote-button:hover:not(:disabled) {
    background-color: #b87ffc;
    filter: brightness(1.2);
}

@media (max-width: 992px) {
    .game-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "progress"
            "upgrades"
            "controls";
    }

    .progress-container {
        position: static;
    }

    .app-header {
        padding: 0.75rem 1rem;
    }

    .app-header .game-title {
        font-size: 1.25rem;
    }

    .user-profile .username {
        display: none;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    .progress-wrapper {
        width: 100%;
        max-width: 280px;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .points-counter {
        font-size: 1.8rem;
    }

    .circle-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .circle-actions {
        justify-content: space-between;
    }

    .action-button {
        flex-grow: 1;
        text-align: center;
    }

    .ranking-list li {
        grid-template-columns: 30px 40px 1fr auto;
        gap: 0.5rem;
    }

    .rank-avatar {
        width: 35px;
        height: 35px;
    }

    .modal-content {
        max-height: 90vh;
    }
}

#background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    border: 2px solid;
    animation: float 25s infinite linear;
}

.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

.landing-content {
    max-width: 800px;
    width: 100%;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.landing-header {
    margin-bottom: 3rem;
}

.landing-title {
    font-family: var(--font-display);
    font-size: 4rem;
    margin: 0 0 1rem;
    color: var(--white-color);
    text-shadow: 0 0 15px var(--accent-color);
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-color);
    margin: 0 0 1rem;
}

.cta-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 2rem;
}

.discord-login-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #5865F2;
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.discord-login-button i {
    font-size: 1.5em;
}

.discord-login-button:hover {
    background-color: #4f5bda;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
}

.features {
    margin-bottom: 3rem;
}

.features h2 {
    font-family: var(--font-display);
    color: var(--accent-color);
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.feature-card h3 {
    margin: 0 0 0.5rem;
    color: var(--text-color);
}

.feature-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.landing-footer {
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .landing-content {
        padding: 1.5rem;
        margin: 1rem;
        border: 1px solid var(--border-color);
    }

    .landing-title {
        font-size: 3rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .discord-login-button {
        padding: 12px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .landing-content {
        padding: 1.5rem 1rem;
        background: transparent;
        border: none;
        backdrop-filter: none;
    }

    .landing-title {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1rem;
    }
}
