:root {
    --primary-color: #1a1a2e; /* Ciemny granatowy */
    --secondary-color: #0f3460; /* Ciemnoniebieski */
    --accent-color: #e94560; /* Czerwony akcent */
    --text-color: #ffffff; /* Biały tekst */
    --dark-background: #16213e; /* Ciemne tło */
    --darker-background: #0f172a; /* Jeszcze ciemniejsze tło */
    --success-color: #4caf50; /* Zielony */
    --border-color: #30475e; /* Szaro-niebieski */
    --input-background: #1f2937; /* Ciemny szary */
    --glow-color: rgba(233, 69, 96, 0.6); /* Poświata */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Times New Roman', Times, serif;
}

body {
    background-color: var(--darker-background);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.background-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%2316213e"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="%2330475e" stroke-width="0.5" stroke-opacity="0.2"/></svg>');
    background-size: 20px 20px;
    z-index: -1;
    animation: backgroundMove 120s linear infinite;
}

@keyframes backgroundMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 1000px 1000px;
    }
}

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

.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background-color: var(--primary-color);
    color: var(--text-color);
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--accent-color);
}

.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300"><rect width="300" height="300" fill="%231a1a2e"/><path d="M0,150 L300,150 M150,0 L150,300" stroke="%23FFFFFF" stroke-width="1" stroke-opacity="0.05"/></svg>');
    background-size: 30px 30px;
    z-index: -1;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.3), 0 0 20px rgba(233, 69, 96, 0.2);
    letter-spacing: 1px;
}

.header p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

.login-container, .simulator-container {
    background-color: var(--dark-background);
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    position: relative;
    animation: fadeIn 0.5s ease-in-out;
}

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

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

input, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    background-color: var(--input-background);
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

textarea {
    resize: vertical;
    min-height: 150px;
}

.word-counter {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
    text-align: right;
    opacity: 0.8;
}

button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

button:hover {
    background-color: #d13652;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.glow-effect {
    position: relative;
}

.glow-effect:after {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: -1;
    background: var(--accent-color);
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glow-effect:hover:after {
    opacity: 0.4;
}

.timer-container {
    text-align: center;
    margin: 25px 0;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

.timer {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--text-color);
    background-color: var(--primary-color);
    padding: 15px 30px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.timer:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.timer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    z-index: -1;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--dark-background);
    padding: 40px;
    border-radius: 8px;
    max-width: 550px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-color));
}

.modal h2 {
    margin-bottom: 25px;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.modal h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
}

.progress-bar-container {
    height: 10px;
    background-color: var(--input-background);
    border-radius: 5px;
    margin: 30px 0;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    transition: width 0.4s;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

.analysis-message {
    margin: 20px 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-effect {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.loading-effect span {
    display: inline-block;
    width: 15px;
    height: 15px;
    background-color: var(--accent-color);
    border-radius: 50%;
    margin: 0 5px;
    animation: loadingDots 1.5s infinite ease-in-out;
}

.loading-effect span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-effect span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDots {
    0%, 100% {
        transform: scale(0.5);
        opacity: 0.3;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-message {
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.3rem;
    margin: 25px 0;
    padding: 15px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    background-color: rgba(76, 175, 80, 0.1);
    border-radius: 5px;
}

.success-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    background-color: var(--success-color);
    color: white;
    font-size: 40px;
    border-radius: 50%;
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease-out;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

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

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.result-key {
    font-size: 4rem;
    font-weight: bold;
    color: var(--accent-color);
    margin: 30px 0;
    padding: 20px;
    border: 3px dashed var(--accent-color);
    display: inline-block;
    background-color: rgba(233, 69, 96, 0.1);
    border-radius: 10px;
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
    animation: glowingKey 2s infinite alternate;
    letter-spacing: 5px;
}

@keyframes glowingKey {
    0% {
        box-shadow: 0 0 5px rgba(233, 69, 96, 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(233, 69, 96, 0.8), 0 0 30px rgba(233, 69, 96, 0.4);
    }
}

.scenario {
    background-color: var(--secondary-color);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 5px solid var(--accent-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Karty z uczestnikami rozprawy */
/* Dodatkowe animacje i efekty */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes floatEffect {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.modal-animation {
    animation: zoomIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.court-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: space-between;
}

.court-card {
    flex: 1;
    min-width: 150px;
    background-color: var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    animation: slideInRight 0.5s ease-out forwards;
    animation-delay: calc(var(--card-index, 0) * 0.1s);
    opacity: 0;
}

.court-card:nth-child(odd) {
    animation-name: slideInLeft;
}

.court-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

/* Pulsowanie pierwszej karty (obrońca) */
.court-card:first-child {
    animation-delay: 0.1s;
    border: 1px solid var(--accent-color);
}

.court-card:first-child:hover {
    animation: floatEffect 2s ease-in-out infinite;
    transform: none;
}

.card-title {
    background-color: var(--accent-color);
    color: white;
    padding: 8px 12px;
    font-weight: bold;
    text-align: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-content {
    padding: 12px;
    text-align: center;
}

.card-content strong {
    display: block;
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

/* Obrońca - większe dane */
.court-card:first-child .card-content strong {
    font-size: 1.6rem;
    margin: 5px 0;
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(233, 69, 96, 0.3);
}

.court-card:first-child .card-subtitle {
    font-size: 1.1rem;
    font-weight: bold;
}

.card-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
    color: var(--text-color);
}

/* Responsywność kart */
@media (max-width: 768px) {
    .court-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .court-cards-container {
        grid-template-columns: 1fr;
    }
}

.scenario h3 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
    position: relative;
    display: inline-block;
}

.scenario h3::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

.scenario p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.pulse {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        color: var(--text-color);
        text-shadow: none;
    }
    50% {
        color: var(--accent-color);
        text-shadow: 0 0 10px rgba(233, 69, 96, 0.7);
    }
    100% {
        color: var(--text-color);
        text-shadow: none;
    }
}

/* Responsywność */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .timer {
        font-size: 2.5rem;
    }
    
    .modal-content {
        padding: 30px;
    }
    
    .result-key {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.7rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .timer {
        font-size: 2rem;
        padding: 10px 20px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .result-key {
        font-size: 2.5rem;
        padding: 15px;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
}

.hidden {
    display: none;
}