:root {
    --bg: #ffffff;
    --card: #ffffff;
    --muted: #555555;
    --text: #0b0b0b;
    --brand: #ff7a00;
    --accent: #ff7a00;
    --radius: 18px;
    --shadow: 0 6px 20px rgba(0, 0, 0, .08);
    --maxw: 720px;
}

:root.dark {
    --bg: #0b0b0b;
    --card: #131313;
    --muted: #a5a5a5;
    --text: #f5f5f5;
    --brand: #ff7a00;
    --accent: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Noto Sans JP, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100%
}

body {
    display: flex;
    justify-content: center
}

.wrap {
    width: 100%;
    max-width: var(--maxw);
    padding: 24px 16px 60px
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-top: 20px
}

.header-banner {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px
}

.header-banner img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover
}

.header {
    text-align: center;
    margin-bottom: 12px
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
    background: #000
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px
}

.subtitle {
    color: var(--muted);
    font-size: 14px
}

.toolbar {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 6px 0 10px
}

.tbtn {
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .04);
    color: inherit;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer
}

.tbtn:hover {
    border-color: var(--brand)
}

.section {
    margin-top: 28px
}

.section h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--muted);
    margin: 18px 0 12px;
    text-align: left
}

.links {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: .2s
}

:root.dark .link {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08)
}

.link:hover {
    border-color: var(--brand);
    transform: translateY(-1px)
}

.link-left {
    display: flex;
    align-items: center;
    gap: 12px
}

.icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 122, 0, 0.18);
    border-radius: 8px;
    font-size: 18px;
    color: var(--text)
}

.link-title {
    font-weight: 700
}

.link-desc {
    font-size: 12px;
    color: var(--muted)
}

.chip {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 122, 0, 0.14);
    color: #ffa762;
    border: 1px solid rgba(255, 122, 0, 0.28)
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px
}

@media(min-width:600px) {
    .grid {
        grid-template-columns: 1fr 1fr
    }
}

.footer {
    text-align: center;
    margin-top: 32px;
    color: var(--muted);
    font-size: 12px
}

/* sponsor grid */
.sponsor-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px
}

@media(min-width:600px) {
    .sponsor-grid {
        grid-template-columns: 1fr 1fr
    }
}

.sponsor-item {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow)
}

:root.dark .sponsor-item {
    background: rgba(255, 255, 255, 0.03)
}

.sponsor-item img {
    width: 100%;
    display: block;
    cursor: pointer
}

.sponsor-actions {
    text-align: center;
    padding: 8px
}

.sponsor-btn {
    border: none;
    background: var(--brand);
    color: #fff;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer
}

.sponsor-btn:hover {
    opacity: .9
}

dialog.sponsor-pop {
    border: none;
    border-radius: 14px;
    padding: 20px;
    max-width: 400px;
    background: var(--card);
    color: var(--text)
}

dialog.sponsor-pop::backdrop {
    background: rgba(0, 0, 0, .45)
}

/* ===== Share Sheet (Linktree風) ===== */
dialog.share-sheet {
    border: none;
    border-radius: 24px;
    padding: 0;
    width: min(640px, 92%);
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow)
}

dialog.share-sheet::backdrop {
    background: rgba(0, 0, 0, .5)
}

.share-top {
    position: relative;
    padding: 18px 56px 0;
    text-align: center;
    font-weight: 800;
    font-size: 18px;
    line-height: 1
}

.share-xbtn {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: 18px;
    cursor: pointer
}

.share-preview {
    margin: 16px auto 10px;
    width: calc(100% - 40px);
    border-radius: 24px;
    background: #2b2b2b;
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px
}

.share-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    background: #000
}

.share-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.share-handle {
    font-weight: 900;
    font-size: 22px;
    letter-spacing: .6px
}

.share-path {
    opacity: .85;
    margin-top: 4px;
    font-weight: 700
}

.share-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px 10px;
    padding: 14px 22px 8px
}

.share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit
}

.share-icon {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 0, 0, .06);
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .04)
}

:root.dark .share-icon {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .12)
}

.share-icon i {
    font-size: 22px
}

.share-label {
    font-weight: 700;
    font-size: 15px
}

.share-sep {
    height: 1px;
    background: rgba(0, 0, 0, .06);
    margin: 10px 0 0
}

:root.dark .share-sep {
    background: rgba(255, 255, 255, .08)
}

.share-bottom {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 18px
}

.btn-pill {
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 800;
    background: var(--brand);
    color: #fff
}

.btn-ghost {
    border: none;
    background: transparent;
    color: inherit;
    font-weight: 800;
    padding: 10px 8px;
    cursor: pointer
}

@media(max-width:520px) {
    .share-row {
        grid-template-columns: repeat(4, 1fr)
    }
}