:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --bg-input: #1a1a3e;
    --accent: #e94560;
    --accent-hover: #ff6b81;
    --text-primary: #111;
    --text-secondary: #333;
    --text-muted: #555;
    --border: #2a2a4e;
    --success: #4ecdc4;
    --warning: #f7b731;
    --gold: #f5cd79;
    --purple: #b388ff;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Garamond, 'EB Garamond', Georgia, serif;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    background-image: url('page-background.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--text-primary);
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 0 20px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    color: var(--gold);
    text-shadow: 2px 2px 4px var(--shadow);
    letter-spacing: 2px;
}

.header .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 5px;
}

/* Step Progress */
.step-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.step-dot {
    width: 48px;
    height: 48px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    background: url('circle.png') center/contain no-repeat;
    color: #3a2a1a;
    border: none;
    transition: all 0.3s;
}

.step-dot.active {
    background: linear-gradient(rgba(135, 206, 250, 0.3), rgba(135, 206, 250, 0.3)), url('circle.png') center/contain no-repeat;
    color: #1a1a4a;
    border: none;
    transform: scale(1.15);
}

.step-dot.completed {
    background: linear-gradient(rgba(144, 238, 144, 0.35), rgba(144, 238, 144, 0.35)), url('circle.png') center/contain no-repeat;
    color: #2a5a2a;
    border: none;
}

/* Step Content */
.step-title {
    font-size: 1.8rem;
    color: #111111;
    margin-bottom: 8px;
}

.step-desc {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.5;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.card {
    background: url('large-border.png') center/100% 100% no-repeat;
    border: none;
    border-radius: 0;
    padding: 45px 40px;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    color: #3a2a1a;
    text-align: center;
}

.card:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.08);
    box-shadow: none;
}

.card.selected {
    border: none;
    filter: drop-shadow(0 0 8px rgba(100, 180, 255, 0.5));
    background: linear-gradient(rgba(135, 206, 250, 0.25), rgba(135, 206, 250, 0.25)), url('large-border.png') center/100% 100% no-repeat;
    box-shadow: none;
}

.card .card-title {
    font-size: 1.15rem;
    font-weight: bold;
    color: #3a2a1a;
    margin-bottom: 6px;
}

.card .card-body {
    color: #4a3a2a;
    font-size: 0.9rem;
    line-height: 1.4;
}

.skill-option-card {
    background: url('oval.png') center/100% 100% no-repeat !important;
    padding: 25px 20px !important;
}

.skill-option-card.selected {
    background: linear-gradient(rgba(135, 206, 250, 0.25), rgba(135, 206, 250, 0.25)), url('oval.png') center/100% 100% no-repeat !important;
}

.card .card-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-top: 8px;
}

.card .card-badge.green {
    background: var(--success);
    color: var(--bg-primary);
}

.card .card-badge.purple {
    background: var(--purple);
}

/* Species Group Tabs */
.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 20px 40px;
    border: none;
    border-radius: 0;
    background: url('oval.png') center/100% 100% no-repeat;
    color: #3a2a1a;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s;
    min-width: 150px;
    min-height: 55px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tab-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.tab-btn.active {
    filter: brightness(1.15) drop-shadow(0 0 6px rgba(100, 180, 255, 0.5));
    background: linear-gradient(rgba(135, 206, 250, 0.2), rgba(135, 206, 250, 0.2)), url('oval.png') center/100% 100% no-repeat;
    color: #2a1a0a;
}

/* Ability tags */
.ability-tag {
    display: inline-block;
    background: rgba(179, 136, 255, 0.2);
    color: var(--purple);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin: 3px 2px;
}

/* Form elements */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

select option {
    background-color: #d4b896;
    color: #2a1a0a;
    padding: 6px;
}

/* Attribute allocator */
.attr-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.attr-name {
    width: 140px;
    font-weight: bold;
    color: #1a2a6e;
}

.attr-value {
    font-size: 1.4rem;
    font-weight: bold;
    width: 40px;
    text-align: center;
    color: #1a5a2a;
}

.attr-bonus {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex: 1;
}

.attr-btn {
    width: 42px;
    height: 42px;
    border-radius: 0;
    border: none;
    background: url('circle.png') center/contain no-repeat;
    color: #3a2a1a;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.attr-btn:hover:not(:disabled) {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.attr-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Remaining points display */
.points-remaining {
    text-align: center;
    padding: 0 150px 0 300px;
    background: url('package-selection-banner.png') center/contain no-repeat;
    border-radius: 0;
    margin-bottom: 20px;
    font-size: 1.95rem;
    color: #ffffff;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.points-remaining .count {
    color: #00ff55;
    font-size: 1.5rem;
    font-weight: bold;
}

.points-remaining .count.zero {
    color: #8a2a1a;
}

/* Navigation buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.btn {
    padding: 18px 40px;
    border: none;
    border-radius: 0;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: url('app-button.png') center/contain no-repeat;
    color: #90ee90;
    min-width: 240px;
    min-height: 60px;
    text-shadow: 0 1px 1px rgba(255,255,255,0.3);
}

.btn-primary {
    color: #90ee90;
}

.btn-primary:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.btn-secondary {
    color: #90ee90;
}

.btn-secondary:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.btn-success {
    color: #90ee90;
}

.btn-success:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* Life Path Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding: 25px 50px;
    background: url('life-path.png') center/100% 100% no-repeat;
    border-radius: 0;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-primary);
}

.timeline-item.filled::before {
    background: var(--success);
}

.timeline-age {
    font-weight: bold;
    color: #ffffff;
    font-size: 1.3rem;
}

/* Equipment Shop */
.shop-section {
    margin-bottom: 25px;
}

.shop-section h3 {
    color: #111111;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.shop-table {
    width: 100%;
    border-collapse: collapse;
}

.shop-table th {
    background: var(--bg-secondary);
    color: #ffffff;
    padding: 10px;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.shop-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.shop-table tr:hover {
    background: rgba(233, 69, 96, 0.05);
}

.shop-table .cost {
    color: #b8860b;
    font-weight: bold;
}

.buy-btn {
    padding: 4px 14px;
    border: 1px solid #2a6e2a;
    border-radius: 5px;
    background: transparent;
    color: #2a6e2a;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.buy-btn:hover {
    background: #2a6e2a;
    color: white;
}

.buy-btn.remove {
    border-color: var(--accent);
    color: var(--accent);
}

.buy-btn.remove:hover {
    background: var(--accent);
    color: white;
}

/* Gold display */
.gold-display {
    position: sticky;
    top: 10px;
    z-index: 10;
    background: url('equipment-banner.png') center/100% 100% no-repeat;
    padding: 20px 40px;
    border-radius: 0;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: #ffffff;
    min-height: 60px;
}

.gold-amount {
    font-size: 1.4rem;
    font-weight: bold;
    color: #111111;
    margin-right: 48px;
}

/* Character Sheet */
.sheet {
    background: transparent;
    border: none;
    border-radius: 15px;
    padding: 30px;
}

.sheet-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.sheet-header h1 {
    font-size: 2.2rem;
    color: #5a3a1a;
}

.sheet-header .char-info {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 5px;
}

.sheet-section {
    margin-bottom: 25px;
}

.sheet-section h2 {
    color: var(--accent);
    font-size: 1.3rem;
    margin-bottom: 12px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.stat-box {
    background: url('blank.png') center/contain no-repeat;
    padding: 38px 25px;
    border-radius: 0;
    text-align: center;
    border: none;
    min-height: 150px;
}

.stat-box .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: bold;
}

.stat-box .stat-value {
    font-size: 1.8rem;
    font-weight: normal;
    color: #111111;
}

.stat-box.highlight {
    border-color: var(--gold);
}

.stat-box.highlight .stat-value {
    color: #111111;
}

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

.skill-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    background: transparent;
    border-radius: 6px;
    font-size: 0.9rem;
}

.skill-row .skill-name {
    color: var(--text-secondary);
}

.skill-row .skill-val {
    font-weight: bold;
    color: var(--success);
}

.skill-row .skill-val.zero {
    color: var(--text-muted);
}

.ability-list {
    list-style: none;
}

.ability-list li {
    padding: 10px 14px;
    margin-bottom: 8px;
    background: transparent;
    border-radius: 8px;
    border-left: 4px solid var(--purple);
}

.ability-list li strong {
    color: #5a3a1a;
}

.ability-list li .ability-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 3px;
}

/* Inventory Section */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.inv-item {
    background: #d4b896;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.inv-item .item-name {
    font-weight: bold;
    color: var(--gold);
}

.inv-item .item-detail {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 3px;
}

/* "No Selection" placeholder style */
.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-style: italic;
}

/* Print styles */
@media print {
    body { background: white; color: black; }
    .btn, .nav-buttons, .no-print { display: none; }
    .sheet { border: 1px solid #ccc; }
    .stat-box { border: 1px solid #ccc; }
    .stat-box .stat-value { color: #333; }
}

/* Landing page */
.landing {
    text-align: center;
    padding: 60px 20px;
}

.landing h1 {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px var(--shadow);
}

.landing .tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.landing .start-btn {
    padding: 20px 80px;
    font-size: 1.3rem;
    min-width: 480px;
    min-height: 120px;
}

/* detail-panel for info flyouts */
.detail-panel {
    background: url('big-info-background.png') center/100% 100% no-repeat;
    border: none;
    border-radius: 0;
    padding: 55px 90px;
    margin-top: 20px;
    color: #3a2a1a;
    text-align: center;
}

.detail-panel h3 {
    color: #3a2a1a;
    margin-bottom: 10px;
}

/* Two-column layout */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .two-col {
        grid-template-columns: 1fr;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .header h1 {
        font-size: 1.8rem;
    }
}

/* checkbox card variant for packages */
.card .check-mark {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.card.selected .check-mark {
    background: var(--success);
    border-color: var(--success);
    color: var(--bg-primary);
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    background: var(--success);
    color: var(--bg-primary);
    font-weight: bold;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background: var(--accent);
    color: white;
}
