/* ==========================================================================
   GAMEVALLEY SHOP STYLES (Matches /css/style.css + Modern Web Guidance)
   ========================================================================== */

.shop-shell {
    width: 100%;
    max-width: 920px;
    position: relative;
    z-index: 2;
}

.shop-shell .mc-dialog-box,
.shop-shell .mc-tabs,
.shop-shell .mc-dialog-footer {
    max-width: 920px;
}

.shop-hero-sub {
    color: #ffff55;
    font-size: 13px;
    text-align: center;
    text-shadow: 2px 2px 0 #3f3f00;
    margin: -8px 0 16px 0;
    position: relative;
    z-index: 2;
}

/* Visually hidden accessible helper (per modern-web-guidance) */
.visually-hidden:where(:not(:focus-within, :active)) {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap !important;
}

/* Status Banner (Success / Cancel) */
.shop-banner {
    border: 2px solid #55ff55;
    background: rgba(16, 48, 24, 0.92);
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.8);
}

.shop-banner.is-warn {
    border-color: #eab308;
    background: rgba(52, 38, 8, 0.92);
}

.shop-banner-title {
    font-size: 15px;
    color: #55ff55;
    margin: 0 0 6px 0;
}

.shop-banner.is-warn .shop-banner-title {
    color: #fde047;
}

.shop-banner-text {
    font-family: 'Regular', sans-serif;
    font-size: 14px;
    color: #e5e7eb;
    line-height: 1.45;
    margin: 0;
}

/* Player Account Bar */
.player-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.player-label {
    display: block;
    font-size: 13px;
    color: #ffffff;
    margin-bottom: 2px;
}

.player-hint {
    display: block;
    font-family: 'Regular', sans-serif;
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 4px;
    line-height: 1.4;
}

.player-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-wrap: wrap;
}

.player-input {
    flex: 1 1 240px;
    font: inherit;
    font-size: max(1rem, 1em);
    min-height: 48px;
    padding: 10px 14px;
    background: #111318;
    color: #ffffff;
    border: 2px solid #767676;
    border-radius: 3px;
}

@media (pointer: coarse) {
    .player-input {
        min-height: 52px;
    }
}

.player-input:focus-visible,
.mc-btn:focus-visible,
.waiver-checkbox:focus-visible,
.legal-links a:focus-visible {
    outline: 3px solid #38bdf8;
    outline-offset: 2px;
}

/* Deferred validation (:user-invalid + fallback) */
.player-input:is(:user-invalid, .user-invalid-fallback) {
    border-color: #f87171;
    background-color: #2b1215;
}

.player-input:is(:user-valid, .user-valid-fallback) {
    border-color: #4ade80;
}

.field-error-msg {
    display: none;
    font-family: 'Regular', sans-serif;
    font-size: 13px;
    color: #fca5a5;
    margin-top: 4px;
    line-height: 1.4;
}

.player-input:is(:user-invalid, .user-invalid-fallback) ~ .field-error-msg,
.field-error-msg.is-server-error {
    display: block;
}

.player-verify-btn {
    width: auto;
    min-width: 190px;
    min-height: 48px;
    padding: 10px 18px;
}

/* Verified Player Card */
.verified-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(20, 28, 38, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 4px;
    padding: 12px 14px;
}

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

.verified-avatar {
    width: 44px;
    height: 44px;
    border: 2px solid #000000;
    border-radius: 3px;
    image-rendering: pixelated;
    background: #1f2937;
    flex-shrink: 0;
}

.verified-name {
    font-size: 15px;
    color: #55ff55;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.platform-pill {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 3px;
    background: #1e3a8a;
    color: #93c5fd;
    border: 1px solid #3b82f6;
}

.platform-pill.is-bedrock {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #10b981;
}

.verified-meta {
    font-family: 'Regular', sans-serif;
    font-size: 13px;
    color: #cbd5e1;
    margin-top: 3px;
}

.change-player-btn {
    width: auto;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 12px;
}

/* Product Grid & Cards */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 14px;
}

.shop-card {
    background: rgba(17, 20, 26, 0.95);
    border: 2px solid #3f4451;
    border-radius: 4px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.shop-card:hover {
    border-color: var(--card-accent, #ffff55);
}

.shop-card.is-owned {
    border-color: #22c55e;
    background: rgba(14, 31, 22, 0.92);
}

.card-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    min-height: 22px;
}

.card-badge {
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--card-accent, #ffff55);
    border: 1px solid var(--card-accent, #ffff55);
    letter-spacing: 0.4px;
}

.card-upgrade-pill {
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 3px;
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border: 1px solid #22c55e;
}

/* Pixel-art sprite showcase */
.sprite-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 68px;
    padding: 10px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.14) 0%, rgba(0, 0, 0, 0.55) 75%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sprite-icon {
    width: 44px;
    height: 44px;
    image-rendering: pixelated;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85));
}

.rank-crest {
    font-size: 20px;
    color: var(--card-accent, #ffff55);
    text-shadow: 2px 2px 0 #000000;
    letter-spacing: 1px;
}

.card-title {
    margin: 2px 0 0 0;
    font-size: 16px;
    color: var(--card-accent, #ffffff);
    text-shadow: 2px 2px 0 #000000;
}

.card-sub {
    margin: 0;
    font-family: 'Regular', sans-serif;
    font-size: 12.5px;
    color: #94a3b8;
}

.card-perks {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-perks li {
    font-family: 'Regular', sans-serif;
    font-size: 13px;
    color: #e2e8f0;
    line-height: 1.35;
    padding-left: 16px;
    position: relative;
}

.card-perks li::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--card-accent, #ffff55);
    font-family: 'Minecraft', sans-serif;
    font-size: 11px;
}

.card-bottom {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.price-main {
    font-size: 18px;
    color: #55ff55;
    text-shadow: 2px 2px 0 #000000;
}

.price-strike {
    font-family: 'Regular', sans-serif;
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
    margin-right: 6px;
}

.price-vat {
    font-family: 'Regular', sans-serif;
    font-size: 11.5px;
    color: #9ca3af;
}

.buy-btn {
    min-height: 48px;
    font-size: 14px;
}

.buy-btn.is-owned-btn {
    opacity: 0.75;
    cursor: default;
    color: #86efac;
    border-color: #22c55e;
}

/* Fairplay / Non-P2W Notice */
.fairplay-note {
    font-family: 'Regular', sans-serif;
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
    background: rgba(15, 23, 42, 0.75);
    border-left: 3px solid #38bdf8;
    padding: 10px 14px;
    border-radius: 3px;
    margin-bottom: 14px;
}

/* Native Modal Dialog (per modern-web-guidance: dialog, prevent-page-scroll-under-modal-dialog, light-dismiss) */
dialog#checkout-dialog {
    padding: 0;
    border: 2px solid #eab308;
    border-radius: 6px;
    background: #0f131a;
    color: #ffffff;
    width: min(92vw, 520px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.95);
}

dialog#checkout-dialog:modal {
    overscroll-behavior: contain;
}

dialog#checkout-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(3px);
    overflow: hidden;
    overscroll-behavior: contain;
}

dialog#checkout-dialog[open] .dialog-inner {
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.dialog-title {
    margin: 0;
    font-size: 17px;
    color: #ffff55;
    text-shadow: 2px 2px 0 #000000;
}

.dialog-close-icon {
    background: transparent;
    border: 1px solid #6b7280;
    color: #e5e7eb;
    border-radius: 3px;
    min-width: 38px;
    min-height: 38px;
    font-family: 'Minecraft', sans-serif;
    font-size: 14px;
    cursor: pointer;
}

.dialog-summary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    padding: 12px;
    font-family: 'Regular', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.dialog-summary strong {
    color: #ffffff;
}

.waiver-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.35);
    border-radius: 4px;
    padding: 12px;
}

.waiver-checkbox {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #22c55e;
    cursor: pointer;
}

.waiver-label {
    font-family: 'Regular', sans-serif;
    font-size: 13px;
    color: #e5e7eb;
    line-height: 1.45;
    cursor: pointer;
}

.waiver-row:has(.waiver-checkbox:is(:user-invalid, .user-invalid-fallback)) {
    border-color: #f87171;
    background: rgba(239, 68, 68, 0.14);
}

.dialog-error-box {
    display: none;
    font-family: 'Regular', sans-serif;
    font-size: 13px;
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.5);
    border: 1px solid #f87171;
    border-radius: 4px;
    padding: 10px 12px;
}

.dialog-error-box.is-visible {
    display: block;
}

.dialog-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pay-submit-btn {
    min-height: 50px;
    border-color: #22c55e;
    color: #ffffff;
}

/* Legal & Merchant Footer */
.shop-legal-box {
    margin-top: 8px;
    text-align: center;
    font-family: 'Regular', sans-serif;
    font-size: 12.5px;
    color: #9ca3af;
    line-height: 1.55;
}

.legal-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 6px;
}

.legal-links a {
    color: #cbd5e1;
    text-decoration: underline;
    padding: 6px 4px;
}

.legal-links a:hover {
    color: #ffff55;
}

@media (max-width: 640px) {
    .player-verify-btn {
        width: 100%;
    }
    .mc-tabs.tabs-3 {
        grid-template-columns: 1fr;
    }
}
