/* FRAGFEED — custom styles (uzupełnia Tailwind CDN) */

:root {
    color-scheme: dark;
    --font-body: 'Bai Jamjuree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Chakra Petch', 'Bai Jamjuree', sans-serif;
}

html, body {
    background: #0B0D10;
    color: #E6E8EB;
    font-family: var(--font-body);
    font-feature-settings: "ss01", "ss02";
}

/* Display font dla nagłówków, przycisków i licznika */
h1, h2, h3, h4, h5,
.font-display,
.font-black,
.font-bold,
button,
.btn,
.btn-primary,
.btn-ghost,
.chip,
.tabular-nums {
    font-family: var(--font-display);
}

/* Cyfry tabularne dla wszystkiego co ma cyfry */
.tabular-nums {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.clip-cs {
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.clip-cs-sm {
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.scanlines {
    background-image: linear-gradient(to bottom, transparent 50%, rgba(255, 255, 255, 0.02) 50%);
    background-size: 100% 4px;
}

.reel-snap { scroll-snap-type: y mandatory; }
.reel-snap > * { scroll-snap-align: start; scroll-snap-stop: always; }

.bg-grid {
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* Reusable component classes — używamy Tailwind CDN, więc CSS pełen */
.btn,
.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    transition: all 0.15s ease;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    cursor: pointer;
    border: none;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    font-family: 'Chakra Petch', 'Bai Jamjuree', sans-serif;
}
.btn-primary {
    background-color: #F2A900;
    color: black;
}
.btn-primary:hover { background-color: #FF6A13; color: white; }
.btn-ghost {
    background-color: #13161B;
    color: white;
    border: 1px solid #262B33;
}
.btn-ghost:hover { background-color: #1B1F26; border-color: #F2A900; }
.panel {
    background-color: #13161B;
    border: 1px solid #262B33;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #1B1F26;
    color: #8A93A0;
    border: 1px solid #262B33;
}

/* Wordle tile states */
.tile {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    font-weight: 900;
    border: 2px solid #262B33;
    color: white;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    text-transform: uppercase;
    transition: transform 0.2s;
}
@media (min-width: 768px) {
    .tile { width: 64px; height: 64px; font-size: 1.75rem; }
}
.tile-correct { background-color: #F2A900; color: black; border-color: #F2A900; }
.tile-present { background-color: #E7B53C; color: black; border-color: #E7B53C; }
.tile-absent { background-color: #1B1F26; color: #8A93A0; border-color: #262B33; }
.tile-current { border-color: #8A93A0; transform: scale(1.05); }

.kbd {
    height: 48px;
    padding: 0 12px;
    min-width: 32px;
    font-weight: 800;
    text-transform: uppercase;
    background-color: #13161B;
    color: white;
    border: 2px solid #262B33;
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    font-size: 0.875rem;
    transition: background-color 0.15s;
}
.kbd:hover { background-color: #1B1F26; }
.kbd-correct { background-color: #F2A900; color: black; border-color: #F2A900; }
.kbd-present { background-color: #E7B53C; color: black; border-color: #E7B53C; }
.kbd-absent { background-color: #1B1F26; color: #8A93A0; border-color: #262B33; }
.kbd-action { min-width: 58px; font-size: 0.75rem; }

.shake { animation: shake 0.4s ease-in-out; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Tooltip */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #13161B;
    border: 1px solid #262B33;
    padding: 8px 16px;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    font-weight: 700;
    font-size: 14px;
    z-index: 50;
}

/* Line-clamp util (jeśli Tailwind plugin niedostępny) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Real CS2 skin image (Steam CDN) */
.skin-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}
.skin-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
    transition: transform 0.3s ease;
}
.skin-card:hover .skin-img img,
.inv-card:hover .skin-img img {
    transform: scale(1.05) rotate(-2deg);
}

/* ===================================================================
   CUSTOM SELECT — wszystkie native <select> dostają fajne tło, strzałkę
   i hover state, bez wybebeszania struktury HTML.
   =================================================================== */
select, .field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23F2A900' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px !important;
    cursor: pointer;
    border-radius: 0;
    font-family: 'Chakra Petch', 'Bai Jamjuree', sans-serif;
    font-weight: 600;
    transition: all 0.15s;
}
select:hover {
    background-color: rgba(242, 169, 0, 0.04);
}
select:focus {
    outline: none;
    background-color: rgba(242, 169, 0, 0.06);
}
select option {
    background: #13161B;
    color: white;
    font-weight: 600;
    padding: 8px 12px;
}

/* ===================================================================
   VOLUME SLIDER POPOVER (per-reel mute button)
   =================================================================== */
.volume-control {
    position: relative;
    display: inline-flex;
}
.volume-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(11, 13, 16, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 14px 10px;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.18s, visibility 0.18s, transform 0.18s;
    z-index: 20;
    pointer-events: none;
    min-width: 68px;
}
.volume-control:hover .volume-popover,
.volume-popover.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
/* CUSTOM VERTICAL slider — prosty i czysty */
.vol-popover-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.vol-track {
    position: relative;
    width: 6px;
    height: 130px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.vol-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--vol, 0%);
    background: #F2A900;
    border-radius: 3px;
    transition: height 0.1s ease;
    pointer-events: none;
}
.vol-thumb {
    position: absolute;
    bottom: var(--vol, 0%);
    left: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-bottom: -7px;
    background: #F2A900;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    cursor: grab;
    pointer-events: none;
    transition: transform 0.15s, bottom 0.1s ease;
}
.vol-track:hover .vol-thumb { transform: scale(1.2); }
.vol-track.dragging .vol-thumb { cursor: grabbing; transform: scale(1.3); transition: transform 0.1s, bottom 0s; }
.vol-track.dragging .vol-fill { transition: none; }
.volume-value {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 800;
    font-size: 11px;
    color: #F2A900;
    text-align: center;
    font-variant-numeric: tabular-nums;
    min-width: 32px;
}

/* ===================================================================
   SHARE MODAL — globalny, jeden dla wszystkich klipów
   =================================================================== */
.share-modal {
    position: fixed;
    inset: 0;
    background: rgba(11, 13, 16, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
    animation: share-fade-in 0.2s ease-out;
}
.share-modal.is-open { display: flex; }
@keyframes share-fade-in { from { opacity: 0; } to { opacity: 1; } }

.share-content {
    width: 100%;
    max-width: 480px;
    background: #13161B;
    border: 1px solid #262B33;
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
    padding: 24px;
    animation: share-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes share-slide-up {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.share-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
}
.share-header-text { flex: 1; min-width: 0; }
.share-eyebrow {
    font-size: 10px;
    color: #F2A900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 800;
}
.share-title {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 900;
    font-size: 22px;
    margin-top: 4px;
    line-height: 1.2;
}
.share-subtitle {
    font-size: 12px;
    color: #8A93A0;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.share-close {
    width: 32px;
    height: 32px;
    background: #1B1F26;
    border: 1px solid #262B33;
    color: white;
    cursor: pointer;
    display: grid;
    place-items: center;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    transition: background 0.15s;
}
.share-close:hover { background: #262B33; }

.share-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 480px) {
    .share-grid { grid-template-columns: repeat(3, 1fr); }
}
.share-target {
    background: #1B1F26;
    border: 1px solid #262B33;
    padding: 14px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: white;
    text-decoration: none;
    transition: all 0.15s;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}
.share-target:hover {
    transform: translateY(-2px);
    border-color: rgba(242, 169, 0, 0.4);
    background: #262B33;
}
.share-target-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    transition: transform 0.18s;
}
.share-target:hover .share-target-icon { transform: scale(1.08); }
.share-target-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.share-target.facebook .share-target-icon { background: #1877F2; }
.share-target.twitter .share-target-icon  { background: #000; }
.share-target.whatsapp .share-target-icon { background: #25D366; }
.share-target.telegram .share-target-icon { background: #229ED9; }
.share-target.reddit .share-target-icon   { background: #FF4500; }
.share-target.discord .share-target-icon  { background: #5865F2; }
.share-target.instagram .share-target-icon { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.share-target.copy .share-target-icon     { background: #F2A900; color: black; }
.share-target.native .share-target-icon   { background: #1B1F26; border: 1px solid #262B33; }

.share-link-row {
    display: flex;
    margin-top: 16px;
    gap: 0;
    border: 1px solid #262B33;
    background: #1B1F26;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    overflow: hidden;
}
.share-link-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: 'Bai Jamjuree', sans-serif;
    font-size: 12px;
    padding: 10px 12px;
    outline: none;
    min-width: 0;
}
.share-link-copy {
    background: #F2A900;
    color: black;
    border: none;
    padding: 0 16px;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.share-link-copy:hover { background: #FF6A13; color: white; }
.share-link-copy.copied { background: #3CD2A5; color: black; }

/* Standalone select component — używaj klasy .cs-select */
.cs-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #13161B;
    border: 1px solid #262B33;
    color: white;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 32px 9px 14px;
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    transition: all 0.15s;
    min-width: 120px;
}
.cs-select:hover {
    border-color: rgba(242, 169, 0, 0.5);
}
.cs-select:focus {
    outline: 2px solid rgba(242, 169, 0, 0.5);
    outline-offset: 2px;
}
