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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #fbbf24;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --text-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-border: rgba(255, 255, 255, 0.25);
    --shadow-color: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 25%, #8b5cf6 50%, #ec4899 75%, #f59e0b 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.results-view {
    padding: 0 !important;
    margin: 0 !important;
}

/* أزرار المشاركة */
.share-buttons-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.share-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid var(--card-border);
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9em;
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.share-button:active {
    transform: translateY(0);
}

.share-button.snapchat-btn {
    background: rgba(255, 252, 0, 0.2);
    border-color: rgba(255, 252, 0, 0.4);
    color: #FFFC00;
}

.share-button.snapchat-btn:hover {
    background: rgba(255, 252, 0, 0.3);
    border-color: rgba(255, 252, 0, 0.6);
}

.share-button.snapchat-btn img.snapchat-icon {
    filter: none !important;
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
}

.share-button.snapchat-btn:hover img.snapchat-icon {
    filter: none !important;
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.share-button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.share-button img {
    width: auto;
    height: auto;
    flex-shrink: 0;
    object-fit: contain;
}


.share-text {
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .share-buttons-container {
        top: 15px;
        left: 15px;
        gap: 10px;
    }
    
    .share-button {
        padding: 10px 16px;
    }
    
    .share-text {
        display: none;
    }
    
    .share-button svg {
        width: 20px;
        height: 20px;
    }
    
    .share-button img.snapchat-icon {
        width: 24px;
        height: 24px;
        filter: none !important;
    }
}

body.results-view {
    padding: 0 !important;
}

#results-screen {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100vh;
    display: none !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 200;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 25%, #8b5cf6 50%, #ec4899 75%, #f59e0b 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    background-attachment: fixed;
    overflow-y: scroll !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#results-screen.active {
    display: flex !important;
}

#results-screen .container {
    padding: 5px 40px 60px 40px !important;
    margin: 0 !important;
    flex: 1;
    min-height: auto;
    max-height: none;
    overflow: visible;
    position: relative;
}

body.results-view #results-screen .container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

#app {
    max-width: 1920px;
    margin: 0 auto;
    min-height: calc(100vh - 40px);
}

body.results-view #app {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease-in;
    min-height: 100vh;
    width: 100%;
}

.screen.active {
    display: block;
}

#results-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    z-index: 200;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 25%, #8b5cf6 50%, #ec4899 75%, #f59e0b 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite, fadeIn 0.5s ease-in;
    background-attachment: fixed;
    overflow-y: scroll !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#results-screen:not(.active) {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
}

#results-screen .container {
    padding: 5px 40px 80px 40px !important;
    margin-top: 0 !important;
}

.title {
    font-size: 3.5em;
    text-align: center;
    margin-bottom: 40px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
    font-weight: 700;
    letter-spacing: -1px;
}

@media (max-width: 768px) {
    .title {
        font-size: 2.2em;
        margin-bottom: 30px;
        letter-spacing: 0;
    }
}

#results-screen .title {
    font-size: 2.5em;
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    line-height: 1.2;
}

.form-group {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .form-group {
        margin-bottom: 20px;
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group label {
        font-size: 1.2em !important;
        margin-bottom: 8px;
    }
}

.form-group label {
    font-size: 1.5em;
    font-weight: 600;
    min-width: 150px;
}

.input {
    padding: 15px 20px;
    font-size: 1.3em;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(10px);
    width: 200px;
    transition: all 0.3s;
}

.input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.3);
}

.input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.btn {
    padding: 15px 40px;
    font-size: 1.3em;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .btn {
        padding: 14px 30px;
        font-size: 1.1em;
        border-radius: 10px;
        width: 100%;
    }
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, var(--success-color) 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 15px 30px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, var(--danger-color) 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn:disabled:hover {
    transform: none;
}

.players-list {
    margin: 40px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.player-input-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-input-item input {
    flex: 1;
    padding: 12px 15px;
    font-size: 1.2em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(10px);
}

.player-input-item input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.3);
}

.player-input-item .player-number {
    font-size: 1.3em;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .game-info {
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .info-item {
        font-size: 1.1em;
    }
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5em;
}

.info-item .label {
    font-weight: 600;
}

.info-item .value {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    font-weight: bold;
}

.players-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .players-display {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 30px;
    }
}

.player-card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    .player-card {
        padding: 20px 15px;
        border-radius: 12px;
    }
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.player-card.active {
    border-color: #FFD700;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
    transform: translateY(-5px);
}

.player-view-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s;
}

.player-view-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.player-view-btn.viewed {
    background: rgba(76, 175, 80, 0.4);
    border-color: #4CAF50;
    color: #fff;
    cursor: default;
}

.player-view-btn.viewed:hover {
    background: rgba(76, 175, 80, 0.4);
    border-color: #4CAF50;
    transform: none;
}

.player-view-btn.disabled {
    background: rgba(158, 158, 158, 0.3);
    border-color: rgba(158, 158, 158, 0.5);
    color: rgba(255, 255, 255, 0.6);
    cursor: not-allowed;
    opacity: 0.7;
}

.player-view-btn.disabled:hover {
    background: rgba(158, 158, 158, 0.3);
    border-color: rgba(158, 158, 158, 0.5);
    transform: none;
}

.player-card.viewed {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.player-card.disabled {
    opacity: 0.6;
}

.player-card .player-name {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.player-card .player-status {
    font-size: 1.1em;
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
}

.player-card.spy .player-status {
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
}

.player-card.non-spy .player-status {
    background: rgba(76, 175, 80, 0.3);
    border: 2px solid #4CAF50;
}

/* نافذة منبثقة للمعلومة */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(139, 92, 246, 0.95) 50%, rgba(236, 72, 153, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 0;
    max-width: 90%;
    width: 500px;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.modal-title {
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
    color: #fff;
}

.modal-body {
    padding: 40px 30px;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.clue-text-modal {
    font-size: 2.5em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    line-height: 1.4;
}

.clue-text-modal.hidden {
    font-size: 1.5em;
    color: rgba(255, 255, 255, 0.9);
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.modal-footer .done-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.3em;
}

.clue-label {
    font-size: 1.8em;
    font-weight: 600;
    margin-bottom: 20px;
    opacity: 0.9;
}

.clue-text {
    font-size: 4em;
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    color: #FFD700;
}

.clue-text.hidden {
    font-size: 2em;
    color: rgba(255, 255, 255, 0.5);
}

.done-btn {
    margin-top: 30px;
    padding: 15px 50px;
    font-size: 1.5em;
    font-weight: bold;
}

.results-section {
    margin-bottom: 30px;
    margin-top: 0;
}

.result-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    font-size: 1.8em;
}

.result-label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
}

.result-value {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 15px 0;
    text-shadow: none;
}

.result-type {
    display: block;
    font-size: 1.2em;
    opacity: 0.8;
    margin-top: 10px;
}

.spies-list, .all-players-list {
    margin: 40px 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 30px;
}

.section-title {
    font-size: 2em;
    margin-bottom: 25px;
    text-align: center;
    font-weight: bold;
}

.spies-names, .players-names {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

@media (max-width: 768px) {
    .spies-names, .players-names {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .spy-name, .player-name-item {
        padding: 12px 15px;
        font-size: 1.1em;
    }
}

.spy-name, .player-name-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.3em;
    font-weight: 600;
    transition: all 0.3s;
}

.spy-name {
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
}

.player-name-item {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.spy-name:hover, .player-name-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#start-game-btn {
    display: block;
    margin: 40px auto;
    padding: 20px 60px;
    font-size: 1.5em;
}

#end-game-btn, #new-game-btn {
    display: block;
    margin: 40px auto;
    padding: 20px 60px;
    font-size: 1.5em;
}

.results-actions {
    display: flex !important;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
    z-index: 10;
}

.results-actions .btn {
    min-width: 220px;
    padding: 18px 45px;
    font-size: 1.4em;
    font-weight: 600;
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative;
    z-index: 10;
}

@media (max-width: 768px) {
    .results-actions {
        flex-direction: column;
        gap: 15px;
        margin-top: 30px;
    }
    
    .results-actions .btn {
        width: 100%;
        min-width: auto;
        padding: 16px 30px;
        font-size: 1.2em;
    }
}

/* إشعارات */
.notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(76, 175, 80, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-weight: 600;
    font-size: 1em;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification.error {
    background: rgba(244, 67, 54, 0.95);
}

@media (max-width: 768px) {
    .notification {
        top: 70px;
        padding: 12px 20px;
        font-size: 0.9em;
        border-radius: 10px;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2em;
    }
    
    .container {
        padding: 15px;
    }
    
    #results-screen .container {
        padding: 0 15px 10px 15px !important;
        margin: 0 !important;
    }
    
    #results-screen .title {
        font-size: 1.8em;
        margin: 0 0 12px 0 !important;
        padding: 0 !important;
        line-height: 1.2;
    }
    
    body.results-view {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    #results-screen {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .results-section {
        margin-bottom: 20px;
        margin-top: 0;
    }
    
    .modal-content {
        width: 95%;
        max-height: 85vh;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 20px 20px;
    }
    
    .modal-title {
        font-size: 1.5em;
    }
    
    .modal-body {
        padding: 30px 20px;
        min-height: 120px;
    }
    
    .clue-text-modal {
        font-size: 1.8em;
    }
    
    .clue-text-modal.hidden {
        font-size: 1.3em;
    }
    
    .modal-footer {
        padding: 15px 20px;
    }
    
    .modal-footer .done-btn {
        padding: 12px;
        font-size: 1.2em;
    }
    
    .players-display {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .player-card {
        padding: 15px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .info-item {
        font-size: 1.2em;
    }
}

