@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
    :root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #eef0f3;
    --surface-3: #e2e5e9;

    --text: #1a1c1f;
    --text-muted: #4a4e55;
    --text-light: #6b6f76;
    --text-faint: #9498a0;

    --border: #dfe2e6;
    --border-hover: #c3c7cd;

    --overlay: rgba(0,0,0,.3);

    --shadow: 0 1px 2px rgba(0,0,0,.06);

    --accent: #8c30d8;

    --col-game: 1fr;
    --col-id: 1fr;
    --col-type: 120px;
    --col-date: 140px;
    --col-tags: 160px;
    --int-col-status: 110px;
    --int-col-visibility: 90px;
}

    [data-theme="dark"] {
    --bg: #111315;
    --surface: #1b1d20;
    --surface-2: #23262a;
    --surface-3: #2d3136;

    --text: #f3f3f3;
    --text-muted: #cfcfcf;
    --text-light: #b2b2b2;
    --text-faint: #8b8b8b;

    --border: #3a3d42;
    --border-hover: #5a5f66;

    --overlay: rgba(0,0,0,.65);

    --shadow: 0 2px 10px rgba(0,0,0,.35);

    --accent: #a85df2;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    transition:
        background-color .35s ease,
        color .35s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.modal-body,
.detail-panel {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Scroll for desktop */
.modal-body::-webkit-scrollbar,
.detail-panel::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track,
.detail-panel::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb,
.detail-panel::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 8px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.detail-panel::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: var(--text-faint);
}

.btn-download {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: background .15s, border-color .15s;
}

.btn-download:hover {
    background: var(--surface-2);
    border-color: var(--border-hover);
}

.column {
    position: relative;
}

.column span {
    position: absolute;
    right: -5px;
    top: 0;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    z-index: 5;
    opacity:0;
}

.column span:hover {
    opacity:1;
    background: var(--border-hover);
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background:var(--surface);
    border-bottom:1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text);
}

.logo-text {
    font-weight: 700;
    background: linear-gradient(
        90deg,
        var(--text) 0%,
        var(--text) 35%,
        #8c30d8 50%,
        var(--text) 65%,
        var(--text) 100%
    );
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation:
        logoFadeIn 0.7s ease-out forwards,
        logoShine 4s ease-in-out 0.7s infinite;
}

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

@keyframes logoShine {
    0% {
        background-position: 200% center;
    }
    100% {
        background-position: -200% center;
    }
}

.logo-text-static {
    animation: logoShine 4s ease-in-out infinite;
}

.view-toggle {
    display: flex;
    gap: 4px;
    background:var(--surface-3);
    border-radius: 8px;
    padding: 3px;
}

.view-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color:var(--text-light);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-btn.active {
    background:var(--surface);
    color:var(--text);
    font-weight: 500;
    border:1px solid var(--border);
    box-shadow:var(--shadow);
}

.content {
    flex: 1;
    padding: 16px;
}

.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color:var(--text-faint);
    font-size: 14px;
    pointer-events: none;
}

.search-wrap input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.search-wrap input:focus {
    border-color: var(--text-faint);
}

.filter-select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.tab {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    transition: all 0.15s;
}

.tab.active {
    color: #8c30d8;
    border-bottom-color: #8c30d8;
    font-weight: 500;
}

/* Header */
.list-header {
    padding: 8px 14px;
    margin-bottom: 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border);
    border-radius: 0;

    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-faint);
}

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

.game-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.game-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;

    box-shadow: var(--shadow);
}

/* Animated border */
.game-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;

    background: linear-gradient(
        120deg,
        transparent,
        #8c30d8,
        transparent
    );

    background-size: 200% 200%;
    opacity: 0;
    transition: opacity .25s ease;

    pointer-events: none;

    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);

    mask-composite: exclude;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
}

.game-card:hover::before {
    opacity: 1;
    animation: cardBorderSweep 2s linear infinite;
}

.game-card:hover {
    transform: translateY(-4px);

    border-color: transparent;

    box-shadow:
        0 8px 25px rgba(140,48,216,.18);
}

@keyframes cardBorderSweep {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.game-card-id {
    font-family: "Inter", sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    border-left: 2px solid var(--accent);
    padding-left: 8px;
    margin-bottom: 10px;
}

.game-card-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.game-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.content {
    overflow-x: hidden;
}

.list-header,
.game-list {
    width: 100%;
    min-width: 0;
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
    flex-direction: column;
}

.list-header,
.game-row {
    display: grid;
    grid-template-columns:
        minmax(180px, var(--col-game))
        minmax(180px, var(--col-id))
        minmax(100px, var(--col-type))
        minmax(120px, var(--col-date))
        minmax(0, var(--col-tags));

    align-items: center;
    gap: 10px;
}

/* Rows */
.game-row {
    position: relative;

    padding: 12px 16px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;

    cursor: pointer;
    overflow: hidden;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

/* Animated border sweep */
.game-row::before {
    content: "";
    position: absolute;
    inset: 0;

    border-radius: inherit;
    padding: 1px;

    background: linear-gradient(
        120deg,
        transparent,
        #8c30d8,
        transparent
    );

    background-size: 200% 200%;
    opacity: 0;

    pointer-events: none;

    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);

    mask-composite: exclude;

    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);

    -webkit-mask-composite: xor;
}

.game-row:hover::before {
    opacity: 1;
    animation: borderMove 2s linear infinite;
}

.game-row:hover {
    border-color: transparent;

    box-shadow:
        0 8px 20px rgba(140,48,216,.16);

    transform: translateY(-2px);
}

@keyframes borderMove {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}
.game-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.game-id {
    font-family: "Iosevka", "Inter", monospace;
    letter-spacing: 0.03em;
    font-size: 11px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 7px;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    flex: 0 0 auto;
    color: var(--text-muted);
}

.game-type-badge {
    display: inline-flex;
    align-items: center;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}
.date-cell {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Tags */
.tags-cell {
    display: flex;
    gap: 3px;
    justify-content: flex-start;
    flex-wrap: wrap;
    min-width: 0;
    overflow: hidden;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.tag-ggl {
    background: #fffb00;
    color: #000000;
}

.tag-desktop {
    background: #8400ff;
    color: #ffffff;
}

.tag-mobile {
    background: #02ffff;
    color: #000000;
}

.tag-jackpot {
    background: #ff0000;
    color: #000000;
}

.tag-cert {
    background: #001dc0;
    color: #ffffff;
}

.tag-coming {
    background: #ff8400;
    color: #000000;
}

.tag-released {
    background: #91ff00;
    color: #000000;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-faint);
    font-size: 14px;
}

/* Detail panel */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    z-index: 100;
    display: flex;
    justify-content: flex-end;
}

.detail-panel {
    width: 480px;
    max-width: 96vw;
    background: var(--surface);
    height: 100%;
    overflow-y: auto;
    border-left: 1px solid var(--border);
}

.detail-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 10;
}

.detail-head-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.detail-game-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
}

.close-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-light);
    font-size: 18px;
    line-height: 1;
}

.close-btn:hover {
    background: var(--surface-2);
}

.detail-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.detail-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-section {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.detail-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 7px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.detail-item {
    padding: 9px 14px;
    border-bottom: 1px solid var(--surface-3);
}

.detail-item:last-child:nth-child(odd) {
    grid-column: span 2;
}

.detail-item-full {
    grid-column: span 2;
    padding: 9px 14px;
    border-bottom: 1px solid var(--surface-3);
}

.detail-item-full:last-child,
.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 11px;
    color: var(--text-faint);
    margin-bottom: 3px;
}

.detail-value {
    font-size: 13px;
    color: var(--text);
    word-break: break-word;
}

.cert-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--surface-3);
}

.cert-item:last-child {
    border-bottom: none;
}

.cert-name {
    font-size: 13px;
    font-weight: 500;
    color: #534ab7;
}

.cert-sub {
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 2px;
}

/* Internal */
.int-list-header {
    display: grid;
    grid-template-columns:
        minmax(150px, var(--col-game))
        minmax(160px, var(--col-id))
        minmax(90px, var(--col-type))
        minmax(110px, var(--int-col-status))
        minmax(90px, var(--int-col-visibility))
        44px;

    gap: 10px;
    padding: 8px 16px;
    margin-bottom: 8px;

    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border);
    border-radius: 0;

    font-size: 11px;
    font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.int-game-row {
    position: relative;
    display: grid;

    grid-template-columns:
        minmax(150px, var(--col-game))
        minmax(160px, var(--col-id))
        minmax(90px, var(--col-type))
        minmax(110px, var(--int-col-status))
        minmax(90px, var(--int-col-visibility))
        44px;

    align-items: center;
    gap: 10px;

    padding: 12px 16px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;

    cursor: default;
    overflow: hidden;

    transition:
        box-shadow .2s ease,
        transform .2s ease,
        border-color .2s ease;
}

/* Animated border sweep */
.int-game-row::before {
    content: "";
    position: absolute;
    inset: 0;

    border-radius: inherit;
    padding: 1px;

    background: linear-gradient(
        120deg,
        transparent,
        #8c30d8,
        transparent
    );

    background-size: 200% 200%;
    opacity: 0;

    pointer-events: none;

    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);

    mask-composite: exclude;

    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);

    -webkit-mask-composite: xor;
}

.int-game-row:hover::before {
    opacity: 1;
    animation: intBorderSweep 2s linear infinite;
}

.int-game-row:hover {
    border-color: transparent;

    transform: translateY(-2px);

    box-shadow:
        0 8px 20px rgba(140, 48, 216, .16);
}

@keyframes intBorderSweep {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}
.status-badge {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
    display: inline-block;
}

.status-visible {
    background: #5eff00;
    color: #000000;
}

.status-hidden {
    background: var(--surface-3);
    color: var(--text-faint);
}

.status-released {
    background: #ff00ff;
    color: #000000;
}

.status-coming {
    background: #ff8400;
    color: #000000;
}

.edit-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 14px;
}

.edit-btn:hover {
    background: var(--surface-2);
    border-color: var(--border-hover);
}

.btn-primary {
    padding: 7px 14px;
    background: #8c30d8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-primary:hover {
    background: #7728c0;
}

.btn-secondary {
    padding: 7px 14px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: var(--surface-2);
}

/* Modal */
.modal-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.modal {
    background: var(--surface);
    border-radius: 12px;
    width: 640px;
    max-width: 100%;
    max-height: 90vh;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
}

.modal-body {
    padding: 18px 20px;
    overflow-y: auto;
}

.modal-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  background: rgba(59, 130, 246, 0.08);
  border-bottom: 1px solid var(--border);
  opacity:0.6
}

/* Filter selections */
.filter-select option {
    color: var(--text);
}

.filter-select option[value=""] {
    color: var(--text-faint);
}

.filter-select:has(option:checked[value=""]),
.filter-select.placeholder {
    color: var(--text-faint);
}

/* Profile Style menu*/
.profile-menu {
    position: relative;
}

.profile-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8c30d8;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,.15);
    padding: 12px;
    z-index: 1100;
}

.profile-email {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;

  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;

  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s;
}

.profile-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

.internal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-section {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.form-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 7px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
}

.form-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-item.full {
    grid-column: span 2;
}

.form-label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
}

.form-input {
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--text-faint);
}

.form-select {
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    outline: none;
    font-family: inherit;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--text-faint);
}

.form-textarea {
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    outline: none;
    resize: vertical;
    min-height: 64px;
    font-family: inherit;
}

.form-textarea:focus {
    border-color: var(--text-faint);
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 4px;
}

/* Theme (Dark mode and Light mode animation*/
.theme-sweep {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.theme-sweep::after {
    content: "";
    position: absolute;
    top: -40%;
    left: -50%;
    width: 45%;
    height: 180%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(140, 48, 216, 0.16),
        transparent
    );

    transform: skewX(-18deg);

    animation: themeSweep .8s cubic-bezier(.65,0,.35,1) forwards;
}

@keyframes themeSweep {

    0% {
        left: -50%;
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    50% {
        opacity: 1;
    }

    100% {
        left: 130%;
        opacity: 0;
    }
}

.theme-transition {
    position: fixed;
    inset: 0;
    background: var(--surface);
    z-index: 9999;
    pointer-events: none;
    animation: themeFade .45s ease forwards;
}

@keyframes themeFade {
    0% {
        opacity: .8;
    }
    100% {
        opacity: 0;
    }
}

.theme-changing .game-card,
.theme-changing .game-row,
.theme-changing .detail-section,
.theme-changing .modal,
.theme-changing .form-section {
    animation: cardRefresh .45s cubic-bezier(.4,0,.2,1);
}

@keyframes cardRefresh {
    0% {
        opacity: .75;
        transform: scale(.985);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}
.theme-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform .25s ease,
        background .25s ease;
}

.theme-btn:hover {
    transform: translateY(-2px);
}

.theme-btn:active {
    transform: scale(.92);
}

.theme-btn:focus,
.theme-btn:focus-visible {
    outline: none;
    box-shadow: none;
}

.logo-img {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.layout-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid transparent;
}

.layout-btn.active {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.layout-btn:hover {
    background: var(--surface-2);
    transform: translateY(-1px);
}

/* PDF upload field */
.file-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    max-width: 100%;
}

.file-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.file-chip button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-faint);
    font-size: 13px;
    line-height: 1;
    padding: 0;
}

.file-chip button:hover {
    color: #d64545;
}

.file-hint {
    font-size: 11px;
    color: var(--text-faint);
}

/* Game Card background */
.game-card-thumb-bg {
    background-repeat: no-repeat;
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--surface);
    opacity: .12;
    transform: scale(1.05);
    transition:
        opacity .3s ease,
        transform .4s ease,
        filter .3s ease;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.15));
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.15));
    pointer-events: none;
    z-index: 0;
}

.game-card:hover .game-card-thumb-bg {
    opacity: .3;
    transform: scale(1.08);
    filter: saturate(1.15);
}

.game-card-header,
.game-card-body,
.game-card-tags,
.game-card-id,
.game-card-date {
    position: relative;
    z-index: 1;
}

/* Thumbnail upload preview */

.thumb-preview img {
    width: 80px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    border: 1px solid var(--border);
}

.thumb-preview button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-faint);
    font-size: 13px;
    line-height: 1;
    padding: 0 4px 0 0;
}

.thumb-preview button:hover {
    color: #d64545;
}

.thumb-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

.thumb-controls label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.thumb-controls input[type="range"] {
    width: 100%;
}

input[type="file"] {
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    margin-right: 10px;
}

input[type="file"]::file-selector-button:hover {
    background: var(--surface-3);
}

.form-range {
    width: 100%;
    accent-color: #8c30d8;
}

.layout-fade {
    animation: layoutFadeIn .35s cubic-bezier(.4,0,.2,1);
}

@keyframes layoutFadeIn {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Validation Banner*/
.validation-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(214, 69, 69, 0.08);
  border: 1px solid rgba(214, 69, 69, 0.35);
  border-left: 4px solid #d64545;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  animation: banner-in 0.2s ease-out;
}

.validation-banner i {
  color: #d64545;
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

.validation-banner-title {
  font-weight: 600;
  font-size: 13px;
  color: #d64545;
  margin-bottom: 4px;
}

.validation-banner-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--text, #333);
}

.validation-banner-list li {
  margin-bottom: 2px;
}

.validation-banner-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #d64545;
  opacity: 0.55;
  font-size: 13px;
  flex-shrink: 0;
  padding: 2px;
}

.validation-banner-close:hover {
  opacity: 1;
}

@keyframes banner-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.input-error {
    border: 2px solid #d64545 !important;
}

.input-error:focus {
    border-color: #d64545 !important;
    box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.2);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 260px;
    padding: 12px 16px;
    border-radius: 10px;

    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);

    box-shadow: 0 8px 25px rgba(0,0,0,.15);

    display: flex;
    align-items: center;
    gap: 10px;

    opacity: 0;
    transform: translateX(30px);

    animation: toast-in .25s ease forwards;
}

.toast.success {
    border-left: 4px solid #3fa34d;
}

.toast.error {
    border-left: 4px solid #d64545;
}

.toast.hide {
    animation: toast-out .25s ease forwards;
}


@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* Confirmation design */
.danger-btn {
    background: #d64545;
    border-color: #d64545;
}

.danger-btn:hover {
    opacity: .85;
}

.confirm-modal {
    max-width: 420px;
}

/* Phone aspect ratio */
@media (max-width: 720px) {

  .layout-btn-list,
  .layout-btn-cards {
    display: none;
  }

  .content { padding: 10px; }

  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .logo-text, .logo-img { font-size: 13px; }

  .filters { gap: 6px; }
  .search-wrap { min-width: 100%; }
  .filter-select, .btn-secondary, .btn-primary { flex: 1 1 auto; }

  .column span { display: none; }

  .list-header, .int-list-header { display: none; }

  .game-row, .int-game-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 16px;
    padding: 12px 14px;
  }

  .game-row > div,
  .int-game-row > div {
    min-width: 0;
    flex: 0 0 auto;
  }

  .game-row > div[data-label]::before,
  .int-game-row > div[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-faint);
    margin-bottom: 2px;
  }

  .game-row > div:first-child,
  .int-game-row > div:first-child,
  .tags-cell {
    flex-basis: 100%;
  }

  .int-game-row > div:last-child {
    margin-left: auto;
  }

  .game-cards, .game-card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .game-card { padding: 14px; }

  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 14px 14px 0 0;
  }

  .form-grid, .detail-grid {
    grid-template-columns: 1fr;
  }
  .form-item.full,
  .detail-item-full { grid-column: 1; }

  .profile-dropdown { width: 200px; }

  /* Touch targets */
  .theme-btn, .edit-btn, .close-btn {
    width: 40px;
    height: 40px;
  }

  /* Avoid iOS zoom on focus in main app forms too */
  .form-input, .form-select, .form-textarea, .search-wrap input {
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .view-toggle { gap: 2px; padding: 2px; }
  .theme-btn { width: 36px; height: 36px; }
  .tab { padding: 8px 10px; font-size: 12px; }
}