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

:root {
    --bg-dark: #0a0a0a;
    --bg-medium: #1a1a1a;
    --bg-card: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-green: #4ade80;
    --accent-red: #ef4444;
    --accent-yellow: #fbbf24;
    --border: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('img/bg.jpg') center center / cover no-repeat fixed, linear-gradient(135deg, var(--bg-dark) 0%, #1a0f0f 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(74, 222, 128, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

h1 {
    font-size: 3rem;
    color: var(--accent-green);
    text-shadow:
        0 0 20px rgba(74, 222, 128, 0.5),
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 0 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-style: italic;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 8px rgba(0, 0, 0, 0.8);
}

.tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    background: var(--bg-medium);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.tab-button {
    padding: 0.75rem 1rem;
    background: transparent;
    border: 2px solid transparent;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.2), transparent);
    transition: left 0.5s ease;
}

.tab-button:hover::before {
    left: 100%;
}

.tab-button:hover {
    background: var(--bg-card);
    border-color: var(--accent-green);
    transform: translateY(-2px);
}

.tab-button.active {
    background: var(--accent-green);
    color: var(--bg-dark);
    border-color: var(--accent-green);
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

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

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

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--accent-green);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px);
}

h2 {
    color: var(--accent-green);
    font-size: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h3 {
    color: var(--accent-yellow);
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
}

.queekish-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    overflow-x: auto;
    display: block;
}

.queekish-table table {
    width: 100%;
}

.queekish-table th,
.queekish-table td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.queekish-table th {
    background: var(--bg-medium);
    color: var(--accent-green);
    font-weight: bold;
}

.queekish-table tr:hover {
    background: var(--bg-medium);
}

.rule-box {
    background: var(--bg-medium);
    border-left: 4px solid var(--accent-green);
    padding: 1rem;
    margin: 1rem 0;
}

.example {
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Flip Card Styles */
.rune-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.flip-card {
    background-color: transparent;
    width: 100%;
    height: 280px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

/* Only apply hover effect on devices with hover capability (not touch screens) */
@media (hover: hover) and (pointer: fine) {
    .flip-card:hover .flip-card-inner {
        transform: rotateY(180deg);
    }
}

.flip-card.locked .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card.locked:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 1rem;
    border: 2px solid var(--border);
}

.flip-card-front {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-medium) 100%);
    color: var(--accent-green);
}

.flip-card-front h4 {
    font-size: 3rem;
    margin: 0;
}

.flip-card-front p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.flip-card-back {
    background: linear-gradient(135deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    color: var(--text-primary);
    transform: rotateY(180deg);
    overflow-y: auto;
    justify-content: flex-start;
}

.flip-card-back img {
    max-width: 80px;
    max-height: 80px;
    margin-bottom: 0.5rem;
    filter: brightness(1.2);
    flex-shrink: 0;
}

.flip-card-back h5 {
    color: var(--accent-yellow);
    margin-bottom: 0.5rem;
    font-size: 1rem;
    flex-shrink: 0;
}

.flip-card-back p {
    font-size: 0.75rem;
    line-height: 1.3;
    color: var(--text-secondary);
    overflow-wrap: break-word;
}

.flip-hint {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1rem;
}

/* Font Download Styles */
.download-section {
    text-align: center;
    margin: 2rem 0;
}

.download-button {
    display: inline-block;
    padding: 1.25rem 2.5rem;
    background: var(--accent-green);
    color: var(--bg-dark);
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.download-button:hover {
    background: #22c55e;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.5);
}

.download-button:active {
    transform: translateY(-1px);
}

.instruction-box {
    background: var(--bg-medium);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.instruction-box h4 {
    text-align: left;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
}

.instruction-box code {
    background: var(--bg-dark);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Name Generator Styles */
.generator-section {
    background: var(--bg-medium);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
}

.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent-yellow);
    font-weight: bold;
}

select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

button {
    padding: 1rem 2rem;
    background: var(--accent-green);
    color: var(--bg-dark);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

button:hover {
    background: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
}

button:active {
    transform: translateY(0);
}

.result {
    background: var(--bg-dark);
    border: 2px solid var(--accent-green);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
    color: var(--accent-green);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(74, 222, 128, 0.3); }
    50% { box-shadow: 0 0 20px rgba(74, 222, 128, 0.6); }
}

footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 2px solid var(--border);
    color: var(--text-secondary);
}

footer a {
    color: var(--accent-green);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.skaven-icon {
    display: inline-block;
    animation: wiggle 1s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

/* Large screen navbar - horizontal layout */
@media (min-width: 769px) {
    .tabs {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tab-button {
        flex: 0 1 auto;
        width: auto;
    }
}

/* Mobile/tablet - stacked vertical layout */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .container { padding: 1rem; }
    .card { padding: 1rem; }

    .tabs {
        flex-direction: column;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .tab-button {
        width: 100%;
        flex: 1 0 100%;
        text-align: center;
        padding: 1rem;
        font-size: 1rem;
    }

    .tab-button:hover {
        transform: none;
    }

    .rune-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }
    .flip-card {
        height: 200px;
    }
}

ol, ul {
    margin-left: 2rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

ol li, ul li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

strong, b {
    color: var(--accent-green);
}
