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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a1a;
    color: #eee;
    min-height: 100vh;
}

.screen {
    min-height: 100vh;
}

.hidden {
    display: none;
}

#landing-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a1a 100%);
}

.logo-container {
    text-align: center;
}

.logo {
    width: 400px;
    height: 150px;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: #4ecca3;
    letter-spacing: 0.5rem;
    text-transform: uppercase;
}

.auth-container {
    background: #16213e;
    padding: 2rem;
    border-radius: 12px;
    width: 350px;
    border: 1px solid #0f3460;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: #0f3460;
    color: #aaa;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tab.active {
    background: #e94560;
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-desc {
    text-align: center;
    color: #aaa;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.auth-container form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-container input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #0f3460;
    border-radius: 4px;
    background: #0a0a1a;
    color: #eee;
}

.auth-container input:focus {
    outline: none;
    border-color: #e94560;
}


.primary-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, #e94560, #ff8800);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.primary-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.5);
}

#message-area {
    text-align: center;
    padding: 0.5rem;
    min-height: 2rem;
    color: #4ecca3;
    font-size: 0.9rem;
}

#message-area.error {
    color: #e94560;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: #16213e;
    border-bottom: 2px solid #0f3460;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-link {
    text-decoration: none;
}

.user-badge {
    background: #0f3460;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #4ecca3;
}

.admin-link {
    color: #ff8800;
    text-decoration: none;
    font-size: 0.85rem;
}

.admin-link:hover {
    text-decoration: underline;
}

#turn-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

#action-buttons {
    display: flex;
    gap: 0.5rem;
}

#action-buttons button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: #0f3460;
    color: #eee;
    cursor: pointer;
    transition: all 0.2s;
}

#action-buttons button:hover:not(:disabled) {
    background: #e94560;
}

#action-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.help-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #0f3460;
    color: #eee;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.help-btn:hover {
    background: #e94560;
}

#opponent-area, #player-area {
    padding: 1rem 2rem;
}

.player-info {
    display: flex;
    gap: 1.5rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.player-name {
    font-weight: bold;
    color: #e94560;
}

.life {
    color: #4ecca3;
}

.mana {
    color: #66b5ff;
}

.hand {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    min-height: 140px;
    flex-wrap: wrap;
}

.battlefield {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    min-height: 110px;
    flex-wrap: wrap;
    background: #16213e;
    border-radius: 8px;
    margin: 0.5rem 0;
    border: 1px solid #0f3460;
}

.card {
    width: 110px;
    padding: 0.4rem;
    background: #0f3460;
    border: 2px solid #1a1a2e;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.7rem;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    border-color: #e94560;
    z-index: 10;
}

.card.selected {
    border-color: #4ecca3;
    box-shadow: 0 0 10px #4ecca3;
}

.card.tapped {
    opacity: 0.6;
    transform: rotate(90deg);
}

.card .card-art {
    width: 100%;
    height: 50px;
    margin-bottom: 0.25rem;
    background: #16213e;
    border-radius: 4px;
    overflow: hidden;
}

.card .card-art svg {
    width: 100%;
    height: 100%;
}

.card .card-name {
    font-weight: bold;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card .card-cost {
    color: #66b5ff;
    font-size: 0.65rem;
}

.card .card-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 0.2rem;
    color: #4ecca3;
}

.card .card-type {
    font-size: 0.6rem;
    color: #888;
    text-transform: uppercase;
}

.card .card-desc {
    font-size: 0.55rem;
    color: #aaa;
    margin-top: 0.2rem;
    line-height: 1.2;
}

.card-back {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, #e94560, #0f3460);
    border-radius: 6px;
    border: 2px solid #1a1a2e;
    position: relative;
    overflow: hidden;
}

.card-back::after {
    content: "Q";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.3);
    font-family: serif;
}

#player-hand .card.playable {
    border-color: #4ecca3;
}

#player-hand .card.unaffordable {
    opacity: 0.5;
}

#ai-actions-log {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: #16213e;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    max-width: 200px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #0f3460;
}

#ai-actions-log div {
    padding: 0.2rem 0;
    color: #aaa;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: #16213e;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #0f3460;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #0f3460;
}

.modal-header h2 {
    color: #e94560;
}

.close-btn {
    background: none;
    border: none;
    color: #eee;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.help-section {
    margin-bottom: 1.5rem;
}

.help-section h3 {
    color: #4ecca3;
    margin-bottom: 0.5rem;
}

.help-section p, .help-section li {
    color: #aaa;
    line-height: 1.6;
    font-size: 0.9rem;
}

.help-section ol, .help-section ul {
    padding-left: 1.5rem;
}

.card-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.preview-card {
    background: #0f3460;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.preview-card strong {
    color: #e94560;
}

.preview-card span {
    display: block;
    color: #888;
    font-size: 0.7rem;
}

#admin-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: #16213e;
    border-bottom: 2px solid #0f3460;
}

#admin-header h1 {
    color: #e94560;
    flex: 1;
}

#admin-content {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.admin-section {
    margin-bottom: 2rem;
}

.admin-section h2 {
    color: #4ecca3;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #0f3460;
}

.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.card-list-item {
    background: #0f3460;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #1a1a2e;
}

.card-list-item h4 {
    color: #e94560;
    margin-bottom: 0.25rem;
}

.card-list-item p {
    color: #aaa;
    font-size: 0.8rem;
}

.card-list-item .card-meta {
    color: #66b5ff;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.card-list-item .delete-btn {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: #e94560;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.75rem;
}

.add-card-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: #0f3460;
    padding: 1.5rem;
    border-radius: 8px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-row.full {
    grid-column: 1 / -1;
}

.form-row label {
    color: #aaa;
    font-size: 0.85rem;
}

.form-row input, .form-row select, .form-row textarea {
    padding: 0.5rem;
    background: #0a0a1a;
    border: 1px solid #1a1a2e;
    border-radius: 4px;
    color: #eee;
    font-size: 0.9rem;
}

.form-row textarea {
    min-height: 60px;
    resize: vertical;
}

.user-list {
    display: grid;
    gap: 0.5rem;
}

.user-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f3460;
    padding: 0.75rem 1rem;
    border-radius: 4px;
}

.user-list-item select {
    padding: 0.25rem 0.5rem;
    background: #0a0a1a;
    border: 1px solid #1a1a2e;
    border-radius: 4px;
    color: #eee;
}

.error-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1rem;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a1a 100%);
}

.error-screen h1 {
    font-size: 6rem;
    color: #e94560;
}

.error-screen h2 {
    color: #ff8800;
}

.error-screen p {
    color: #aaa;
}
