* {
    box-sizing: border-box;
}

body {
    background: #1a1a1a url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQIW2NkYGD4z8DAwMgABXAGiDUaGhoaKgMeAQoSGgQAdQgA+wJpvZic3gAAAABJRU5ErkJggg==') repeat;
    color: #e0e0e0;
    font-family: 'Press Start 2P', cursive;
    margin: 0;
    padding: 20px;
    image-rendering: pixelated;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #2a2a2a;
    border: 8px solid #e0e0e0;
    box-shadow: 0 0 0 8px #000;
    padding: 20px;
}

.header {
    text-align: center;
    padding: 10px;
    background: #3a3a3a;
    border: 6px solid #e0e0e0;
}

.logo {
    max-width: 300px;
    image-rendering: pixelated;
}

.stats {
    background: #3a3a3a;
    border: 6px solid #e0e0e0;
    padding: 15px;
    margin: 20px 0;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-shadow: 2px 2px #000;
}

.stats a {
    color: #ff5555;
    text-decoration: none;
}

.stats a:hover {
    color: #cc4444;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    background: #3a3a3a;
    border: 6px solid #e0e0e0;
    padding: 10px;
    margin: 20px 0;
}

.nav a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 12px;
    padding: 8px 16px;
    border: 4px solid transparent;
    text-shadow: 2px 2px #000;
}

.nav a:hover, .nav a.active {
    border: 4px solid #ff5555;
    background: #555;
}

.content {
    padding: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.card {
    background: #3a3a3a;
    padding: 15px;
    border: 6px solid #e0e0e0;
    box-shadow: 0 0 0 4px #000;
    transition: transform 0.1s;
}

.card:hover {
    transform: scale(1.03);
}

.card h3 {
    color: #55ff55;
    font-size: 14px;
    margin: 0 0 10px;
    text-shadow: 2px 2px #000;
}

.card p {
    font-size: 10px;
    margin: 5px 0;
}

button {
    background: #ff5555;
    border: 4px solid #e0e0e0;
    color: #e0e0e0;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 10px;
    box-shadow: 0 0 0 4px #000;
    transition: background 0.2s;
}

button:hover {
    background: #cc4444;
}

.login-box, .register-box {
    background: #2e2e2e;
    padding: 20px;
    border: 6px solid #e0e0e0;
    box-shadow: 0 0 0 4px #000;
    width: 320px;
    margin: 20px auto;
    text-align: center;
}

input, select {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    background: #444;
    border: 2px solid #e0e0e0;
    color: #e0e0e0;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
}

.error {
    color: #ff5555;
    font-size: 10px;
    margin: 10px 0;
    text-shadow: 1px 1px #000;
}

a {
    color: #44ff44;
    text-decoration: none;
    font-size: 10px;
}

a:hover {
    color: #33cc33;
}

.fight-container {
    background: #3a3a3a;
    border: 6px solid #e0e0e0;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.fight-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.fight-stats div {
    width: 45%;
    position: relative;
}

.fight-stats h3 {
    color: #55ff55;
    font-size: 14px;
    text-shadow: 2px 2px #000;
}

.fight-stats p {
    font-size: 10px;
    margin: 5px 0;
}

.hp-bar {
    background: #444;
    border: 2px solid #e0e0e0;
    height: 10px;
    position: relative;
}

.hp-fill {
    background: #ff5555;
    height: 100%;
    transition: width 0.5s;
}

.fight-portrait {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    margin: 10px auto;
}

.shake {
    animation: shake 0.2s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.damage-text {
    position: absolute;
    color: #ff5555;
    font-size: 12px;
    text-shadow: 1px 1px #000;
    animation: float 1s ease-out forwards;
}

@keyframes float {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.fight-timer {
    font-size: 12px;
    color: #ff5555;
    text-shadow: 2px 2px #000;
    margin-top: 10px;
}