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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
}

/* --- Screens --- */
.screen { display: none; }
.screen.active { display: block; }

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

/* --- Menu --- */
.title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    background: linear-gradient(90deg, #e94560, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: rgba(255,255,255,0.7);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.settings-group { margin-bottom: 1.8rem; }

.group-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.7rem;
}

.cat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.cat-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.cat-btn:hover { background: rgba(255,255,255,0.2); }

.cat-btn.active {
    background: #e94560;
    border-color: #e94560;
    font-weight: 600;
}

.diff-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.diff-btn {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: all 0.2s;
    min-width: 90px;
}

.diff-btn:hover { background: rgba(255,255,255,0.2); }

.diff-btn.active {
    background: rgba(167,139,250,0.3);
    border-color: #a78bfa;
    font-weight: 600;
}

.diff-btn small { color: rgba(255,255,255,0.6); font-size: 0.75rem; }

.btn-primary {
    background: linear-gradient(135deg, #e94560, #c62a47);
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233,69,96,0.5);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover { background: rgba(255,255,255,0.2); }

.btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.copyright {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* --- Game Header --- */
.game-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 14px 20px;
    background: rgba(0,0,0,0.3);
    flex-wrap: wrap;
}

.hstat {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    font-weight: 600;
}

.btn-small {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-small:hover { background: rgba(255,255,255,0.25); }

/* --- Card Grid --- */
.card-grid {
    display: grid;
    gap: 10px;
    padding: 16px;
    justify-content: center;
}

/* --- Cards --- */
.card {
    perspective: 700px;
    cursor: pointer;
    height: 80px;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
    border-radius: 10px;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card.matched .card-inner {
    box-shadow: 0 0 14px 3px gold;
}

.card.matched .card-face {
    opacity: 0.75;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    text-align: center;
    font-weight: 700;
    user-select: none;
}

/* Card back — shown when face-down */
.card-back-face {
    background: linear-gradient(135deg, #667eea, #764ba2);
    font-size: 1.6rem;
    color: rgba(255,255,255,0.5);
    border: 2px solid rgba(255,255,255,0.15);
}

/* Hebrew side */
.card-front-face.hebrew {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    transform: rotateY(180deg);
    font-family: 'Arial Unicode MS', 'Noto Sans Hebrew', Arial, sans-serif;
    font-size: 1.4rem;
    direction: rtl;
    color: #fff;
    border: 2px solid rgba(100,150,255,0.4);
}

/* English side */
.card-front-face.english {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    transform: rotateY(180deg);
    font-size: 0.8rem;
    color: #0a2a1a;
    border: 2px solid rgba(56,239,125,0.4);
}

/* --- Results --- */
.results-row {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.res-box {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px 28px;
    min-width: 100px;
}

.res-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: #a78bfa;
}

.res-lbl {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .title { font-size: 1.8rem; }
    .card { height: 65px; }
    .card-front-face.hebrew { font-size: 1.1rem; }
    .card-front-face.english { font-size: 0.7rem; }
    .diff-row { flex-direction: column; align-items: center; }
}
