/* ========================= */
/* Keeps - Global Styles     */
/* ========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    min-height: 100vh;
}

a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========================= */
/* Landing Page               */
/* ========================= */

.landing-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at 50% 30%, #1a1f2e 0%, #0d1117 70%);
}

.landing-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 540px;
    padding: 40px 24px;
    text-align: center;
}

.landing-hero {
    margin-bottom: 36px;
}

.landing-logo-container {
    margin-bottom: 16px;
}

.landing-logo-img {
    width: 220px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(241, 196, 15, 0.15), 0 0 60px rgba(241, 196, 15, 0.05);
}

.landing-tagline {
    font-size: 17px;
    color: #8b949e;
    letter-spacing: 0.5px;
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 320px;
    margin-bottom: 20px;
}

.btn-landing {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 8px;
    text-align: center;
    letter-spacing: 0.3px;
}

.btn-landing:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-download {
}

.landing-login-hint {
    font-size: 14px;
    color: #8b949e;
    margin-bottom: 16px;
}

.landing-spacer {
    flex: 1;
    min-height: 60px;
}

.landing-footer {
    width: 100%;
    border-top: 1px solid #21262d;
    padding-top: 24px;
    margin-top: auto;
}

.impressum h3 {
    font-size: 15px;
    color: #c9d1d9;
    margin-bottom: 10px;
    font-weight: 600;
}

.impressum p {
    font-size: 13px;
    color: #8b949e;
    line-height: 1.6;
    margin-bottom: 8px;
}

.impressum-contact {
    margin-top: 6px;
}

.impressum a {
    color: #58a6ff;
}

.impressum a:hover {
    text-decoration: underline;
}

/* ========================= */
/* App Layout                */
/* ========================= */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 200px;
    background: #161b22;
    border-right: 1px solid #21262d;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #21262d;
}

.logo {
    font-size: 22px;
    font-weight: 900;
    color: #f1c40f;
    letter-spacing: 3px;
}

.nav-menu {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}

.nav-link {
    display: block;
    padding: 10px 16px;
    color: #8b949e;
    font-size: 14px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: #c9d1d9;
    background: #21262d;
    text-decoration: none;
}

.nav-link.active {
    color: #f0f6fc;
    background: #1f2937;
    border-left-color: #f1c40f;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid #21262d;
    font-size: 13px;
}

.user-name {
    display: block;
    color: #c9d1d9;
    font-weight: bold;
    margin-bottom: 4px;
}

.logout-link {
    color: #8b949e;
    font-size: 12px;
}

.content {
    flex: 1;
    padding: 20px;
    overflow: auto;
}

/* ========================= */
/* Login Page                */
/* ========================= */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

.login-container {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 10px;
    padding: 32px;
    width: 340px;
    text-align: center;
}

.login-logo {
    font-size: 36px;
    font-weight: 900;
    color: #f1c40f;
    letter-spacing: 5px;
    margin-bottom: 4px;
}

.login-subtitle {
    color: #8b949e;
    font-size: 14px;
    margin-bottom: 24px;
}

.error-msg {
    background: #3d1a1a;
    color: #f85149;
    border: 1px solid #da3633;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 16px;
    font-size: 13px;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #8b949e;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #58a6ff;
}

/* ========================= */
/* Buttons                   */
/* ========================= */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    transition: all 0.15s;
    text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: #238636;
    color: #fff;
}
.btn-primary:hover { background: #2ea043; }

.btn-secondary {
    background: #1f6feb;
    color: #fff;
}
.btn-secondary:hover { background: #388bfd; }

.btn-full { width: 100%; }

/* ========================= */
/* Dashboard                 */
/* ========================= */

.dashboard h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.dash-card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 20px;
}

.dash-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #f0f6fc;
}

.dash-card p {
    color: #8b949e;
    font-size: 13px;
    margin-bottom: 14px;
}

.stats-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.stats-grid {
    display: flex;
    gap: 24px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #f1c40f;
}

.stat-label {
    font-size: 12px;
    color: #8b949e;
}

/* ========================= */
/* Online Players / Lobby    */
/* ========================= */

.online-section {
    margin-top: 24px;
    margin-bottom: 24px;
}

.online-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.online-count {
    background: #238636;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.online-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.online-placeholder {
    color: #8b949e;
    font-size: 13px;
}

.online-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 6px;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #3fb950;
    border-radius: 50%;
    flex-shrink: 0;
}

.online-name {
    flex: 1;
    font-size: 14px;
    color: #f0f6fc;
}

.btn-sm {
    padding: 5px 14px;
    font-size: 12px;
}

.waiting-msg {
    padding: 8px 14px;
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #f1c40f;
    font-size: 13px;
}

/* Challenge popup */
.challenge-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.challenge-popup-content {
    background: #161b22;
    border: 2px solid #f1c40f;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    min-width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.challenge-popup-content h3 {
    color: #f1c40f;
    font-size: 20px;
    margin-bottom: 12px;
}

.challenge-popup-content p {
    color: #c9d1d9;
    font-size: 15px;
    margin-bottom: 20px;
}

.challenge-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ========================= */
/* Feedback                  */
/* ========================= */

.feedback-form {
    max-width: 500px;
}

.feedback-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.feedback-form textarea:focus {
    outline: none;
    border-color: #58a6ff;
}

.success-msg {
    background: #1a3d1f;
    color: #3fb950;
    border: 1px solid #238636;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ========================= */
/* Deck Builder (MTG Arena)  */
/* ========================= */

.deckbuilder {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

/* Header */
.db-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #12100d;
    border-bottom: 1px solid #2a2318;
    margin-bottom: 0;
}
.db-title {
    font-size: 18px;
    color: #f1c40f;
    letter-spacing: 2px;
    white-space: nowrap;
    margin: 0;
}
.db-header-spacer { flex: 1; }
.db-select, .db-input {
    padding: 5px 10px;
    background: #0a0908;
    border: 1px solid #2a2318;
    border-radius: 4px;
    color: #c9d1d9;
    font-size: 13px;
}
.db-select:focus, .db-input:focus { outline: none; border-color: #f1c40f; }

/* Columns */
.db-columns {
    display: flex;
    gap: 2px;
    flex: 1;
    min-height: 0;
}

/* Left: Deck panel (narrow, ~28%) */
.db-col-left {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #110f0c;
    border-right: 1px solid #2a2318;
    overflow: hidden;
}
.db-col-left.drag-over { background: rgba(241, 196, 15, 0.04); }

.db-section-header {
    font-size: 12px;
    font-weight: 700;
    color: #f1c40f;
    padding: 6px 10px;
    background: #16130f;
    letter-spacing: 0.5px;
}
.db-divider { height: 1px; background: #2a2318; }

/* Keep slots */
.db-keeps-list { padding: 4px 6px; }
.db-keep-slot {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 3px;
    margin-bottom: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.1s;
}
.db-keep-slot.empty {
    background: #0d0b09;
    color: #3d352a;
    justify-content: center;
}
.db-keep-slot.filled {
    background: #16130f;
    border-left: 3px solid #888;
}
.db-keep-slot.filled:hover { background: #1e1a14; }
.db-keep-name { flex: 1; color: #c9d1d9; font-weight: 600; }
.db-keep-hp { color: #8b949e; font-size: 11px; }

/* Mana curve */
.db-mana-curve {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding: 4px 10px;
    height: 80px;
}
.db-curve-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}
.db-curve-count { font-size: 9px; color: #8b949e; margin-bottom: 2px; }
.db-curve-bar {
    width: 100%;
    background: #1e1a14;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: height 0.2s;
}
.db-curve-bar.filled { background: #f1c40f; }
.db-curve-label { font-size: 9px; color: #5a5040; margin-top: 2px; }

/* Deck card list */
.db-deck-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 6px;
}
.db-deck-entry {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 3px 6px 3px 0;
    border-radius: 3px;
    margin-bottom: 2px;
    background: #0d0b09;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.1s;
}
.db-deck-entry:hover { background: #1e1a14; }
.db-entry-strip { width: 3px; align-self: stretch; border-radius: 2px 0 0 2px; flex-shrink: 0; margin-right: 6px; }
.db-entry-qty { color: #f1c40f; font-weight: 700; min-width: 22px; text-align: center; }
.db-entry-name { flex: 1; color: #c9d1d9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-card-cost {
    background: #2a2318;
    color: #f1c40f;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 7px;
    min-width: 16px;
    text-align: center;
}

/* Right: Collection panel (wide, ~72%) */
.db-col-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0d0b09;
    overflow: hidden;
}
.db-col-right.drag-over { background: rgba(241, 196, 15, 0.03); }

/* Filter bar */
.db-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    background: #12100d;
    border-bottom: 1px solid #2a2318;
}
.db-filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.db-filter-sep { width: 1px; height: 18px; background: #2a2318; flex-shrink: 0; }

/* Search */
.db-search {
    padding: 4px 10px;
    background: #0a0908;
    border: 1px solid #2a2318;
    border-radius: 4px;
    color: #c9d1d9;
    font-size: 12px;
    width: 160px;
}
.db-search:focus { outline: none; border-color: #f1c40f; }

/* Color circle filters (MTG Arena style) */
.db-color-circles { display: flex; gap: 5px; }
.db-color-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #f1c40f;
    cursor: pointer;
    transition: all 0.15s;
}
.db-color-circle:not(.active) {
    opacity: 0.3;
    border-color: #2a2318;
}
.db-color-circle:hover { transform: scale(1.15); }

/* Type + Sort pills */
.db-type-pills, .db-sort-pills { display: flex; gap: 4px; }
.db-pill {
    padding: 2px 16px;
    min-width: 70px;
    background: #1e1a14;
    border: 1px solid #2a2318;
    border-radius: 3px;
    color: #8b949e;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.db-pill:hover { border-color: #5a5040; color: #c9d1d9; }
.db-pill.active { background: #8b5e10; border-color: #f1c40f; color: #fff; }
.db-pill.sort.active { background: #1a4a7a; border-color: #2980b9; }

/* Collection grid */
.db-collection-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    align-content: start;
}

/* Card tile (mini MTG card) */
.db-card-tile {
    background: #0a0908;
    border: 2px solid #2a2318;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
}
.db-card-tile:hover { border-color: #f1c40f; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
.db-card-tile.dragging { opacity: 0.4; }

.db-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
}
.db-card-name {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.db-card-art {
    height: 60px;
    background: #16130f;
}
.db-card-typeline {
    font-size: 10px;
    color: #3d352a;
    padding: 2px 8px;
    background: #e8e0d0;
    font-style: italic;
}
.db-card-desc {
    font-size: 10px;
    color: #3d352a;
    padding: 4px 8px;
    background: #e8e0d0;
    flex: 1;
    line-height: 1.3;
    overflow: hidden;
    max-height: 42px;
}
.db-card-stats {
    display: flex;
    justify-content: space-between;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.db-card-stats-center {
    text-align: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
