:root {
    --straw: #f6e0b6;
    --straw-deep: #e8c98a;
    --ember: #d63a24;
    --corn: #f2b705;
    --denim: #163e66;
    --paper: #fffaf3;
    --ink: #2a160f;
    --display: "Paytone One", "Arial Black", sans-serif;
    --sans: "Outfit", "Segoe UI", sans-serif;
}

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

[hidden] {
    display: none !important;
}

body {
    background:
        radial-gradient(circle at 12% 8%, rgba(242, 183, 5, 0.45), transparent 18%),
        radial-gradient(circle at 88% 0, rgba(214, 58, 36, 0.18), transparent 22%),
        var(--straw-deep);
    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: var(--straw);
}

.bunting {
    height: 22px;
    background-color: #8c3b16;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='22' viewBox='0 0 96 22'%3E%3Cpolygon points='6,1 22,1 14,18' fill='%23d63a24'/%3E%3Cpolygon points='28,1 44,1 36,18' fill='%23f2b705'/%3E%3Cpolygon points='50,1 66,1 58,18' fill='%231f7a46'/%3E%3Cpolygon points='72,1 88,1 80,18' fill='%23163e66'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: center top;
}

.sign {
    padding: 18px 16px 8px;
}

.flTywP {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--paper);
    border: 3px solid var(--ink);
    box-shadow: 6px 6px 0 var(--ember);
}

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

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

.account {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    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 10px;
    border-radius: 999px;
    background: var(--denim);
    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 16px 4px;
}

.rtp-item {
    min-height: 108px;
    padding: 14px 8px 22px;
    text-align: center;
    color: white;
    clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
}

.rtp-item--fire {
    background: var(--ember);
}

.rtp-item--denim {
    background: var(--denim);
}

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

.rtp-item > div:last-child {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

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

.stall {
    margin: 8px 16px 0;
    padding: 18px 14px 16px;
    background: var(--paper);
    border: 3px dashed var(--ember);
}

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

.logoFrame {
    position: relative;
    display: inline-flex;
    max-width: 220px;
    overflow: hidden;
    line-height: 0;
    border: 3px solid var(--ember);
    background: white;
    animation: flag-sway 1.6s ease-in-out infinite;
}

.logoFrame::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    left: 0;
    width: 42%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
    animation: flag-sheen 1.5s linear infinite;
}

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

@keyframes flag-sway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(3deg); }
}

@keyframes flag-sheen {
    from { transform: translateX(-150%); }
    to { transform: translateX(320%); }
}

.platformName {
    font-family: var(--display);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

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

.inviteLabel {
    display: block;
    margin-bottom: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a4b32;
}

.inviteStamp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 54px;
    padding: 8px;
    background:
        radial-gradient(circle at 0 50%, transparent 7px, var(--straw) 8px) left / 16px 100% repeat-y,
        radial-gradient(circle at 100% 50%, transparent 7px, var(--straw) 8px) right / 16px 100% repeat-y,
        var(--paper);
    border-top: 2px dashed var(--ink);
    border-bottom: 2px dashed var(--ink);
}

.inviteCode {
    min-width: 0;
    padding-left: 10px;
    font-family: var(--display);
    font-size: 24px;
    letter-spacing: 0.04em;
    color: var(--ember);
    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: 3px solid var(--ink);
    cursor: pointer;
    font-weight: 700;
}

.copyBtn {
    flex-shrink: 0;
    height: 38px;
    padding: 0 12px;
    background: var(--corn);
    color: var(--ink);
    font-size: 14px;
}

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

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

.openLinkBtn {
    width: 100%;
    height: 52px;
    background: var(--ember);
    color: white;
    font-size: 16px;
    box-shadow: 4px 4px 0 var(--ink);
}

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

.luckyButton {
    width: 100%;
    margin-top: 10px;
    min-height: 50px;
    padding: 8px 12px;
    background: var(--denim);
    color: white;
    font-family: var(--display);
    font-size: 15px;
    font-weight: 400;
    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;
    gap: 8px;
    margin-bottom: 12px;
}

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

.cardTitle {
    font-family: var(--display);
    font-size: 26px;
    font-weight: 400;
}

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

.link-list__empty {
    padding: 8px 2px;
    color: #8a4b32;
    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-left: 8px solid var(--ember);
    box-shadow: 3px 3px 0 rgba(42, 22, 15, 0.12);
}

.link-item__thumb {
    width: 52px;
    height: 52px;
    overflow: hidden;
    background: #f3d7a4;
}

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

.link-item__thumb--placeholder {
    border: 1px dashed rgba(42, 22, 15, 0.35);
}

.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(--denim);
    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.7;
}

.link-item__url {
    min-width: 0;
    font-size: 12px;
    color: #8a4b32;
    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 14px;
    background: var(--ink);
    color: var(--corn);
    border: 2px solid var(--corn);
    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(42, 22, 15, 0.62);
    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(--ink);
    box-shadow: 8px 8px 0 var(--ember);
    animation: luckyIn 0.22s ease-out;
}

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

.modalClose {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 2px solid var(--ink);
    background: var(--corn);
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.modalBadge {
    display: inline-flex;
    padding: 5px 10px;
    background: var(--ember);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

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

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

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

.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-left: 6px solid var(--corn);
}

.infoLine span,
.luckScore span,
.modalCode small {
    color: #8a4b32;
    font-size: 12px;
    font-weight: 700;
}

.infoLine strong {
    font-size: 15px;
    font-weight: 700;
}

.linkLine a {
    color: var(--ember);
    font-size: 13px;
    font-weight: 700;
    word-break: break-all;
}

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

.modalCode {
    display: grid;
    gap: 7px;
    text-align: left;
    padding: 12px;
    border: 2px solid var(--ink);
    cursor: pointer;
    font: inherit;
}

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

.mysteryCopy {
    background: var(--corn);
    color: var(--ink);
}

.dailyCopy {
    background: var(--denim);
    color: white;
}

.dailyCopy small {
    color: rgba(255, 255, 255, 0.78);
}

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

.luckScore strong {
    font-family: var(--display);
    font-size: 26px;
    font-weight: 400;
    color: var(--ember);
}

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

.modalActions a,
.modalActions button {
    height: 44px;
    border: 2px solid var(--ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
}

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

#copyLuckyLink {
    background: var(--corn);
    color: var(--ink);
}

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

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