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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.settings-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.settings-icon {
    font-size: 1.8rem;
    cursor: pointer;
    display: block;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.settings-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.settings-menu {
    display: none;
    position: absolute;
    top: 55px;
    left: 0;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 15px;
    min-width: 160px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.settings-menu.active {
    display: block;
}

.settings-title {
    font-size: 0.85rem;
    color: #a0a0a0;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
    display: block;
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 5px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.lang-btn:last-child {
    margin-bottom: 0;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.lang-btn.active {
    background: linear-gradient(90deg, #00d4ff, #7b2cbf);
}

header {
    text-align: center;
    padding: 40px 0;
}

header h1 {
    font-size: 3rem;
    background: linear-gradient(90deg, #00d4ff, #7b2cbf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    color: #a0a0a0;
}

.categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.category-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.category-btn.active {
    background: linear-gradient(90deg, #00d4ff, #7b2cbf);
}

.archetypes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.archetype-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.archetype-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    border-color: #00d4ff;
}

.archetype-card .icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

.archetype-card .icon img {
    width: 100%;
    height: 100%;
}

.archetype-card h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: #00d4ff;
}

.archetype-card .arabic-name {
    font-size: 1.1rem;
    color: #a0a0a0;
    margin-bottom: 10px;
}

.archetype-card .category-tag {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.archetype-card .category-tag.goalkeeper {
    background: #f39c12;
}

.archetype-card .category-tag.defender {
    background: #27ae60;
}

.archetype-card .category-tag.midfielder {
    background: #3498db;
}

.archetype-card .category-tag.attacker {
    background: #e74c3c;
}

.archetype-card .player-example {
    font-size: 0.95rem;
    color: #ccc;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    padding: 30px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #a0a0a0;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #fff;
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-header .icon {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.modal-header .icon img {
    width: 100%;
    height: 100%;
}

.modal-header h2 {
    font-size: 2rem;
    color: #00d4ff;
    margin-bottom: 5px;
}

.modal-header .arabic-name {
    font-size: 1.2rem;
    color: #a0a0a0;
}

.section {
    margin-bottom: 25px;
}

.section h4 {
    font-size: 1.1rem;
    color: #00d4ff;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.player-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
}

.playstyles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.playstyle-tag {
    background: linear-gradient(90deg, #7b2cbf, #00d4ff);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
}

.positions-grid {
    display: grid;
    gap: 10px;
}

.position-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.position-item .position-name {
    font-weight: 600;
}

.position-item .fit-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.position-item .fit-badge.perfect {
    background: #27ae60;
}

.position-item .fit-badge.ok {
    background: #f39c12;
}

.position-item .fit-badge.weak {
    background: #e74c3c;
}

.stats-board {
    background: rgba(0, 0, 0, 0.65);
    border-radius: 12px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    direction: ltr;
}

.stats-board.gk-stats {
    grid-template-columns: repeat(2, 1fr);
}

.stat-group {
    min-width: 0;
}

.stat-group__title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-list__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-list__item:last-child {
    border-bottom: none;
}

.stat-list__item .stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-list__item .stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-list__item .stat-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.stat-bar-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.stat-bar-fill.green {
    background: linear-gradient(90deg, #5dd55d, #2ecc71);
}

.stat-bar-fill.orange {
    background: linear-gradient(90deg, #f5a623, #f39c12);
}

.stat-bar-fill.red {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.description {
    line-height: 1.8;
    color: #ccc;
}

@media (max-width: 900px) {
    .stats-board {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .category-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .stats-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
}

@media (max-width: 500px) {
    .stats-board {
        grid-template-columns: 1fr;
    }
}

.hidden {
    display: none !important;
}

.main-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.main-tab {
    padding: 15px 40px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    background: transparent;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.main-tab:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.main-tab.active {
    background: linear-gradient(90deg, #00d4ff, #7b2cbf);
    border-color: transparent;
}

.myplayer-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.myplayer-container h2 {
    font-size: 1.8rem;
    color: #00d4ff;
    margin-bottom: 10px;
}

.myplayer-subtitle {
    color: #a0a0a0;
    margin-bottom: 30px;
}

.stats-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-input-group {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.stat-input-group label {
    display: block;
    font-size: 0.95rem;
    color: #00d4ff;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1.2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-input-group input:focus {
    outline: none;
    border-color: #00d4ff;
    background: rgba(0, 0, 0, 0.5);
}

.stat-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.archetype-picker {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}

.picker-category {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 20px;
}

.picker-category-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.picker-category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.archetype-pick-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.archetype-pick-card:hover {
    transform: translateY(-5px);
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.archetype-pick-card .pick-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
}

.archetype-pick-card .pick-icon img {
    width: 100%;
    height: 100%;
}

.archetype-pick-card .pick-name {
    font-size: 1rem;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 3px;
}

.archetype-pick-card .pick-name-sub {
    font-size: 0.85rem;
    color: #a0a0a0;
}

.step2-header-btns {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.reset-btn {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    border-radius: 20px;
    padding: 10px 20px;
    color: #e74c3c;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: rgba(231, 76, 60, 0.4);
}

.selected-archetype-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid #00d4ff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.selected-archetype-header .header-icon {
    width: 60px;
    height: 60px;
}

.selected-archetype-header .header-icon img {
    width: 100%;
    height: 100%;
}

.selected-archetype-header .header-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00d4ff;
}

.selected-archetype-header .header-name-sub {
    color: #a0a0a0;
    font-size: 1rem;
}

#step2-stats h3 {
    text-align: center;
    color: #fff;
    margin-bottom: 20px;
}

.stats-comparison-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    direction: ltr;
    max-width: 1000px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .game-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .game-stats-grid {
        grid-template-columns: 1fr;
    }
}

.game-stat-column {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    min-width: 0;
}

.game-stat-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.game-stat-row:last-child {
    border-bottom: none;
}

.game-stat-name {
    flex: 1;
    font-size: 0.75rem;
    color: #ccc;
    text-align: left;
    min-width: 0;
}

.game-stat-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    min-width: 40px;
}

.game-stat-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
    background: rgba(255, 255, 255, 0.3);
}

.game-stat-bar.bar-green {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.game-stat-bar.bar-orange {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.game-stat-bar.bar-red {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.game-stat-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.game-stat-target {
    font-size: 0.7rem;
    color: #888;
    font-weight: 600;
    transition: color 0.3s ease;
}

.game-stat-target.target-green {
    color: #2ecc71;
}

.game-stat-target.target-orange {
    color: #f39c12;
}

.game-stat-target.target-red {
    color: #e74c3c;
}

.game-stat-input {
    width: 50px;
    padding: 6px 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.game-stat-input:focus {
    outline: none;
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.game-stat-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.game-stat-input.input-green {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.game-stat-input.input-orange {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.game-stat-input.input-red {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.game-stat-input::-webkit-inner-spin-button,
.game-stat-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.game-stat-input[type=number] {
    -moz-appearance: textfield;
}

.stat-row {
    display: grid;
    grid-template-columns: 100px 1fr 80px 80px;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
}

.stat-row .stat-name {
    font-weight: 600;
    color: #00d4ff;
}

.stat-row .stat-input {
    padding: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    text-align: center;
    max-width: 100px;
}

.stat-row .stat-input:focus {
    outline: none;
    border-color: #00d4ff;
}

.stat-row .stat-target {
    text-align: center;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
}

.stat-row .stat-remaining {
    text-align: center;
    font-weight: 700;
    padding: 10px;
    border-radius: 8px;
}

.stat-row .stat-remaining.need-more {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.stat-row .stat-remaining.complete {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.stat-row-header {
    display: grid;
    grid-template-columns: 100px 1fr 80px 80px;
    gap: 15px;
    padding: 10px 15px;
    color: #a0a0a0;
    font-size: 0.9rem;
}

.stat-row-header span {
    text-align: center;
}

.stat-row-header span:first-child {
    text-align: right;
}

@media (max-width: 600px) {
    .stat-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-row .stat-name {
        grid-column: 1 / -1;
        text-align: center;
    }
    
    .stat-row-header {
        display: none;
    }
    
    .picker-category-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .stats-form {
        grid-template-columns: 1fr;
    }
    
    .main-tab {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

.visitor-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    font-family: 'Cairo', sans-serif;
}

.visitor-icon {
    font-size: 1.2rem;
}

#visitor-count {
    color: #4ade80;
    font-weight: 700;
    font-size: 1.1rem;
}
