@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=MedievalSharp&display=swap');

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

body {
    font-family: 'Cinzel', 'Times New Roman', serif;
    background: 
        radial-gradient(circle at 20% 50%, #2d4a2d 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, #3a2d1a 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, #1a2d2d 0%, transparent 50%),
        linear-gradient(135deg, #1a1a0a 0%, #2d2d1a 50%, #1a1a0a 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
    pointer-events: none;
    z-index: 0;
}

.container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.auth-box {
    background: 
        linear-gradient(145deg, #3a3528 0%, #2a2518 100%);
    padding: 40px;
    border: 4px solid #8b7355;
    box-shadow: 
        0 0 20px rgba(139, 115, 85, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.3),
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 0 0 4px rgba(212, 175, 55, 0.2);
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, #d4af37, #8b7355, #a6895a, #8b7355, #d4af37);
    background-size: 200% 200%;
    animation: borderGlow 3s ease infinite;
    z-index: -1;
}

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

h1 {
    text-align: center;
    margin-bottom: 35px;
    color: #d4af37;
    font-family: 'MedievalSharp', 'Courier New', cursive;
    font-size: 2.5em;
    text-shadow: 
        2px 2px 0px #8b5a2b,
        4px 4px 8px rgba(0, 0, 0, 0.8),
        0 0 15px rgba(212, 175, 55, 0.5);
    letter-spacing: 3px;
    text-transform: uppercase;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #d4af37;
    font-weight: 600;
    font-size: 0.95em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 3px solid #6b5d47;
    background: linear-gradient(to bottom, #2a2518 0%, #1a1508 100%);
    color: #d4af37;
    font-size: 16px;
    font-family: 'Cinzel', 'Times New Roman', serif;
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.5),
        0 2px 0px rgba(139, 115, 85, 0.3);
    transition: all 0.3s;
}

input::placeholder {
    color: #8b7355;
    opacity: 0.7;
}

input:focus {
    outline: none;
    border-color: #d4af37;
    background: linear-gradient(to bottom, #3a3528 0%, #2a2518 100%);
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(212, 175, 55, 0.4),
        0 2px 0px rgba(212, 175, 55, 0.3);
}

small {
    display: block;
    margin-top: 8px;
    color: #8b7355;
    font-size: 0.85em;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border: 3px solid;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Cinzel', 'Times New Roman', serif;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 2px 0px rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.btn-primary {
    background: linear-gradient(to bottom, #8b5a2b 0%, #6b4423 50%, #4a2d18 100%);
    border-color: #d4af37;
    color: #f5d76e;
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #a06a35 0%, #8b5a2b 50%, #6b4423 100%);
    border-color: #f5d76e;
    color: #fff9d4;
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(212, 175, 55, 0.4),
        inset 0 2px 0px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: linear-gradient(to bottom, #4a4a3a 0%, #3a3a2a 50%, #2a2a1a 100%);
    border-color: #8b7355;
    color: #d4af37;
}

.btn-secondary:hover {
    background: linear-gradient(to bottom, #5a5a4a 0%, #4a4a3a 50%, #3a3a2a 100%);
    border-color: #a6895a;
    color: #f5d76e;
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(139, 115, 85, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(1px);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-buttons {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.auth-buttons .btn {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.auth-link {
    text-align: center;
    margin-top: 25px;
    color: #8b7355;
    font-size: 0.95em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.auth-link a {
    color: #d4af37;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    padding-bottom: 2px;
}

.auth-link a:hover {
    color: #f5d76e;
    border-bottom-color: #d4af37;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.message {
    margin-top: 20px;
    padding: 14px 16px;
    text-align: center;
    display: none;
    border: 3px solid;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.4);
}

.message.success {
    background: linear-gradient(to bottom, #3a5a3a 0%, #2a4a2a 100%);
    color: #7fcf7f;
    border-color: #5a8a5a;
    display: block;
}

.message.error {
    background: linear-gradient(to bottom, #5a3a3a 0%, #4a2a2a 100%);
    color: #cf7f7f;
    border-color: #8a5a5a;
    display: block;
}

/* Responsive dizainas */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }

    .auth-box {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2em;
        letter-spacing: 2px;
        margin-bottom: 25px;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .auth-buttons .btn {
        width: 100% !important;
        flex: none;
        max-width: 100%;
        min-width: 0;
    }

    .btn {
        padding: 12px 14px;
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"] {
        padding: 12px 14px;
        font-size: 16px; /* Prevencija iOS zoom */
    }

    label {
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .auth-box {
        padding: 25px 15px;
    }

    h1 {
        font-size: 1.75em;
        letter-spacing: 1px;
        margin-bottom: 20px;
    }

    .btn {
        padding: 11px 14px;
        font-size: 13px;
        letter-spacing: 1px;
    }

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

    .auth-link {
        font-size: 0.9em;
        margin-top: 20px;
    }
}

/* Tablet dizainas */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 500px;
    }
}

/* Dashboard stiliai */
.character-info {
    margin: 30px 0;
}

.character-info h2 {
    color: #d4af37;
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.character-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    color: #8b7355;
    font-weight: 600;
    font-size: 0.9em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.stat-value {
    color: #d4af37;
    font-size: 1.2em;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.stat-value.gold {
    color: #ffd700;
}

.health-bar {
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom, #2a2518 0%, #1a1508 100%);
    border: 2px solid #6b5d47;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    background: linear-gradient(to bottom, #8b0000 0%, #dc143c 50%, #8b0000 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
}

.create-character {
    margin: 30px 0;
}

.create-character h2 {
    color: #d4af37;
    font-size: 1.5em;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.dashboard-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

@media (max-width: 768px) {
    .character-info h2,
    .create-character h2 {
        font-size: 1.5em;
    }
    
    .stat-value {
        font-size: 1.1em;
    }
    
    .health-bar {
        height: 18px;
    }
}
