/* ============================================
   СПИРТОМАНИЯ — Card Game Styles
   ============================================ */

/* Hub / Start Screen */
.cards-hub {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.cards-title {
    font-family: 'Bebas Neue', 'Russo One', sans-serif;
    font-size: 3rem;
    color: #ff6600;
    text-shadow: 0 0 20px rgba(255, 102, 0, 0.6), 0 0 40px rgba(255, 0, 0, 0.3);
    margin-bottom: 8px;
    letter-spacing: 4px;
}

.cards-subtitle {
    font-family: 'Oswald', sans-serif;
    color: #aaa;
    font-size: 1rem;
    margin-bottom: 30px;
}

.cards-start-btn {
    background: linear-gradient(135deg, #ff6600, #ff0000);
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    letter-spacing: 3px;
    padding: 18px 50px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(255, 102, 0, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}
.cards-start-btn:active {
    transform: scale(0.95);
}

/* Password Gate */
.cards-password-wrap {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.cards-password-input {
    background: rgba(255,255,255,0.08);
    border: 2px solid #ff6600;
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    width: 220px;
    outline: none;
}
.cards-password-input:focus {
    border-color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}
.cards-password-error {
    color: #ff4444;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Timer Bar */
.cards-timer-bar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255,255,255,0.1);
    z-index: 200;
}
.cards-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6600, #ff0000);
    transition: width 1s linear;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.6);
}

/* Game Info Bar */
.cards-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0,0,0,0.6);
    border-bottom: 2px solid rgba(255, 102, 0, 0.3);
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    color: #ccc;
    flex-wrap: wrap;
    gap: 8px;
}
.cards-kings-count {
    color: #ffd700;
    font-weight: 700;
}
.cards-timer-text {
    color: #ff6600;
    font-weight: 700;
}
.cards-remaining {
    color: #aaa;
}

/* Card Area */
.cards-arena {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 60vh;
    position: relative;
}

/* Card dimensions — 2:3 aspect ratio */
.cards-deck {
    position: relative;
    width: 220px;
    height: 330px;
    cursor: pointer;
    perspective: 1000px;
}
@media (min-width: 600px) {
    .cards-deck {
        width: 260px;
        height: 390px;
    }
}

/* Stacked cards behind */
.cards-deck-shadow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}
.cards-deck-shadow:nth-child(1) {
    top: 4px; left: 4px; opacity: 0.3;
    background: url('../assets/images/card-back.jpg') center/cover no-repeat;
}
.cards-deck-shadow:nth-child(2) {
    top: 2px; left: 2px; opacity: 0.5;
    background: url('../assets/images/card-back.jpg') center/cover no-repeat;
}

/* The Flippable Card */
.card-flipper {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-flipper.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}

/* Card Back — Image only */
.card-back {
    background: url('../assets/images/card-back.jpg') center/cover no-repeat;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.card-back-tap {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    animation: tapPulse 2s ease-in-out infinite;
}
@keyframes tapPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Card Front — Normal: WHITE with black text */
.card-front {
    background: #ffffff;
    border: 2px solid #ddd;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    padding: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.card-suit-value {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    line-height: 1;
}
.card-suit-left { color: #222; }
.card-suit-right { color: #222; }
.card-suit-red .card-suit-left,
.card-suit-red .card-suit-right { color: #cc0000; }

.card-challenge {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-size: 1.05rem;
    color: #222;
    line-height: 1.4;
    padding: 8px 4px;
}
.card-challenge-king {
    color: #b8860b;
    font-weight: 700;
}

.card-value-label {
    text-align: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.85rem;
    color: #999;
    letter-spacing: 2px;
}

/* Card Front — Wrestler Special: Photo top 2/3, white bottom 1/3 */
.card-front-wrestler {
    background: #ffffff;
    border: 2px solid #ddd;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    overflow: hidden;
}

.card-wrestler-photo-area {
    flex: 2;
    background: #222;
    overflow: hidden;
    position: relative;
}
.card-wrestler-photo-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-wrestler-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a0500, #2a0a00);
    font-size: 3rem;
}

.card-wrestler-info {
    flex: 1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    text-align: center;
}
.card-wrestler-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.15rem;
    color: #222;
    letter-spacing: 2px;
    margin-bottom: 4px;
}
.card-wrestler-challenge {
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    color: #444;
    line-height: 1.3;
}
.card-wrestler-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.65rem;
    color: #b8860b;
    letter-spacing: 2px;
    margin-top: 2px;
}

/* Next Card Button */
.cards-next-btn {
    margin-top: 20px;
    background: linear-gradient(135deg, #ff6600, #ff0000);
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 3px;
    padding: 14px 40px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.4);
    transition: transform 0.2s;
    display: none;
}
.cards-next-btn:active {
    transform: scale(0.95);
}

/* Stop Button */
.cards-stop-btn {
    margin-top: 15px;
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    padding: 10px 25px;
    border: 1px solid rgba(255, 0, 0, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.cards-stop-btn:active {
    background: rgba(255, 0, 0, 0.4);
}

/* Viewer Mode */
.cards-viewer {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}
.cards-viewer-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    color: #ff6600;
    text-shadow: 0 0 15px rgba(255, 102, 0, 0.5);
    letter-spacing: 3px;
    margin-bottom: 8px;
    text-align: center;
}
.cards-viewer-subtitle {
    font-family: 'Oswald', sans-serif;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
}
.cards-viewer-card {
    width: 240px;
    margin: 10px auto;
}
@media (min-width: 600px) {
    .cards-viewer-card {
        width: 280px;
    }
}
.cards-waiting {
    color: #666;
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    text-align: center;
    margin-top: 40px;
    animation: tapPulse 2s ease-in-out infinite;
}

/* Sound unlock badge for viewers (iOS audio policy) */
.cards-sound-unlock {
    background: rgba(255, 102, 0, 0.2);
    border: 2px solid rgba(255, 102, 0, 0.5);
    color: #ff6600;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 2px;
    padding: 12px 30px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 10px;
    animation: tapPulse 2s ease-in-out infinite;
    text-align: center;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

/* Viewer Card Display — completely separate from flip styles */
.viewer-card-display {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    animation: viewerCardAppear 0.5s ease-out;
}
.viewer-card-normal {
    background: #ffffff;
    border: 2px solid #ddd;
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.viewer-card-wrestler {
    background: #ffffff;
    border: 2px solid #ddd;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
@keyframes viewerCardAppear {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* End Screen */
.cards-end {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}
.cards-end-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    letter-spacing: 4px;
    margin-bottom: 12px;
}
.cards-end-subtitle {
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    color: #ff6600;
    margin-bottom: 30px;
}
.cards-end-king4 {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: king4Pulse 1s ease-in-out infinite;
}
@keyframes king4Pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Card fly-out animation */
.card-fly-out {
    animation: cardFlyOut 0.5s ease-in forwards;
}
@keyframes cardFlyOut {
    0% { transform: translateX(0) rotate(0); opacity: 1; }
    100% { transform: translateX(-120vw) rotate(-30deg); opacity: 0; }
}
