/* uno.css */

/* Прибираємо системну сіру/блакитну "підсвітку тапу" на мобільних — інакше
   при натисканні на колоду чи карту з'являється стороннє виділення. */
#screen-game *, #screen-game *:focus, #screen-game *:active {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    outline: none;
}

.uno-card {
    width: 100px;
    height: 150px;
    border-radius: 12px;
    border: 4px solid white;
    background-color: white; /* fallback */
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    flex-shrink: 0;
}

/* Base Colors */
.uno-card.red { background-color: #ef4444; }
.uno-card.blue { background-color: #3b82f6; }
.uno-card.green { background-color: #10b981; }
.uno-card.yellow { background-color: #eab308; }
.uno-card.black { background-color: #1e293b; }

.uno-card.back {
    background-color: #ef4444;
    border: 4px solid white;
}

.uno-card .inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    width: 80%;
    height: 60%;
    background: white;
    border-radius: 50% 50% / 60% 60%; /* Oval */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 3px rgba(0,0,0,0.1);
}

.uno-card.back .inner {
    background: #ef4444;
    border: 2px solid white;
    box-shadow: none;
    color: white;
    font-weight: 900;
    font-size: 24px;
    font-style: italic;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

/* The big number/symbol in center */
.uno-card .center-val {
    font-size: 42px;
    font-weight: 900;
    color: inherit; /* will be set inline based on color */
    transform: rotate(15deg); /* Counter the oval rotation */
    text-shadow: 2px 2px 0px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.uno-card.black .center-val {
    /* Multi-color for wild cards */
    background: linear-gradient(135deg, #ef4444 25%, #eab308 25%, #eab308 50%, #10b981 50%, #10b981 75%, #3b82f6 75%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    font-size: 24px;
}

/* Small numbers in corners */
.uno-card .corner {
    position: absolute;
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.uno-card .corner.top-left {
    top: 6px;
    left: 8px;
}

.uno-card .corner.bottom-right {
    bottom: 6px;
    right: 8px;
    transform: rotate(180deg);
}

/* Hover-ефекти тільки на десктопі — на тач-екранах :hover "залипає" після тапу
   і дає несподівані стрибки. */
@media (hover: hover) and (pointer: fine) {
    #my-hand .uno-card:hover {
        transform: translateY(-20px) scale(1.1);
        z-index: 50;
        box-shadow: 0 10px 25px rgba(0,0,0,0.5);
        cursor: pointer;
    }
}

/* Колода: візуально неактивна коли не мій хід (бо клік нічого не робить) */
#deck-pile.deck-disabled {
    opacity: 0.55;
    filter: saturate(0.6);
    cursor: not-allowed;
}
#deck-pile.deck-disabled .uno-card.back {
    pointer-events: none;
}

/* Scale for opponents (smaller) */
.uno-card-mini {
    width: 40px;
    height: 60px;
    border-radius: 4px;
    border: 2px solid white;
    background-color: #ef4444;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.uno-card-mini .inner {
    border-radius: 50% 50% / 60% 60%;
    border: 1px solid white;
    width: 80%; height: 60%;
    display: flex; align-items: center; justify-content: center;
}
.uno-card-mini .inner span {
    font-size: 10px; font-weight: bold; font-style: italic; color: white; transform: rotate(15deg);
}

/* Animations
   Анімації спрацьовують тільки коли реально щось змінилось — клас додається з JS,
   а не вішається на кожен ререндер CSS-селектором. */
@keyframes playCard {
    0%   { transform: translateY(120px) scale(0.85) rotate(-6deg); opacity: 0.3; }
    60%  { transform: translateY(-6px)  scale(1.05) rotate( 2deg); opacity: 1;   }
    100% { transform: translateY(0)     scale(1)    rotate(0deg);  opacity: 1;   }
}
#discard-pile .uno-card.card-just-played {
    animation: playCard 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Нові карти в руці (з колоди → у руку) анімуються через element.animate() з JS:
   це дає плавний політ з конкретної позиції колоди до місця карти в руці. */

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    height: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2); 
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3); 
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5); 
}

/* Hide scrollbar completely but keep functionality */
.hide-scroll::-webkit-scrollbar {
    display: none;
}
.hide-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobile responsive scaling */
@media (max-width: 640px) {
    .uno-card {
        width: 62px;
        height: 93px;
        border-width: 3px;
        border-radius: 8px;
    }
    .uno-card.back { border-width: 3px; }
    .uno-card .inner { border-width: 2px; }
    .uno-card.back .inner { font-size: 16px; border-width: 2px; }
    .uno-card .center-val { font-size: 32px; }
    .uno-card.black .center-val { font-size: 18px; }
    .uno-card .corner { font-size: 12px; top: 3px; left: 4px; }
    .uno-card .corner.bottom-right { bottom: 3px; right: 4px; }

}
