/* style.css for Desen Eşleme */

:root {
    --color-blue-start: #60a5fa;
    --color-blue-end: #2563eb;
    --shadow-blue: rgba(37, 99, 235, 0.4);

    --color-red-start: #f87171;
    --color-red-end: #ef4444;
    --shadow-red: rgba(239, 68, 68, 0.4);

    --color-green-start: #34d399;
    --color-green-end: #10b981;
    --shadow-green: rgba(16, 185, 129, 0.4);

    --color-yellow-start: #fbbf24;
    --color-yellow-end: #f59e0b;
    --shadow-yellow: rgba(245, 158, 11, 0.4);

    --color-purple-start: #a78bfa;
    --color-purple-end: #8b5cf6;
    --shadow-purple: rgba(139, 92, 246, 0.4);
}

/* Grids Layout */
.grids-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 2.5rem;
    margin: 2.5rem 0;
}

.grid-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 1.8rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04), 
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 380px;
}

.grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.card-header {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.target-card .card-header i {
    color: var(--secondary-color);
}

.player-card .card-header i {
    color: var(--primary-color);
}

.grid-border-wrapper {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 20px;
    border: 1px dashed #cbd5e1;
}

/* Grid Sizes */
.player-grid {
    display: grid;
    grid-template-columns: repeat(3, 85px);
    grid-template-rows: repeat(3, 85px);
    gap: 12px;
}

.target-grid {
    display: grid;
    grid-template-columns: repeat(3, 65px);
    grid-template-rows: repeat(3, 65px);
    gap: 10px;
}

/* Tiles Styling */
.tile {
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Player Tile Interactive Styles */
.player-grid .tile {
    cursor: pointer;
}

.player-grid .tile:hover {
    transform: translateY(-3px) scale(1.03);
}

.player-grid .tile:active {
    transform: translateY(1px) scale(0.97);
}

.target-grid .tile {
    pointer-events: none; /* Hedef desen tıklanamaz */
    border-radius: 12px;
}

/* Icon configurations inside tiles */
.tile i {
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    transition: all 0.25s ease;
}

.player-grid .tile i {
    font-size: 1.8rem;
}

.target-grid .tile i {
    font-size: 1.3rem;
}

/* Color Palette classes */
.color-0 {
    background: linear-gradient(135deg, var(--color-blue-start), var(--color-blue-end));
    box-shadow: 0 6px 15px var(--shadow-blue);
}

.color-1 {
    background: linear-gradient(135deg, var(--color-red-start), var(--color-red-end));
    box-shadow: 0 6px 15px var(--shadow-red);
}

.color-2 {
    background: linear-gradient(135deg, var(--color-green-start), var(--color-green-end));
    box-shadow: 0 6px 15px var(--shadow-green);
}

.color-3 {
    background: linear-gradient(135deg, var(--color-yellow-start), var(--color-yellow-end));
    box-shadow: 0 6px 15px var(--shadow-yellow);
}

.color-4 {
    background: linear-gradient(135deg, var(--color-purple-start), var(--color-purple-end));
    box-shadow: 0 6px 15px var(--shadow-purple);
}

/* Control Segmented Controls */
.control-groups {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.segmented-control {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.segment-btn {
    background: none;
    border: none;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

.segment-btn.active {
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.segment-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin: 0 auto 2rem auto;
    background: #f8fafc;
    padding: 1.2rem 2.5rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    max-width: 650px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-label i {
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-action {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 12px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-action:hover:not(:disabled) {
    background: #f8fafc;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.1);
}

.btn-action:active:not(:disabled) {
    transform: translateY(0);
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #e2e8f0;
    color: #94a3b8;
}

#btn-new-game {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

/* Hint Pulsing Glow */
@keyframes hintPulse {
    0% {
        box-shadow: 0 0 0 0px rgba(16, 185, 129, 0.8), 0 6px 15px rgba(0, 0, 0, 0.05);
        border-color: rgba(16, 185, 129, 1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0), 0 6px 15px rgba(0, 0, 0, 0.05);
        border-color: rgba(16, 185, 129, 1);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0px rgba(16, 185, 129, 0), 0 6px 15px rgba(0, 0, 0, 0.05);
        border-color: rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
}

.hint-pulse {
    animation: hintPulse 1.2s infinite ease-in-out;
    z-index: 5;
    border: 3px solid #10b981 !important;
}

/* Info Button */
.btn-info {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 8px;
}

.btn-info:hover {
    background: rgba(139, 92, 246, 0.05);
    color: var(--secondary-color);
}

/* Result Box Styling */
.result-box {
    text-align: center;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    animation: slideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-width: 550px;
    margin: 2rem auto;
}

.result-box h2 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.result-box p {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 2rem;
}

/* Result Stats */
.result-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.r-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem 1.8rem;
    flex: 1;
    max-width: 130px;
}

.r-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
}

.r-lbl {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

/* Stars Container */
.stars-container {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1.8rem;
}

.star {
    font-size: 2rem;
    color: #e2e8f0;
    transition: color 0.3s ease;
    transform: scale(0);
    animation: popInStar 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.star.active {
    color: #fbbf24;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

@keyframes popInStar {
    to {
        transform: scale(1);
    }
}

/* Modal Scroll & Rules */
.modal-content-scroll {
    max-height: 50vh;
    overflow-y: auto;
    text-align: left;
    padding-right: 10px;
    margin: 1.5rem 0;
}

.modal-content-scroll::-webkit-scrollbar {
    width: 6px;
}

.modal-content-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.modal-content-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.modal-content-scroll p {
    color: #475569 !important;
    font-size: 1rem !important;
    line-height: 1.6;
}

.rules-section {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid #f1f5f9;
}

.rules-section:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.rules-section h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rules-section p {
    font-size: 0.95rem !important;
    color: #475569 !important;
    margin: 0 0 0.5rem 0;
}

.rules-section ul {
    padding-left: 1.2rem;
    margin: 0.3rem 0 0 0;
}

.rules-section li {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

/* SVG Checkmark Keyframe Animations */
.checkmark-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 4;
    stroke: #10b981;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s alternate;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 4;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: #ffffff;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 40px #10b981;
    }
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsiveness */
@media (max-width: 768px) {
    .grids-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .grid-card {
        width: 100%;
        max-width: 320px;
        padding: 1.2rem;
    }

    .player-grid {
        grid-template-columns: repeat(3, 75px);
        grid-template-rows: repeat(3, 75px);
        gap: 10px;
    }

    .target-grid {
        grid-template-columns: repeat(3, 55px);
        grid-template-rows: repeat(3, 55px);
        gap: 8px;
    }

    .player-grid .tile i {
        font-size: 1.5rem;
    }

    .target-grid .tile i {
        font-size: 1.1rem;
    }

    .stats-bar {
        gap: 1rem;
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .action-buttons {
        gap: 0.6rem;
    }

    .btn-action {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}
