:root {
    --glaze: #e7eef8;
    --cobalt: #123f86;
    --deep: #0b2754;
    --brass: #a6843d;
    --paper: #f7f5ef;
    --ink: #172033;
    --display: "Fraunces", "Times New Roman", serif;
    --sans: "Figtree", "Segoe UI", sans-serif;
}

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

[hidden] {
    display: none !important;
}

body {
    background-color: var(--deep);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Crect width='56' height='56' fill='%23e7eef8'/%3E%3Cpath d='M28 6 L50 28 L28 50 L6 28 Z' fill='none' stroke='%23123f86' stroke-opacity='0.22' stroke-width='1.4'/%3E%3Ccircle cx='28' cy='28' r='2.4' fill='%23a6843d' fill-opacity='0.7'/%3E%3C/svg%3E");
    color: var(--ink);
    font-family: var(--sans);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font-family: inherit;
}

.page {
    max-width: 440px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: var(--glaze);
    background-image: inherit;
}

.plaque {
    padding: 22px 16px 6px;
}

.flTywP {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--paper);
    border: 8px solid var(--cobalt);
    outline: 1px solid var(--brass);
    outline-offset: -12px;
}

.userImg {
    width: 78px;
    height: 78px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--brass);
    background: white;
    flex-shrink: 0;
}

.plaque-copy {
    min-width: 0;
}

.account {
    font-family: var(--display);
    font-size: 30px;
    font-weight: 560;
    line-height: 1;
    color: var(--deep);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ins_btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--cobalt);
    color: white;
    font-size: 13px;
    font-weight: 700;
}

.ins_btn img {
    width: 14px;
    height: 14px;
}

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

.rtp-item {
    position: relative;
    padding: 16px 10px 14px;
    text-align: center;
    background: var(--paper);
    border: 3px solid var(--cobalt);
}

.rtp-item::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--brass);
    transform: rotate(45deg);
}

.rtp-number,
.onLineNumber {
    font-family: var(--display);
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    color: var(--cobalt);
}

.rtp-item > div:last-child {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brass);
}

.rtp-number.is-rolling,
.onLineNumber.is-rolling {
    animation: swell 0.7s ease;
}

@keyframes swell {
    0% { opacity: 0.35; }
    100% { opacity: 1; }
}

.panel {
    margin: 0 16px;
    padding: 22px 16px 16px;
    background: var(--paper);
    border: 3px solid var(--cobalt);
    box-shadow: inset 0 0 0 6px var(--glaze), inset 0 0 0 7px var(--brass);
}

.feature-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.logoFrame {
    position: relative;
    display: inline-flex;
    max-width: 220px;
    overflow: hidden;
    line-height: 0;
    padding: 6px 10px;
    background: white;
    border: 2px solid var(--cobalt);
    animation: tile-glow 1.8s ease-in-out infinite;
}

.logoFrame::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(166, 132, 61, 0.45), transparent);
    animation: tile-sheen 1.7s linear infinite;
}

.currentLogo {
    height: 62px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    cursor: pointer;
}

@keyframes tile-glow {
    0%, 100% { box-shadow: 0 0 0 3px rgba(166, 132, 61, 0.25); }
    50% { box-shadow: 0 0 0 3px var(--brass); }
}

@keyframes tile-sheen {
    from { transform: translateX(-160%); }
    to { transform: translateX(340%); }
}

.platformName {
    font-family: var(--display);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: var(--deep);
    cursor: pointer;
}

.inviteRow {
    margin-top: 18px;
    cursor: pointer;
}

.inviteLabel {
    display: block;
    margin-bottom: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brass);
}

.inviteStamp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 54px;
    padding: 6px 6px 6px 14px;
    background: white;
    border-bottom: 2px solid var(--cobalt);
}

.inviteCode {
    min-width: 0;
    font-family: var(--display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--cobalt);
    user-select: all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copyBtn,
.openLinkBtn,
.luckyButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    font-weight: 700;
}

.copyBtn {
    flex-shrink: 0;
    height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--brass);
    color: var(--deep);
    font-size: 13px;
}

.copyBtn img {
    width: 14px;
    height: 14px;
    filter: brightness(0);
}

.openPlatform {
    display: block;
    margin-top: 16px;
}

.openLinkBtn {
    width: 100%;
    height: 50px;
    background: var(--cobalt);
    color: white;
    font-size: 16px;
    letter-spacing: 0.04em;
}

.openLinkBtn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.luckyButton {
    width: 100%;
    margin-top: 10px;
    min-height: 48px;
    padding: 8px 12px;
    background: transparent;
    color: var(--cobalt);
    border: 2px solid var(--cobalt);
    font-family: var(--display);
    font-size: 16px;
    font-weight: 560;
    line-height: 1.15;
    text-align: center;
}

.links {
    padding: 18px 16px 32px;
    display: none;
}

.links.is-open {
    display: block;
}

.cardHeader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cardHeaderIcon {
    width: 18px;
    height: 18px;
    filter: brightness(0);
}

.cardTitle {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 700;
    color: var(--deep);
}

.linkList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-list__empty {
    padding: 8px 2px;
    text-align: center;
    color: var(--cobalt);
    font-weight: 600;
}

.link-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid rgba(18, 63, 134, 0.28);
}

.link-item__thumb {
    width: 52px;
    height: 52px;
    overflow: hidden;
    background: white;
    border: 2px solid var(--cobalt);
}

.link-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.link-item__thumb--placeholder {
    border-style: dashed;
}

.link-item__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.link-item__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.link-item__name {
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-item__access {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    height: 26px;
    padding: 0 8px;
    background: var(--cobalt);
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.link-item__access img {
    width: 12px;
    height: 12px;
    filter: brightness(0) invert(1);
}

.link-item__url-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.link-item__copy {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.link-item__copy img {
    width: 16px;
    height: 16px;
    display: block;
    filter: brightness(0);
    opacity: 0.65;
}

.link-item__url {
    min-width: 0;
    font-size: 12px;
    color: #5d6d86;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1100;
    max-width: calc(100% - 32px);
    padding: 12px 16px;
    background: var(--deep);
    color: white;
    border-bottom: 3px solid var(--brass);
    font-size: 14px;
    font-weight: 700;
}

.luckyModal:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
}

.luckyBackdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 39, 84, 0.66);
    backdrop-filter: blur(6px);
}

.luckyCard {
    position: relative;
    width: min(420px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 22px;
    background: var(--paper);
    color: var(--ink);
    border: 3px solid var(--cobalt);
    box-shadow: inset 0 0 0 5px var(--glaze);
    animation: luckyIn 0.22s ease-out;
}

@keyframes luckyIn {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.modalClose {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--cobalt);
    color: white;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.modalBadge {
    display: inline-flex;
    padding: 5px 10px;
    background: var(--brass);
    color: var(--deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.luckyCard h3 {
    margin: 12px 40px 4px 0;
    font-family: var(--display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.05;
    color: var(--deep);
}

.modalSub {
    margin: 0 0 14px;
    color: #5d6d86;
    font-size: 13px;
    font-weight: 600;
}

.modalLogoWrap {
    height: 70px;
    margin: 10px 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid var(--cobalt);
}

.modalLogoWrap img {
    max-width: 160px;
    max-height: 54px;
    object-fit: contain;
}

.modalInfo {
    display: grid;
    gap: 10px;
}

.infoLine,
.luckScore {
    display: grid;
    gap: 5px;
    padding: 12px;
    background: white;
    border-bottom: 2px solid rgba(18, 63, 134, 0.2);
}

.infoLine span,
.luckScore span,
.modalCode small {
    color: var(--brass);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.infoLine strong {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    color: var(--deep);
}

.linkLine a {
    color: var(--cobalt);
    font-size: 13px;
    font-weight: 700;
    word-break: break-all;
    text-transform: none;
    letter-spacing: 0;
}

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

.modalCode {
    display: grid;
    gap: 7px;
    text-align: left;
    padding: 12px;
    border: none;
    cursor: pointer;
    font: inherit;
}

.modalCode strong {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.03em;
    word-break: break-all;
    text-transform: none;
}

.mysteryCopy {
    background: var(--cobalt);
    color: white;
}

.mysteryCopy small {
    color: rgba(255, 255, 255, 0.75);
}

.dailyCopy {
    background: #f3e7cf;
    color: var(--deep);
}

.luckScore {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.luckScore strong {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 700;
    color: var(--cobalt);
    text-transform: none;
}

.modalActions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.modalActions a,
.modalActions button {
    height: 44px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.openLuckyLink {
    background: var(--cobalt);
    color: white;
}

#copyLuckyLink {
    background: transparent;
    color: var(--cobalt);
    border: 2px solid var(--cobalt);
}

@media (max-width: 360px) {
    .account,
    .platformName {
        font-size: 24px;
    }

    .rtp-number,
    .onLineNumber,
    .inviteCode {
        font-size: 22px;
    }
}
