:root {
    color-scheme: dark;
    --mypage-gold: #fff1ad;
    --mypage-green: #0b3a35;
    --mypage-panel: rgba(9, 38, 38, 0.68);
    --mypage-panel-strong: rgba(7, 29, 34, 0.82);
    --mypage-border: rgba(255, 232, 142, 0.42);
    --mypage-text: #fff8d8;
    --mypage-muted: rgba(255, 248, 216, 0.72);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--mypage-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        linear-gradient(90deg, rgba(2, 19, 31, 0.54), rgba(255, 255, 255, 0.04) 48%, rgba(12, 36, 44, 0.32)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(3, 20, 26, 0.62)),
        url("../assets/title/title-background.jpg") center / cover fixed,
        #0b2830;
}

button,
input,
select,
textarea {
    font: inherit;
}

.hidden {
    display: none !important;
}

.mypage-shell {
    width: min(1120px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 34px 0 42px;
}

.mypage-header,
.mypage-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.mypage-header {
    margin-bottom: 22px;
}

.mypage-eyebrow {
    margin: 0 0 4px;
    color: rgba(255, 240, 167, 0.76);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mypage-header h1,
.mypage-panel-header h2 {
    margin: 0;
    color: var(--mypage-gold);
    text-shadow: 0 0 18px rgba(255, 234, 142, 0.36);
}

.mypage-header h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
}

.mypage-header-actions {
    display: flex;
    gap: 10px;
}

.mypage-home-link,
.mypage-primary-link,
.mypage-subtle-btn,
.mypage-friend-form button,
.mypage-card-actions button {
    border: 1px solid var(--mypage-border);
    border-radius: 999px;
    color: var(--mypage-gold);
    background: rgba(9, 46, 45, 0.72);
    box-shadow: 0 12px 26px rgba(2, 19, 25, 0.26);
    cursor: pointer;
    font-weight: 900;
    text-decoration: none;
}

.mypage-home-link,
.mypage-primary-link,
.mypage-subtle-btn {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 14px;
}

.mypage-primary-link {
    background: linear-gradient(135deg, #5865f2, #2563eb);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.34);
}

.mypage-home-link:hover,
.mypage-subtle-btn:hover,
.mypage-card-actions button:hover,
.mypage-friend-form button:hover {
    background: rgba(18, 73, 61, 0.9);
}

.mypage-login,
.mypage-app {
    border: 1px solid var(--mypage-border);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(21, 79, 67, 0.38), rgba(15, 44, 38, 0.52)),
        rgba(12, 38, 34, 0.34);
    box-shadow:
        0 24px 58px rgba(3, 24, 28, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px) saturate(1.08);
}

.mypage-login {
    padding: 34px;
}

.mypage-login-title {
    margin: 0 0 8px;
    color: var(--mypage-gold);
    font-size: 1.5rem;
    font-weight: 900;
}

.mypage-login p {
    color: var(--mypage-muted);
    line-height: 1.7;
}

.mypage-app {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 620px;
    overflow: hidden;
}

.mypage-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border-right: 1px solid rgba(255, 232, 142, 0.22);
    background: rgba(6, 31, 34, 0.42);
}

.mypage-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    border: 1px solid rgba(255, 232, 142, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--mypage-text);
    cursor: pointer;
    padding: 12px;
    text-align: left;
}

.mypage-tab span {
    font-size: 1rem;
    font-weight: 900;
}

.mypage-tab small {
    color: var(--mypage-muted);
    font-weight: 800;
}

.mypage-tab.is-active {
    background:
        linear-gradient(135deg, rgba(255, 225, 104, 0.24), rgba(21, 120, 89, 0.26)),
        rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 232, 142, 0.52);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.mypage-content {
    min-width: 0;
    padding: 22px;
}

.mypage-status {
    min-height: 24px;
    margin: 0 0 10px;
    color: #c9f7d0;
    font-weight: 900;
}

.mypage-status.is-error {
    color: #fecaca;
}

.mypage-panel {
    display: none;
}

.mypage-panel.is-active {
    display: block;
}

.mypage-panel-header {
    margin-bottom: 18px;
}

.mypage-profile-card,
.mypage-friend-form,
.mypage-record-card,
.mypage-section-card,
.mypage-match-card,
.mypage-list-card,
.mypage-empty {
    border: 1px solid rgba(255, 232, 142, 0.22);
    border-radius: 14px;
    background: var(--mypage-panel);
    box-shadow: 0 14px 34px rgba(2, 19, 25, 0.22);
}

.mypage-profile-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    padding: 20px;
}

.mypage-profile-body {
    min-width: 0;
}

.mypage-profile-headline,
.mypage-list-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mypage-avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.12);
    box-shadow:
        0 0 0 2px rgba(255, 232, 142, 0.48),
        0 0 28px rgba(255, 232, 142, 0.18);
}

.mypage-avatar-placeholder {
    display: grid;
    place-items: center;
    color: var(--mypage-gold);
    font-size: 2rem;
    font-weight: 900;
}

.mypage-profile-name {
    margin: 0 0 10px;
    color: var(--mypage-gold);
    font-size: 1.8rem;
    font-weight: 900;
}

.mypage-profile-headline .mypage-profile-name {
    margin-bottom: 0;
}

.mypage-presence {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 4px 9px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: rgba(255, 248, 216, 0.82);
    background: rgba(148, 163, 184, 0.16);
    font-size: 0.76rem;
    font-weight: 900;
}

.mypage-presence::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 10px rgba(148, 163, 184, 0.48);
}

.mypage-presence.is-online {
    color: #d9f99d;
    border-color: rgba(132, 204, 22, 0.42);
    background: rgba(22, 101, 52, 0.28);
}

.mypage-presence.is-online::before {
    background: #84cc16;
    box-shadow: 0 0 12px rgba(132, 204, 22, 0.8);
}

.mypage-profile-message {
    margin: 10px 0 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 232, 142, 0.16);
    border-radius: 12px;
    color: #fffbe8;
    background: rgba(255, 255, 255, 0.06);
    font-weight: 800;
    line-height: 1.55;
}

.mypage-profile-message.is-empty {
    color: var(--mypage-muted);
}

.mypage-favorite-card {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.mypage-favorite-card span {
    color: var(--mypage-muted);
    font-size: 0.82rem;
    font-weight: 900;
}

.mypage-favorite-card strong {
    color: var(--mypage-gold);
    font-weight: 900;
}

.mypage-id-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.mypage-id {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 232, 142, 0.34);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    color: #ffffff;
    font-size: 1.04rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.mypage-copy-btn {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: var(--mypage-text);
    cursor: pointer;
    padding: 6px 10px;
    font-size: 0.84rem;
    font-weight: 900;
}

.mypage-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mypage-meta-item {
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.mypage-meta-item span {
    display: block;
    color: var(--mypage-muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.mypage-meta-item strong {
    display: block;
    margin-top: 3px;
    color: var(--mypage-text);
}

.mypage-profile-form {
    display: grid;
    grid-template-columns: minmax(180px, 0.9fr) minmax(260px, 1.3fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 232, 142, 0.16);
}

.mypage-profile-form label {
    display: grid;
    gap: 6px;
    color: var(--mypage-muted);
    font-size: 0.82rem;
    font-weight: 900;
}

.mypage-profile-form select,
.mypage-profile-form textarea {
    width: 100%;
    border: 1px solid rgba(255, 232, 142, 0.25);
    border-radius: 10px;
    background: rgba(2, 19, 25, 0.46);
    color: #fff;
    padding: 10px 11px;
    font-weight: 900;
}

.mypage-profile-form textarea {
    resize: vertical;
    min-height: 44px;
}

.mypage-profile-form button {
    border: 1px solid var(--mypage-border);
    border-radius: 999px;
    color: var(--mypage-gold);
    background: rgba(9, 46, 45, 0.72);
    cursor: pointer;
    font-weight: 900;
    min-height: 40px;
    padding: 8px 16px;
}

.mypage-profile-recent {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(255, 232, 142, 0.22);
    border-radius: 14px;
    background: var(--mypage-panel);
    box-shadow: 0 14px 34px rgba(2, 19, 25, 0.22);
}

.mypage-profile-recent h3 {
    margin: 0 0 12px;
    color: var(--mypage-gold);
    font-weight: 900;
}

.mypage-stats-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mypage-record-card {
    padding: 16px;
    background:
        linear-gradient(135deg, rgba(255, 225, 104, 0.12), rgba(21, 120, 89, 0.16)),
        var(--mypage-panel);
}

.mypage-record-label {
    display: block;
    color: var(--mypage-muted);
    font-size: 0.82rem;
    font-weight: 900;
}

.mypage-record-main {
    display: block;
    margin: 4px 0;
    color: var(--mypage-gold);
    font-size: 2rem;
    line-height: 1;
}

.mypage-record-card small {
    color: var(--mypage-muted);
    font-weight: 900;
}

.mypage-section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    gap: 14px;
}

.mypage-section-card {
    padding: 16px;
}

.mypage-section-card h3,
.mypage-usage-block h4 {
    margin: 0 0 12px;
    color: var(--mypage-gold);
    font-weight: 900;
}

.mypage-match-card {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.mypage-match-outcome {
    display: inline-flex;
    justify-content: center;
    padding: 6px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.82rem;
}

.mypage-match-outcome.is-win {
    background: rgba(34, 197, 94, 0.36);
}

.mypage-match-outcome.is-loss {
    background: rgba(248, 113, 113, 0.34);
}

.mypage-match-outcome.is-draw {
    background: rgba(148, 163, 184, 0.34);
}

.mypage-match-title {
    color: var(--mypage-text);
    font-weight: 900;
}

.mypage-match-meta {
    color: var(--mypage-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.mypage-match-link {
    color: var(--mypage-gold);
    font-weight: 900;
    text-decoration: none;
}

.mypage-card-usage {
    display: grid;
    gap: 12px;
}

.mypage-usage-block {
    padding: 12px;
    border: 1px solid rgba(255, 232, 142, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.mypage-usage-block ol {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-left: 22px;
}

.mypage-usage-block li {
    color: var(--mypage-text);
    font-weight: 800;
}

.mypage-usage-block li strong {
    float: right;
    margin-left: 10px;
    color: var(--mypage-muted);
}

.mypage-usage-empty {
    margin: 0;
    color: var(--mypage-muted);
    font-weight: 800;
}

.mypage-friend-form {
    margin-bottom: 16px;
    padding: 14px;
}

.mypage-friend-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--mypage-muted);
    font-weight: 900;
}

.mypage-friend-form div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.mypage-friend-form input {
    min-width: 0;
    border: 1px solid rgba(255, 232, 142, 0.25);
    border-radius: 10px;
    background: rgba(2, 19, 25, 0.34);
    color: #fff;
    padding: 11px 12px;
    font-weight: 900;
}

.mypage-friend-form button,
.mypage-card-actions button {
    padding: 9px 13px;
}

.mypage-list {
    display: grid;
    gap: 10px;
}

.mypage-list-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.mypage-list-card .mypage-avatar {
    width: 52px;
    height: 52px;
}

.mypage-list-name {
    color: var(--mypage-gold);
    font-size: 1rem;
    font-weight: 900;
}

.mypage-list-id,
.mypage-list-date,
.mypage-list-message,
.mypage-list-favorite {
    color: var(--mypage-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.mypage-list-message {
    color: rgba(255, 248, 216, 0.9);
}

.mypage-card-actions {
    display: flex;
    gap: 8px;
}

.mypage-card-actions .danger {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.34);
    background: rgba(127, 29, 29, 0.34);
}

.mypage-empty {
    padding: 24px;
    color: var(--mypage-muted);
    font-weight: 900;
    text-align: center;
}

@media (max-width: 780px) {
    .mypage-shell {
        width: min(100vw - 20px, 680px);
        padding-top: 18px;
    }

    .mypage-header,
    .mypage-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .mypage-app {
        grid-template-columns: 1fr;
    }

    .mypage-sidebar {
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 232, 142, 0.22);
    }

    .mypage-tab {
        min-width: 132px;
    }

    .mypage-content {
        padding: 16px;
    }

    .mypage-profile-card,
    .mypage-list-card {
        grid-template-columns: 1fr;
    }

    .mypage-stats-summary,
    .mypage-section-grid,
    .mypage-meta-grid,
    .mypage-profile-form,
    .mypage-friend-form div {
        grid-template-columns: 1fr;
    }

    .mypage-match-card {
        grid-template-columns: 1fr;
    }

    .mypage-card-actions {
        flex-wrap: wrap;
    }
}
