/* Çiftini Bul Oyunu - CSS Stilleri - Mobil First */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header {
    text-align: center;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

header h1 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    gap: 5px;
}

.timer, .score {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    padding: 4px 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    flex: 1;
    text-align: center;
}

.game-controls {
    text-align: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

.start-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.start-btn:hover {
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.reset-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.reset-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.game-board {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 2px;
    flex: 1;
    justify-items: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    min-height: 0;
    aspect-ratio: 6/7;
}

.instructions {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    width: 100%;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.instructions p {
    margin: 5px 0;
    line-height: 1.4;
}

.card {
    width: 100%;
    height: 100%;
    max-width: 50px;
    max-height: 50px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
}

.card:not(.flipped):not(.matched):hover {
    transform: scale(1.05);
}

.card-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    border-radius: 6px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-front {
    background: white;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    border-radius: 6px;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.card.flipped .card-back {
    display: none;
}

.card.flipped .card-front {
    display: flex;
    animation: cardFlipIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardFlipIn {
    0% { 
        transform: rotateY(180deg) scale(0.8);
        opacity: 0;
    }
    100% { 
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

.card.matched {
    animation: matchAnimation 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

.card.matched img {
    animation: imageGrow 0.8s ease-in-out;
}

@keyframes matchAnimation {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: scale(1.15) rotate(3deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.1) rotate(-2deg);
        opacity: 1;
    }
    75% {
        transform: scale(1.2) rotate(1deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes imageGrow {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.2);
        filter: brightness(1.2) saturate(1.3);
    }
    100% {
        transform: scale(1);
        filter: brightness(1.1);
    }
}

.card.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.game-stats {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px;
    border-radius: 10px;
    margin-bottom: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.matches {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    padding: 4px 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    display: inline-block;
}

.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.celebration.show {
    display: flex;
}

.celebration-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: celebrationPop 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 90vw;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes celebrationPop {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.celebration-content h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #4CAF50;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.celebration-content p {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #666;
    font-weight: 500;
}

.celebration-buttons {
    margin-top: 15px;
}

.success-effect {
    animation: successFloat 1.2s ease-out forwards;
}

@keyframes successFloat {
    0% {
        transform: translateY(0) scale(0);
        opacity: 1;
    }
    50% {
        transform: translateY(-25px) scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-50px) scale(1.8);
        opacity: 0;
    }
}

/* Küçük telefonlar (320px-480px) */
@media (max-width: 480px) {
    body {
        padding: 3px;
    }
    
    .container {
        padding: 5px;
    }
    
    header {
        padding: 8px;
        margin-bottom: 5px;
    }
    
    header h1 {
        font-size: 1rem;
        margin-bottom: 3px;
    }
    
    .timer, .score {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.7rem;
        margin: 0 3px;
    }
    
    .game-board {
        padding: 3px;
        gap: 1px;
    }
    
    .card {
        max-width: 40px;
        max-height: 40px;
    }
    
    .card-back {
        font-size: 1rem;
    }
    
    .game-stats {
        padding: 4px;
    }
    
    .matches {
        font-size: 0.8rem;
        padding: 3px 6px;
    }
    
    .celebration-content {
        padding: 15px;
        margin: 10px;
    }
    
    .celebration-content h2 {
        font-size: 1.3rem;
    }
    
    .celebration-content p {
        font-size: 0.9rem;
    }
}

/* Orta boy telefonlar (481px-768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .card {
        max-width: 55px;
        max-height: 55px;
    }
    
    .card-back {
        font-size: 1.3rem;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* Tabletler (769px-1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .game-board {
        grid-template-columns: repeat(7, 1fr);
        grid-template-rows: repeat(6, 1fr);
        aspect-ratio: 7/6;
    }
    
    .card {
        max-width: 60px;
        max-height: 60px;
    }
    
    .card-back {
        font-size: 1.4rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Desktop (1025px+) */
@media (min-width: 1025px) {
    .game-board {
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(6, 1fr);
        aspect-ratio: 8/6;
    }
    
    .card {
        max-width: 70px;
        max-height: 70px;
    }
    
    .card-back {
        font-size: 1.6rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .container {
        max-width: 1000px;
    }
}

/* Yatay ekranlar için */
@media (orientation: landscape) and (max-height: 500px) {
    .game-board {
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(5, 1fr);
        aspect-ratio: 8/5;
    }
    
    .card {
        max-width: 35px;
        max-height: 35px;
    }
    
    .card-back {
        font-size: 0.9rem;
    }
    
    header {
        padding: 5px;
        margin-bottom: 3px;
    }
    
    header h1 {
        font-size: 0.9rem;
        margin-bottom: 2px;
    }
    
    .btn {
        padding: 4px 8px;
        font-size: 0.6rem;
    }
}
