:root {
    --bg-color: #f0f8ff;
    --primary-color: #6c5ce7;
    --accept-color: #2ed573;
    --reject-color: #ff4757;
    --card-bg: #ffffff;
    --text-color: #2d3436;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 15px;
    overflow-x: hidden;
}

header {
    text-align: center;
    margin-bottom: 10px;
}

h1 {
    color: #2d3436;
    font-size: 2.2rem;
    text-shadow: 2px 2px 0px rgba(255,255,255,0.8);
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.1rem;
    color: #4b6584;
    font-weight: 600;
}

/* Skor ve İlerleme Alanı */
.status-bar {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.85);
    padding: 8px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3436;
}

.progress-bar-container {
    width: 120px;
    height: 14px;
    background: #dfe6e9;
    border-radius: 10px;
    overflow: hidden;
    align-self: center;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00b894, #00cec9);
    transition: width 0.3s ease;
}

/* Ana Oyun Alanı */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
    gap: 15px;
}

/* Üst Karakter Alanı */
.character-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    min-height: 110px;
    width: 100%;
    max-width: 600px;
    border: 3px solid #fff;
}

.avatar {
    font-size: 3.5rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.dialog-bubble {
    background: #f1f2f6;
    padding: 10px 15px;
    border-radius: 15px;
    position: relative;
    font-size: 1.05rem;
    color: #2f3542;
    font-weight: 600;
    flex-grow: 1;
    border: 2px solid #dfe4ea;
}

.dialog-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 10px 8px 0;
    border-style: solid;
    border-color: transparent #dfe4ea transparent transparent;
}

/* Kart ve Sepetler Alanı */
.play-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 15px;
    margin-top: 5px;
    position: relative;
}

/* Sepetler (Kutular) - Kart İçine Girecek Katmanlar */
.zone {
    flex: 1;
    min-height: 230px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border: 4px dashed transparent;
    z-index: 10; /* Kutunun gövdesi öndedir */
    overflow: visible;
}

.zone-accept {
    background: rgba(46, 213, 115, 0.9);
    border-color: #2ed573;
    color: #ffffff;
}

.zone-reject {
    background: rgba(255, 71, 87, 0.9);
    border-color: #ff4757;
    color: #ffffff;
}

.zone.drag-over {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.95);
}

.zone-icon {
    font-size: 3.8rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    pointer-events: none;
    position: relative;
    z-index: 12;
}

.zone-title {
    font-size: 1.3rem;
    font-weight: 700;
    pointer-events: none;
    position: relative;
    z-index: 12;
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.zone-desc {
    font-size: 0.85rem;
    margin-top: 4px;
    opacity: 0.95;
    font-weight: 600;
    pointer-events: none;
    position: relative;
    z-index: 12;
    color: #ffffff;
}

/* Taşınabilir Kart Alanı */
.card-container {
    flex: 1.2;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 240px;
    perspective: 1000px;
    position: relative;
    z-index: 5;
}

.card {
    background: #ffffff;
    width: 100%;
    max-width: 280px;
    min-height: 200px;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    cursor: grab;
    touch-action: none;
    transition: transform 0.1s ease, box-shadow 0.2s ease, opacity 0.3s ease;
    border: 4px solid #fff;
    position: relative;
    z-index: 20; /* Sürüklenirken en üstte */
}

.card:active {
    cursor: grabbing;
}

.card-emoji {
    font-size: 3.2rem;
    margin-bottom: 12px;
}

.card-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2d3436;
    line-height: 1.4;
}

.card-hint {
    font-size: 0.8rem;
    color: #b2bec3;
    margin-top: 10px;
    font-weight: 600;
}

/* Kutunun İçine Giren Kart Sınıfı */
.card.inside-zone {
    z-index: 1 !important; /* Kutunun tam arkasına geçer */
    opacity: 0.6;
    box-shadow: none;
}

/* Animasyon Efektleri */
.correct-anim {
    animation: bounce 0.5s ease;
}

.wrong-anim {
    animation: shake 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(0.75); }
    50% { transform: scale(0.82); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

/* Tamamlanma Ekranı Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 25px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 2rem;
    color: #6c5ce7;
    margin-bottom: 10px;
}

.modal-text {
    font-size: 1.1rem;
    color: #636e72;
    margin-bottom: 20px;
    line-height: 1.5;
}

.restart-btn {
    background: #6c5ce7;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
    transition: transform 0.2s, background 0.2s;
}

.restart-btn:hover {
    background: #5b4bc4;
    transform: scale(1.05);
}

/* Mobil Uyum */
@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    .play-area { flex-direction: column; gap: 10px; }
    .card-container { order: 1; width: 100%; min-height: 180px; }
    .zone-accept { order: 2; width: 100%; min-height: 110px; flex-direction: row; gap: 15px; }
    .zone-reject { order: 3; width: 100%; min-height: 110px; flex-direction: row; gap: 15px; }
    .zone-icon { font-size: 2.5rem; margin-bottom: 0; }
    .zone-title { font-size: 1.1rem; }
    .character-box { min-height: 90px; padding: 10px 15px; }
    .avatar { font-size: 2.8rem; }
    .dialog-bubble { font-size: 0.95rem; }
}

/* Site integration: semantic controls, lifecycle states and original desktop flow. */
html { min-height: 100%; }
body { min-height: 0; }
.zone-title, .zone-desc { display: block; }
button { font: inherit; -webkit-appearance: none; appearance: none; }
.zone { cursor: pointer; }
.zone:focus-visible, .card:focus-visible, .restart-btn:focus-visible { outline: 3px solid #2d3436; outline-offset: 4px; }
.zone:disabled { cursor: default; opacity: 1; }
.zone.drag-over .zone-title, .zone.drag-over .zone-desc { color: #2d3436; text-shadow: none; }
.card-container.is-dragging { z-index: 30; }
.card.is-processing { cursor: default; }
.dialog-feedback-correct { border-color: #00b894; }
.dialog-feedback-wrong { border-color: #d63031; }
.modal-overlay[hidden] { display: none; }
.modal-overlay { padding: 15px; overflow-y: auto; }
.modal-overlay.active .modal-content { animation: celebrate .45s ease; }
@keyframes celebrate { from { transform: scale(.8); } to { transform: scale(1); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Phones keep the current card and both drop targets together. */
@media (max-width: 768px) {
 body { padding: 12px; }
 header { margin-bottom: 9px; }
 h1 { font-size: 1.5rem; }
 .subtitle { font-size: .85rem; line-height: 1.35; }
 .status-bar { gap: 12px; padding: 8px 13px; font-size: .95rem; margin-bottom: 10px; }
 .progress-bar-container { width: 75px; height: 11px; }
 .game-container { gap: 10px; }
 .character-box { min-height: 102px; padding: 9px 10px; gap: 9px; }
 .avatar { font-size: 2.1rem; }
 .dialog-bubble { font-size: .88rem; line-height: 1.35; padding: 8px 9px; }
 .play-area { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; margin-top: 0; }
 .card-container { grid-column: 1 / -1; order: 0; min-height: 170px; }
 .card { min-height: 160px; max-width: 310px; padding: 12px; }
 .card-emoji { font-size: 2.2rem; margin-bottom: 7px; }
 .card-text { font-size: 1rem; line-height: 1.35; }
 .card-hint { font-size: .72rem; margin-top: 7px; color: #63727a; }
 .zone-accept, .zone-reject { order: 1; min-width: 0; min-height: 130px; flex-direction: column; padding: 10px 7px; gap: 5px; border-width: 3px; border-radius: 19px; }
 .zone-icon { font-size: 2rem; }
 .zone-title { font-size: 1rem; line-height: 1.15; }
 .zone-desc { font-size: .73rem; line-height: 1.3; }
 .modal-content { padding: 24px 18px; }
}
@media (max-width: 768px) and (max-height: 570px) {
 body { padding: 8px; }
 header { margin-bottom: 6px; }
 h1 { font-size: 1.35rem; }
 .subtitle { font-size: .78rem; }
 .status-bar { margin-bottom: 8px; padding: 6px 12px; font-size: .88rem; }
 .game-container { gap: 8px; }
 .character-box { min-height: 100px; }
 .dialog-bubble { font-size: .82rem; }
 .card-container { min-height: 152px; }
 .card { min-height: 144px; padding: 10px; }
 .card-text { font-size: .94rem; }
 .card-emoji { font-size: 1.8rem; margin-bottom: 5px; }
 .zone-accept, .zone-reject { min-height: 110px; padding: 8px 5px; }
 .zone-icon { font-size: 1.5rem; }
 .zone-title { font-size: .88rem; }
 .zone-desc { font-size: .65rem; line-height: 1.25; }
}
@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { animation: none !important; transition: none !important; }
}
