/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    touch-action: none;
}

/* ===== MAIN APP CONTAINER ===== */
#app {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #581c87 50%, #0f172a 100%);
    overflow: hidden;
}

/* ===== ANIMATED BACKGROUND BLOBS ===== */
.background-blobs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: multiply;
    filter: blur(60px);
    opacity: 0.2;
    animation: pulse 4s ease-in-out infinite;
}

.blob-1 {
    top: 5rem;
    left: 2.5rem;
    width: 16rem;
    height: 16rem;
    background: #a855f7;
}

.blob-2 {
    top: 10rem;
    right: 2.5rem;
    width: 16rem;
    height: 16rem;
    background: #eab308;
    animation-delay: 2s;
}

.blob-3 {
    bottom: 5rem;
    left: 10rem;
    width: 16rem;
    height: 16rem;
    background: #ec4899;
    animation-delay: 4s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}

/* ===== KONFETI ANIMATION ===== */
#konfeti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

.konfeti {
    position: absolute;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
}

@keyframes explode {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.5);
        opacity: 0;
    }
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    padding: 0.5rem;
}

/* ===== GAME HEADER ===== */
.game-header {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.9) 0%, rgba(88, 28, 135, 0.9) 50%, rgba(30, 41, 59, 0.9) 100%);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 2px solid rgba(168, 85, 247, 0.3);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.title-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trophy-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #fbbf24;
}

.title-section h1 {
    font-size: 0.875rem;
    font-weight: 900;
    background: linear-gradient(90deg, #fde047 0%, #f9a8d4 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-badge {
    background: linear-gradient(90deg, #fbbf24, #f97316);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.star-icon {
    width: 1rem;
    height: 1rem;
}

.score-text {
    font-size: 1.125rem;
    font-weight: 900;
}

/* ===== CONTROLS ===== */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.operation-buttons {
    display: flex;
    gap: 0.25rem;
}

.operation-btn {
    padding: 0.375rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 900;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    background: rgba(51, 65, 85, 0.8);
    color: #d1d5db;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.operation-btn .emoji {
    font-size: 1rem;
}

.operation-btn .label {
    display: none;
}

.operation-btn:hover {
    background: rgba(71, 85, 105, 0.8);
    transform: translateY(-2px);
}

.operation-btn.active {
    color: white;
    transform: scale(1.05);
}

.operation-btn.active[data-operation="toplama"] {
    background: linear-gradient(90deg, #3b82f6, #06b6d4, #14b8a6);
}

.operation-btn.active[data-operation="cikarma"] {
    background: linear-gradient(90deg, #f97316, #ef4444, #ec4899);
}

.operation-btn.active[data-operation="carpma"] {
    background: linear-gradient(90deg, #a855f7, #8b5cf6, #6366f1);
}

.operation-btn.active[data-operation="bolme"] {
    background: linear-gradient(90deg, #22c55e, #10b981, #84cc16);
}

.new-game-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: linear-gradient(90deg, #4ade80, #10b981);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 900;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.new-game-btn:hover {
    transform: scale(1.05);
}

.new-game-btn:active {
    transform: scale(0.95);
}

.refresh-icon {
    width: 1rem;
    height: 1rem;
}

/* ===== SUCCESS MESSAGE ===== */
.success-message {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(90deg, #4ade80, #3b82f6, #a855f7);
    border-radius: 0.5rem;
    color: white;
    text-align: center;
    animation: pulse 1s ease-in-out infinite;
    border: 2px solid #fde047;
}

.success-message.hidden {
    display: none;
}

.success-text {
    font-size: 1.5rem;
    font-weight: 900;
}

/* ===== GAME BOARD ===== */
.game-board {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    min-height: 0;
}

.game-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.column-header {
    color: white;
    padding: 0.5rem;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

.column-header h2 {
    font-size: 0.875rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.header-emoji {
    font-size: 1.125rem;
}

.questions-header {
    background: linear-gradient(90deg, #3b82f6, #06b6d4, #14b8a6);
}

.questions-header[data-operation="cikarma"] {
    background: linear-gradient(90deg, #f97316, #ef4444, #ec4899);
}

.questions-header[data-operation="carpma"] {
    background: linear-gradient(90deg, #a855f7, #8b5cf6, #6366f1);
}

.questions-header[data-operation="bolme"] {
    background: linear-gradient(90deg, #22c55e, #10b981, #84cc16);
}

.answers-header {
    background: linear-gradient(90deg, #ec4899, #a855f7, #6366f1);
}

.column-content {
    flex: 1;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    backdrop-filter: blur(20px);
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 0.375rem;
    overflow-y: auto;
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-top: none;
    min-height: 0;
}

.items-container {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    height: 100%;
}

/* ===== GAME ITEMS (BUTTONS) ===== */
.game-item {
    flex: 1;
    position: relative;
    padding: 0.5rem;
    font-weight: 900;
    font-size: 1.125rem;
    transition: all 0.2s ease;
    transform: scale(1);
    border: none;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
}

.game-item.question {
    clip-path: polygon(0% 0%, 85% 0%, 100% 50%, 85% 100%, 0% 100%);
}

.game-item.answer {
    clip-path: polygon(15% 0%, 100% 0%, 100% 100%, 15% 100%, 0% 50%);
}

.game-item:not(.completed):not(.selected) {
    background: linear-gradient(135deg, #475569, #1e293b);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.game-item:not(.completed):not(.selected):hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transform: scale(1.05);
}

.game-item:not(.completed):not(.selected):active {
    transform: scale(0.95);
}

.game-item.selected {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transform: scale(1.05);
}

.game-item.completed {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.item-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.question .item-content {
    justify-content: flex-start;
}

.answer .item-content {
    justify-content: center;
}

.check-mark {
    font-size: 1.25rem;
}

/* Color variations for completed items */
.color-0 { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.color-1 { background: linear-gradient(90deg, #22c55e, #10b981); }
.color-2 { background: linear-gradient(90deg, #a855f7, #ec4899); }
.color-3 { background: linear-gradient(90deg, #f97316, #ef4444); }
.color-4 { background: linear-gradient(90deg, #eab308, #f59e0b); }
.color-5 { background: linear-gradient(90deg, #6366f1, #8b5cf6); }

/* ===== SCROLLBAR ===== */
.column-content::-webkit-scrollbar {
    width: 6px;
}

.column-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.column-content::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.5);
    border-radius: 10px;
}

.column-content::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.7);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet (768px and up) */
@media (min-width: 768px) {
    .main-container {
        padding: 1rem;
    }

    .game-header {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 1.5rem;
    }

    .header-content {
        margin-bottom: 1rem;
    }

    .trophy-icon {
        width: 2rem;
        height: 2rem;
    }

    .title-section h1 {
        font-size: 1.5rem;
    }

    .title-section {
        gap: 0.5rem;
    }

    .score-badge {
        padding: 0.5rem 1rem;
    }

    .star-icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    .score-text {
        font-size: 1.5rem;
    }

    .controls {
        gap: 0.5rem;
    }

    .operation-buttons {
        gap: 0.5rem;
    }

    .operation-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .operation-btn .emoji {
        font-size: 1.25rem;
    }

    .operation-btn .label {
        display: inline;
        margin-left: 0.25rem;
    }

    .new-game-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .refresh-icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    .success-text {
        font-size: 2.25rem;
    }

    .success-message {
        padding: 0.75rem;
    }

    .game-board {
        gap: 1rem;
    }

    .column-header {
        padding: 0.75rem;
        border-top-left-radius: 1rem;
        border-top-right-radius: 1rem;
    }

    .column-header h2 {
        font-size: 1.5rem;
        gap: 0.5rem;
    }

    .header-emoji {
        font-size: 1.875rem;
    }

    .column-content {
        padding: 0.75rem;
        border-bottom-left-radius: 1rem;
        border-bottom-right-radius: 1rem;
    }

    .items-container {
        gap: 0.5rem;
    }

    .game-item {
        padding: 1rem;
        font-size: 1.875rem;
        min-height: 4rem;
    }

    .check-mark {
        font-size: 1.875rem;
    }

    .blob-1, .blob-2, .blob-3 {
        width: 24rem;
        height: 24rem;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .game-item {
        font-size: 2rem;
        min-height: 5rem;
    }

    .column-content::-webkit-scrollbar {
        width: 8px;
    }
}

/* Landscape mobile optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .main-container {
        padding: 0.25rem;
    }

    .game-header {
        padding: 0.5rem;
        margin-bottom: 0.25rem;
    }

    .header-content {
        margin-bottom: 0.25rem;
    }

    .title-section h1 {
        font-size: 0.75rem;
    }

    .trophy-icon {
        width: 1rem;
        height: 1rem;
    }

    .score-badge {
        padding: 0.25rem 0.5rem;
    }

    .score-text {
        font-size: 0.875rem;
    }

    .star-icon {
        width: 0.875rem;
        height: 0.875rem;
    }

    .operation-btn, .new-game-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.675rem;
    }

    .game-item {
        padding: 0.375rem;
        font-size: 0.875rem;
        min-height: 2rem;
    }

    .success-text {
        font-size: 1rem;
    }

    .column-header h2 {
        font-size: 0.75rem;
    }
}

/* Prevent text selection */
.game-item, .operation-btn, .new-game-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
