@font-face{
  font-family:"Montserrat";
  src:url("/static/fonts/Montserrat-Regular.ttf") format("truetype");
  font-weight:400;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Montserrat";
  src:url("/static/fonts/Montserrat-Italic.ttf") format("truetype");
  font-weight:400;
  font-style:italic;
  font-display:swap;
}
@font-face{
  font-family:"Montserrat";
  src:url("/static/fonts/Montserrat-SemiBold.ttf") format("truetype");
  font-weight:600;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Montserrat";
  src:url("/static/fonts/Montserrat-SemiBoldItalic.ttf") format("truetype");
  font-weight:600;
  font-style:italic;
  font-display:swap;
}
@font-face{
  font-family:"Montserrat";
  src:url("/static/fonts/Montserrat-Bold.ttf") format("truetype");
  font-weight:700;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Montserrat";
  src:url("/static/fonts/Montserrat-BoldItalic.ttf") format("truetype");
  font-weight:700;
  font-style:italic;
  font-display:swap;
}
:root{
  --bg:#161616; /* slightly lighter for more contrast */
  --card:#242424; /* lift card tone a touch */
  --muted:#bbb;   /* nudge muted text brighter */
}
html{height:100%}
body{font-family:"Montserrat","Segoe UI",Roboto,Arial,sans-serif; font-size:16px; line-height:1.5; letter-spacing:0.15px; background:var(--bg); color:#fff; margin:0;height:100%;display:flex;flex-direction:column}
small,.text-small,.small-text{font-weight:600;letter-spacing:0.05px;line-height:1.3}
header{display:flex;gap:12px;align-items:center;padding:16px;border-bottom:1px solid #222;justify-content:space-between;flex-shrink:0;position:sticky;top:0;z-index:1000;background:var(--bg)}
/* Fixed site header for the Full Reviews page */
.has-fixed-header > header{position:fixed;top:0;left:0;right:0}
.has-fixed-header main{padding-top:var(--header-h, 72px)}
.avatar-small{width:32px;height:32px;border-radius:50%;object-fit:cover;background:#333;display:inline-block}
.avatar-small.placeholder{display:flex;align-items:center;justify-content:center;color:#aaa;font-weight:700;font-size:14px}
header h1{margin:0;font-size:20px}
header nav,
header form#upload,
header form#search,
header .user-menu{display:flex;gap:8px;align-items:center}
.user-menu{margin-left:auto}
.user-menu .username{color:var(--muted);font-size:14px;margin-right:12px}
.logout-btn{background:#6e1f1f}
.logout-btn:hover{background:#5e1a1a}
input[type=file]{color:#fff}
main{padding:18px;flex:1;display:flex;flex-direction:column;max-width:1600px;margin:0 auto;width:100%}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(460px,1fr));gap:18px;max-width:1450px;margin:0 auto;width:100%}
.card{background:var(--card);padding:12px;border-radius:10px;display:flex;gap:12px;flex-wrap:wrap;align-items:flex-start;border:1px solid #333}
.cover{flex-shrink:0;width:100%;height:auto}
.cover{position:relative}
.cover img{width:100%;aspect-ratio:2/1;object-fit:cover;border-radius:6px;display:block}
.review-badge{position:absolute;top:6px;right:6px;width:24px;height:24px;background:#28a745;color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px;box-shadow:0 2px 4px rgba(0,0,0,0.3);z-index:10}
.nocover{width:100%;height:215px;min-height:215px;display:flex;align-items:center;justify-content:center;background:#333;border-radius:6px;color:var(--muted);box-sizing:border-box}
.meta{flex:1 1 100%;min-width:200px}
.meta h2{margin:0;font-size:18px;word-break:break-word}
.meta h2 a{transition:color 0.2s ease}
.meta h2 a:hover{color:#2b6fb2;cursor:pointer}
.meta .year{font-weight:400;color:var(--muted);font-size:13px}
.game-price{display:inline-block;background:#2b6fb2;color:#fff;padding:4px 10px;border-radius:6px;font-weight:700;font-size:14px}
.game-tags{display:inline-block;background:#333;color:var(--muted);padding:4px 10px;border-radius:6px;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:300px}
.full-list .covercol{width:220px}
.rowcover{width:220px;height:110px;object-fit:cover;border-radius:8px;display:block;visibility:visible;opacity:1}
.nocover.small{width:260px;height:130px;min-height:130px;display:flex;align-items:center;justify-content:center;background:#333;border-radius:10px;color:var(--muted);font-size:13px}
  .full-list .covercol{width:160px}
  .rowcover{width:160px;height:80px;object-fit:cover;border-radius:6px;display:block;visibility:visible;opacity:1}
.scores{display:flex;gap:4px;margin-top:4px;flex-wrap:wrap}
.score{width:72px;height:72px;border-radius:8px;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center}
.score .label{font-size:11px}
.score .value{font-weight:700;font-size:18px}
.score-featured{width:96px;height:96px;border-radius:10px;box-shadow:0 4px 12px rgba(0,0,0,0.4);transform:scale(1.05)}
.score-featured .label{font-size:13px;font-weight:600}
.score-featured .value{font-size:28px;font-weight:800}
.actions{margin-top:10px;display:flex;gap:8px;align-items:center}
.btn{background:#444;padding:6px 10px;border-radius:6px;color:#fff;text-decoration:none}
.btn:hover{background:#555}
.btn.danger{background:#6e1f1f;border:0}
.btn.danger:hover{background:#5e1a1a}
button.btn{border:0;box-shadow:none;appearance:none;-webkit-appearance:none}
.btn.backlog-action{display:inline-flex;align-items:center;gap:6px;line-height:1;font-size:12px;padding:0 9px;height:32px}
.btn.backlog-action svg{width:14px;height:14px}
.steam-btn{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;min-width:38px}
.steam-btn svg{display:block}
form.inline{display:inline;margin:0}
.empty{color:var(--muted);padding:40px;text-align:center}
.page-title .page-title-mobile{display:none}

/* Edit page */
.editpage{max-width:600px;margin:40px auto;padding:20px;background:var(--card);border-radius:8px}
.editpage label{display:block;margin:10px 0}
.editpage input{width:100%;padding:8px;border-radius:6px;border:0;background:#222;color:#fff}
.row{display:flex;gap:8px;margin-top:12px}

/* Removed - consolidated into main mobile breakpoints below */

/* Full list table styles */
.full-list{width:100%;border-collapse:separate;border-spacing:0 10px;table-layout:auto}
.table-wrap{position:relative;z-index:0;isolation:isolate}
.table-wrap{flex:1;padding:0 16px;box-sizing:border-box;display:flex;flex-direction:column}
/* Override overflow for pages with sticky table headers - let body scroll instead */
.has-fixed-header{overflow-y:auto}
.has-fixed-header .table-wrap{overflow:visible}
.full-list thead th{background:#0f0f0f;padding:12px 10px;text-align:center;vertical-align:middle;font-size:13px;color:var(--muted);box-sizing:border-box}
/* sticky first header row */
.full-list thead tr:first-child th{position:sticky;top:0;z-index:100;background:#0f0f0f;border-bottom:0}
/* Adjust sticky header position for pages with fixed header */
.has-fixed-header .full-list thead tr:first-child th{top:var(--header-h, 72px)}
/* sticky subheader row (second row) - sits below the first header row */
.full-list thead tr.subheaders th{position:sticky;top:auto;z-index:99;background:#0f0f0f;border-top:0;transform:translateY(-10px)}
.full-list thead tr:first-child th:first-child{border-top-left-radius:10px}
.full-list thead tr:first-child th:last-child{border-top-right-radius:10px}
.full-list thead tr:first-child th{box-shadow: inset 0 -1px 0 rgba(255,255,255,0.02)}
/* Constrain first column so cover can move left */
.full-list thead th:first-child{width:44px;padding-left:6px;padding-right:6px;text-align:center}
/* Use td backgrounds so we can round row edges */
.full-list td{padding:8px 8px;vertical-align:middle}
.full-list tbody td{background:#0b0b0b;border-top:1px solid rgba(255,255,255,0.02);position:relative;z-index:1}
.full-list tbody tr{display:table-row}
.full-list tbody tr{min-height:96px}
/* Ghost placeholder row and drag proxy styles */
.ghost-row td{background:rgba(43,111,178,0.18) !important; border:1px dashed #2b6fb2;}
.drag-proxy{position:fixed; z-index:9999; pointer-events:none; opacity:0.95; transform:translateZ(0);}
.drag-proxy .rowcover{visibility:hidden}
.full-list thead th.actions-header{width:44px}
.full-list tbody tr + tr td{margin-top:8px}
/* Round first/last cell corners to create rounded row outline */
.full-list tbody td:first-child{border-top-left-radius:10px;border-bottom-left-radius:10px}
.full-list tbody td:last-child{border-top-right-radius:10px;border-bottom-right-radius:10px}
.full-list .rank{width:44px;color:var(--muted);white-space:nowrap;text-align:center}
.full-list .covercol{width:130px}
.full-list .gamename{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:400px;text-align:left;}
.full-list .gamename a{transition:color 0.2s ease}
.full-list .gamename a:hover{color:#2b6fb2;cursor:pointer}
.full-list .yearcol{width:40px;color:var(--muted);white-space:nowrap;text-align:left;}
/* Playtime column replacing year */
.full-list .playtimecol{width:50px;color:var(--muted);white-space:nowrap;text-align:center;padding-right:50px}
  .rowcover{width:180px;height:90px;object-fit:cover;border-radius:8px;display:block;visibility:visible;opacity:1;margin:8px auto;}
  .rowcover{width:260px;height:130px;object-fit:cover;border-radius:10px;display:block;visibility:visible;opacity:1}
.scorescol{width:220px;text-align:center;display:flex;gap:-8px;align-items:center}
.scores-inline{display:flex;gap:3px;align-items:center;justify-content:flex-start}
.scores-inline .badge{flex:0 0 56px}
.scores-header{padding:6px 0;text-align:center;width:248px}
.scores-header{padding:6px 0;text-align:center;width:336px}
.full-list thead tr.subheaders th.sub{padding-top:6px;font-size:12px;color:var(--muted);text-align:center;width:84px;padding-bottom:6px}
.full-list thead tr.subheaders th.playtime-header{padding-right:50px}
/* Make clickable header cells visibly interactive */
.full-list thead tr.subheaders th.sort-header a{cursor:pointer}

/* individual score cells align with subheaders */
.scorecell{width:84px;text-align:center;vertical-align:middle;padding:4px 8px}
.scores-inline{justify-content:center}
/* Ensure badges never expand: stronger rule */
.badge{width:56px;height:56px;min-width:56px;max-width:56px;min-height:56px;max-height:56px;flex:0 0 56px;border-radius:12px;color:#fff;font-weight:800;display:flex;align-items:center;justify-content:center;font-size:15px;box-sizing:border-box;white-space:nowrap;line-height:1;padding:0;margin:0 auto;}
.badge.empty{background:#666;color:#eee;width:56px;height:56px;min-width:56px;max-width:56px;min-height:56px;max-height:56px}
.full-list .metacol{width:84px;text-align:center}
.full-list .devcol{width:84px;text-align:center}
.full-list .genrescol{width:180px;text-align:right;padding-left:0;padding-right:10px;vertical-align:middle;overflow:hidden}
.full-list thead th:last-child{ text-align:right; padding-right:10px; }
.genre-tags{justify-content:flex-end}
.full-list td{box-sizing:border-box}
.full-list th{box-sizing:border-box}
.genre-tags{display:flex;flex-wrap:wrap;gap:4px;align-items:flex-start}
.genre-tag{display:inline-block;background:#3a3a3a;color:#ddd;padding:3px 8px;border-radius:4px;font-size:12px;border:1px solid #555;white-space:nowrap}
.full-list .musiccol{width:36px;text-align:center;padding:8px 2px}
.full-list .musiccol a {width:36px;height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0;border-radius:6px;box-sizing:border-box;line-height:0;}
.full-list .editcol, .full-list .deletecol {width:36px;text-align:center;padding:8px 2px;}
/* Stack action buttons vertically */
.action-buttons {display: flex; flex-direction: column; gap: 8px; align-items: flex-end; margin-right:0;}
.action-buttons .btn.backlog-action{justify-content:flex-start;min-width:84px}
.full-list tbody tr:nth-child(odd) td{background:#0c0c0c}
.full-list tbody tr:hover td{background:#1e1e1e}
.full-list{flex:1}
.reviews-page .full-list,
.backlog-page .full-list{flex:0 0 auto}
.full-list tbody{display:table-row-group}
.fulltable{display:flex;flex-direction:column;flex:1}
.fulltable .table-wrap{flex:1;display:flex;flex-direction:column;margin:0;padding-left:0;padding-right:0;overflow:visible}

/* Tighter alignment: push cover left, buttons right */
.full-list .covercol .rowcover{margin:8px 0;}
.full-list .covercol{padding-left:12px;padding-right:8px}
.full-list .gamename{padding-left:80px}
.full-list thead th.cover-header{padding-left:12px}
.full-list .covercol .rowcover{margin-left:0 !important;margin-right:0 !important}
.full-list tbody td:last-child{padding-right:12px;text-align:right;vertical-align:middle}
.full-list .btn{padding:4px 8px;font-size:13px;white-space:nowrap}

/* Backlog-specific adjustments */
.full-list .gamename{max-width:400px}
.full-list .genrescol{max-width:120px;width:120px;text-align:left;overflow:hidden}
.full-list .genre-tags{justify-content:flex-start;flex-wrap:wrap}
.full-list .genre-tag{font-size:12px;padding:2px 6px}

/* Rank input for manual reordering */
.rank-input{width:40px;padding:4px;background:#222;color:#fff;border:1px solid #444;border-radius:4px;text-align:center;font-size:13px}
.rank-input:focus{outline:none;border-color:#2b6fb2}
.rank-input::-webkit-outer-spin-button,
.rank-input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0 }
.rank-input{ -moz-appearance:textfield }
.mobile-rank-input::-webkit-outer-spin-button,
.mobile-rank-input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0 }
.mobile-rank-input{ -moz-appearance:textfield }

/* Desktop rank controls */
.full-list .rank-controls{display:flex;flex-direction:column;align-items:center;gap:8px}
.full-list .rank-move{border:0;background:#2a2a2a;color:#cfd3d8;width:26px;height:22px;border-radius:7px;font-size:12px;line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.full-list .rank-move:active{transform:translateY(1px)}
.full-list .rank-display{font-weight:800;color:var(--muted);font-size:14px;line-height:1}

/* Music link button */
.full-list .musiccol a{display:inline-block;background:#2b6fb2;color:#fff;padding:3px 6px;border-radius:6px;text-decoration:none;font-weight:700}
.full-list .musiccol a:hover{background:#245f9a}

/* Icon button styles */
.btn.icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border-radius:6px;box-sizing:border-box;line-height:0;background:#444;color:#fff;}
.btn.icon svg{width:16px;height:16px;}
.btn.icon.danger{background:#6e1f1f;border:0;}
.btn.icon.danger:hover{background:#5e1a1a;}
button.btn.icon{border:0;background:inherit;}
button.btn.icon:focus{outline:0;}
.btn.icon svg{width:16px;height:16px}
.btn.icon.danger{background:#6e1f1f;border:0}
.btn.icon.danger:hover{background:#5e1a1a}
button.btn.icon{border:0;background:inherit}
button.btn.icon:focus{outline:0}

/* Highlight active sorted column */
.sort-header a{position:relative}
.sort-arrow{font-weight:bold}
/* Hide backlog sort arrows on smaller desktops until hover/focus */
@media (max-width: 1200px) {
  .backlog-page .full-list thead .sort-arrow{opacity:0;transition:opacity 0.15s ease}
  .backlog-page .full-list thead th:hover .sort-arrow,
  .backlog-page .full-list thead th:focus-within .sort-arrow{opacity:1}
}
td[data-score-key]:has(~ td[data-score-key] .sort-header .sort-arrow) .badge,
.scorecell .badge{transition:transform 0.18s ease, box-shadow 0.18s ease}
/* Indicate score cells are clickable */
.scorecell .badge{cursor:pointer}
/* Stronger emphasis on active sort */
.badge.active-sort{transform:scale(1.14); box-shadow:0 0 0 2px rgba(255,255,255,0.10), 0 0 12px rgba(0,0,0,0.45); font-weight:900}
/* When a score column is being sorted, make badges slightly larger */
.full-list tbody td[data-score-key]:has(.badge) .badge{font-size:18px}
/* Enlarge badges in active sort column - we'll use JS for this */

/* Drag-and-drop visuals */
tr.draggable{cursor:grab}
tr.dragging{opacity:0.5; cursor:grabbing}
/* Smooth transform animations for swap preview, fast background transitions */
tbody tr{transition: transform 200ms cubic-bezier(0.2, 0, 0.2, 1), background-color 120ms ease}
/* Drop zone indicators */
tr.drag-over-before{box-shadow: 0 -3px 0 #2b6fb2 inset}
tr.drag-over-after{box-shadow: 0 3px 0 #2b6fb2 inset}

/* Modal styles */
.modal{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.7);z-index:10000;display:flex;align-items:center;justify-content:center}
.modal-content{background:var(--card);border-radius:12px;max-width:600px;width:90%;max-height:80vh;overflow:auto;box-shadow:0 8px 32px rgba(0,0,0,0.5)}
.modal-header{display:flex;justify-content:space-between;align-items:center;padding:20px;border-bottom:1px solid #333}
.modal-header h2{margin:0;font-size:22px}
.modal-close{background:transparent;border:0;color:#fff;font-size:32px;cursor:pointer;padding:0;width:32px;height:32px;line-height:32px;text-align:center}
.modal-close:hover{color:#f66}
.modal-body{padding:20px}
.add-game-modal{background:linear-gradient(180deg, rgba(5,6,10,0.92), rgba(5,6,10,0.85));backdrop-filter:blur(6px);padding:16px}
.add-game-card{background:radial-gradient(circle at top, rgba(118,75,162,0.18), rgba(17,17,17,0.98) 60%);border:1px solid rgba(118,75,162,0.4);border-radius:18px;padding:22px;box-shadow:0 20px 50px rgba(0,0,0,0.55);max-width:640px;width:min(640px, calc(100vw - 24px));max-height:calc(100vh - 32px);overflow:auto;box-sizing:border-box;margin:0 auto}
.add-game-card .modal-header{padding:0 0 12px;border-bottom:1px solid rgba(118,75,162,0.35)}
.add-game-card .modal-header h2{font-size:20px;color:#fff}
.add-game-card .modal-close{color:#b9b6c8;font-size:24px;width:28px;height:28px;line-height:28px;border:1px solid #3a3348;border-radius:50%}
.add-game-card .modal-close:hover{color:#fff;border-color:#667eea}
.add-game-card .modal-body{padding:14px 0 0}
.add-game-card .search-section label,
.add-game-card .new-game-form label{color:#cfd3d8;font-size:12px;letter-spacing:0.2px}
.add-game-card .search-section input,
.add-game-card .new-game-form input{background:#14121b;border:1px solid #3a3348;border-radius:10px;padding:10px 12px;color:#e7e7f0;font-size:13px;box-sizing:border-box;width:100%}
.add-game-card .search-results{background:#14121b;border:1px solid #3a3348;border-radius:12px}
.add-game-card .search-result-item{border-bottom:1px solid rgba(118,75,162,0.25)}
.add-game-card .divider{color:#b8a8d8}
.add-game-card .divider:before,.add-game-card .divider:after{background:rgba(118,75,162,0.4)}
.add-game-card .no-results{color:#b8a8d8}
.add-game-card .btn{background:#1b1824;border:1px solid #3a3348;color:#f1ecff}
.add-game-card .btn:hover{background:#241f31;border-color:#764ba2}
.search-section label{display:block;margin-bottom:8px;font-weight:600}
.search-section input{width:100%;padding:10px;border-radius:6px;border:1px solid #444;background:#222;color:#fff;font-size:14px}
.search-results{margin-top:12px;max-height:300px;overflow-y:auto;background:#1a1a1a;border-radius:6px;border:1px solid #333}
.search-result-item{padding:12px;border-bottom:1px solid #333;cursor:pointer;transition:background 150ms;display:flex;gap:12px;align-items:center}
.search-result-item:hover{background:#2a2a2a}
.search-result-item:last-child{border-bottom:0}
.result-cover-container{flex-shrink:0;width:80px;height:40px}
.result-cover{width:80px;height:40px;object-fit:cover;border-radius:4px;display:block}
.result-cover-placeholder{width:80px;height:40px;display:flex;align-items:center;justify-content:center;background:#333;border-radius:4px;color:var(--muted);font-size:11px}
.igdb-cover-preview{width:80px;height:40px;background:#000;display:flex;align-items:center;justify-content:center;border-radius:4px;overflow:hidden}
.igdb-cover-preview img{max-height:100%;max-width:100%;object-fit:contain}
.result-info{flex:1;min-width:0}
.result-name{font-weight:600;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.result-meta{font-size:13px;color:var(--muted)}
.no-results{padding:20px;text-align:center;color:var(--muted)}
.divider{text-align:center;margin:20px 0;color:var(--muted);position:relative}
.divider:before,.divider:after{content:'';position:absolute;top:50%;width:40%;height:1px;background:#333}
.divider:before{left:0}
.divider:after{right:0}
.add-new-section{text-align:center;margin:20px 0}
.new-game-form{margin-top:20px;padding:20px;background:#1a1a1a;border-radius:8px;border:1px solid #333}
.new-game-form h3{margin:0 0 16px 0;font-size:18px}
.new-game-form label{display:block;margin-bottom:12px}
.new-game-form input{width:100%;padding:8px;border-radius:6px;border:1px solid #444;background:#222;color:#fff;margin-top:4px}
.new-game-form .btn{margin-top:16px}

/* Feedback animations for non-draggable rows */
@keyframes flash-score {
  0%, 100% { transform: scale(1); opacity: 1; }
  25% { transform: scale(1.15); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 0.6; box-shadow: 0 0 20px currentColor; }
  75% { transform: scale(1.15); opacity: 0.8; }
}

@keyframes bump {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

.flash-score {
  animation: flash-score 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.bump-row {
  animation: bump 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet breakpoint (768px and below) */
@media (max-width: 768px) {
  /* Full-width grid for tablets and phones */
  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Game card mobile layout - stack cover above info */
  .card {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    padding: 12px !important;
    gap: 10px !important;
    box-sizing: border-box !important;
  }

  .card .cover {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
  }

  .card .cover img {
    width: 100% !important;
    aspect-ratio: 2/1;
    object-fit: cover;
  }

  .card .cover .nocover {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2/1;
    min-height: 150px;
  }

  .card .meta {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100%;
    margin-top: 0;
  }

  /* Header spacing */
  header {
    gap: 8px;
    padding: 12px;
  }

  header h1 {
    font-size: 18px;
  }

  /* Reduce score badge sizes */
  .score {
    width: 64px;
    height: 64px;
  }

  .score .label {
    font-size: 10px;
  }

  .score .value {
    font-size: 16px;
  }

  .score-featured {
    width: 84px;
    height: 84px;
  }

  .score-featured .value {
    font-size: 24px;
  }

  /* Toplists/Public lists mobile styles */
  .tabs-container {
    padding: 0 12px;
  }

  /* Stack tabs and actions vertically on mobile */
  .tabs-actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    width: 100% !important;
  }

  .tab-btn {
    display: inline-block !important;
    flex: 1 1 0 !important;
    padding: 8px 4px !important;
    font-size: 11px !important;
    min-width: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  .tabs-container .btn {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* Mobile breakpoint (480px and below) */
@media (max-width: 480px) {
  .page-title{font-size:22px !important}
  .page-title .page-title-desktop{display:none}
  .page-title .page-title-mobile{display:inline}
  /* Full-width grid on mobile */
  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 10px;
    box-sizing: border-box !important;
  }

  /* Main container padding */
  main {
    padding: 12px 10px !important;
    box-sizing: border-box !important;
  }

  /* Header mobile layout - two rows */
  header {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 8px 10px !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }

  /* Logo and nav container - split into two rows */
  header > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  header h1 {
    font-size: 18px !important;
    white-space: nowrap;
    margin: 0 !important;
    flex: 0 0 auto;
    padding-right: 90px;
  }

  /* Navigation buttons - extend to right edge below user menu */
  header nav {
    flex-wrap: nowrap !important;
    gap: 4px !important;
    width: 100% !important;
    justify-content: flex-start !important;
    overflow-x: auto;
    padding-right: 0 !important;
  }

  header nav .btn {
    flex: 1 1 auto !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    white-space: nowrap;
    min-width: 0;
  }

  /* User menu - stays on first row with logo */
  .user-menu {
    position: absolute !important;
    top: 10px;
    right: 12px;
    margin-left: 0 !important;
    gap: 6px !important;
    flex-shrink: 0;
  }

  /* Hide username text on mobile, keep avatar */
  .user-menu .username {
    display: none !important;
  }

  .user-menu .logout-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  /* Keep avatar normal size */
  .avatar-small {
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
  }

  /* Smaller buttons on mobile */
  .btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Make action buttons full-width or wrap better */
  .actions {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }

  .actions .btn {
    flex: 0 1 auto;
    min-width: 70px;
    text-align: center;
  }

  /* Reduce score badges for mobile */
  .score {
    width: 56px;
    height: 56px;
  }

  .score .label {
    font-size: 10px;
  }

  .score .value {
    font-size: 16px;
  }

  .score-featured {
    width: 72px;
    height: 72px;
  }

  .score-featured .label {
    font-size: 11px;
  }

  .score-featured .value {
    font-size: 22px;
  }

  /* Tighter game cards on small screens */
  .card {
    padding: 10px !important;
    gap: 8px !important;
  }

  .card .cover img {
    aspect-ratio: 2.6/1;
  }

  .card .cover .nocover {
    aspect-ratio: 2.6/1;
    min-height: 110px;
  }

  .scores {
    gap: 3px;
  }

  .score {
    width: 56px;
    height: 56px;
  }

  .score .label {
    font-size: 10px;
  }

  .score .value {
    font-size: 16px;
  }

  .score-featured {
    width: 72px;
    height: 72px;
  }

  .score-featured .label {
    font-size: 11px;
  }

  .score-featured .value {
    font-size: 22px;
  }

  .actions .btn {
    padding: 6px 8px;
    font-size: 12px;
  }

  /* Card meta adjustments */
  .meta h2 {
    font-size: 16px;
  }

  .game-tags {
    max-width: 100%;
  }

  /* Hide table-based lists on mobile for toplists only */
  .lists-page .full-list:not(#topList):not(#yearlyList):not(#yearlyListSelf):not(#yearlyListFriend) {
    display: none !important;
  }

  /* Show mobile card view on mobile */
  .mobile-card-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 60px 10px 12px 10px;
    margin-top: 0;
  }

  .mobile-card {
    background: var(--card);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #333;
    position: relative;
  }

  .mobile-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    align-items: flex-start;
  }

  .mobile-card-cover {
    flex-shrink: 0;
    width: 120px;
    order: 1;
  }

  .mobile-card-cover img {
    width: 100%;
    height: auto;
    border-radius: 6px;
  }

  .mobile-card-info {
    flex: 1;
    min-width: 0;
    order: 2;
  }
  .mobile-card-rank-controls {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    order: 0;
    margin-top: 2px;
  }

  .mobile-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    word-break: break-word;
  }

  .mobile-card-meta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
  }

  .mobile-card-scores {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 10px;
  }

  .mobile-card-score {
    background: #333;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
  }

  .mobile-card-score .label {
    font-size: 10px;
    color: var(--muted);
    display: block;
    margin-bottom: 2px;
  }

  .mobile-card-score .value {
    font-size: 16px;
    font-weight: 700;
    display: block;
  }

  .mobile-card-score.editable .value {
    cursor: pointer;
  }

  .mobile-card-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
  }

  .mobile-card-actions {
    display: flex;
    gap: 8px;
  }

  .mobile-card-actions .btn {
    flex: 1;
    text-align: center;
  }

  /* Mobile list view styles */
  .mobile-list-view {
    padding: 60px 10px 12px 10px;
    overflow-x: auto;
    display: none;
  }

  .mobile-list-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
  }

  .mobile-list-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #0f0f0f;
  }

  .mobile-list-table th {
    background: #0f0f0f;
    padding: 10px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #ddd;
    text-align: left;
    border-bottom: 2px solid #6b3dbb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    line-height: 1.1;
  }

  .mobile-list-table th.mobile-rank,
  .mobile-list-table th.mobile-score {
    text-align: center;
  }

  .mobile-list-table th.mobile-actions {
    text-align: right;
  }

  .mobile-list-table td {
    padding: 8px 4px;
    vertical-align: middle;
    background: #0b0b0b;
    border-bottom: 1px solid rgba(255,255,255,0.02);
  }

  .mobile-list-row {
    cursor: grab;
  }

  .mobile-list-row:active {
    cursor: grabbing;
  }

  .mobile-list-row.dragging {
    opacity: 0.5;
  }

  .mobile-list-table .mobile-rank {
    width: 36px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
  }
  .mobile-rank-btn {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
    padding: 2px 6px;
    cursor: pointer;
  }
  .mobile-rank-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  .mobile-rank-move {
    border: 0;
    background: #2a2a2a;
    color: #cfd3d8;
    width: 22px;
    height: 18px;
    border-radius: 6px;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-rank-move:active {
    transform: translateY(1px);
  }
  .mobile-rank-input {
    display: none;
    width: 36px;
    padding: 2px 4px;
    border-radius: 6px;
    border: 1px solid #3a3a3a;
    background: #1a1a1a;
    color: #fff;
    font-size: 12px;
    text-align: center;
  }
  .mobile-rank.editing .mobile-rank-btn {
    display: none;
  }
  .mobile-rank.editing .mobile-rank-input {
    display: inline-block;
  }

  .mobile-list-table .mobile-cover {
    width: 54px;
    padding: 4px;
  }

  .mobile-cover-img {
    width: 54px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
  }

  .mobile-nocover {
    width: 54px;
    height: 80px;
    background: #333;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
  }

  .mobile-list-table .mobile-name {
    min-width: 0;
    font-size: 13px;
    overflow: hidden;
  }
  .mobile-list-table .mobile-name a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    max-height: 2.4em;
  }

  .mobile-list-table .mobile-score {
    width: 56px;
    text-align: center;
  }

  .mobile-score-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
  }
.mobile-list-row.swap-anim {
  background: rgba(102, 126, 234, 0.12);
  transition: background-color 200ms ease;
}
/* Desktop swap animation highlight */
.full-list tbody tr.swap-anim td{background:rgba(102,126,234,0.12) !important;transition:background-color 200ms ease}

  .mobile-list-table .mobile-actions {
    width: 64px;
    text-align: right;
    vertical-align: middle;
  }
  .reviews-page .mobile-list-table tbody .mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
  }
  .backlog-page .mobile-list-table tbody .mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
  }

  .mobile-actions .btn.icon {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
  }

  .mobile-actions .btn.backlog-action {
    padding: 0 6px;
    font-size: 10px;
    height: 28px;
  }
  .backlog-page .mobile-actions .btn.backlog-action {
    width: 68px;
    justify-content: center;
  }

  /* Modal adjustments */
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
  .add-game-card {
    width: 100%;
    max-width: 100%;
  }

  .modal-header {
    padding: 14px;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .modal-body {
    padding: 14px;
  }

  /* Edit page full-screen on mobile */
  .editpage {
    max-width: 100%;
    margin: 0;
    padding: 14px;
    border-radius: 0;
    min-height: 100vh;
  }

  /* Main content adjustments */
  main {
    padding: 12px;
  }

  /* Index page controls mobile */
  .page-controls {
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  .controls-inner {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  .controls-inner form {
    width: 100%;
    box-sizing: border-box !important;
  }

  form#search {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .controls-inner form > div {
    flex-direction: column !important;
    gap: 8px !important;
  }

  #search-input {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  #search-results {
    width: calc(100vw - 20px) !important;
    max-width: 500px;
  }

  .controls-inner .btn {
    width: 100%;
  }

  .sort-controls {
    width: 100%;
    flex-direction: row !important;
    justify-content: space-between;
  }

  .sort-controls label {
    white-space: nowrap;
    font-size: 13px !important;
  }

  .sort-controls select {
    flex: 1;
    min-width: 0;
  }

  /* Backlog/Full reviews page controls mobile */
  /* Removed conflicting rules - now handled by template-specific styles */

  /* Game card mobile layout - stack cover above info */
  .card {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    padding: 12px !important;
    gap: 10px !important;
    box-sizing: border-box !important;
  }

  .card .cover {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
  }

  .card .cover img {
    width: 100% !important;
    aspect-ratio: 2/1;
    object-fit: cover;
  }

  .card .cover .nocover {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2/1;
    min-height: 150px;
  }

  .card .meta {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100%;
    margin-top: 0;
  }

  .full-list {
    padding: 0 12px;
    gap: 16px;
  }

  .full-card {
    grid-template-columns: 60px 140px 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    padding: 14px;
  }

  .rank-badge-large {
    min-width: 60px;
    font-size: 22px;
    padding: 8px;
  }

  .full-card-cover {
    width: 140px;
    height: 65px;
  }

  .full-card-info {
    grid-column: 1 / -1;
  }

  .full-card-header h3 {
    font-size: 16px;
  }

  .full-card-scores {
    grid-column: 1 / -1;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .score-box {
    min-width: 70px;
    padding: 8px 12px;
  }

  .score-value {
    font-size: 20px;
  }

  .full-card-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
  }

  .full-card-actions .btn {
    flex: 1;
  }
}

/* Extra-tight game cards on small phones */
@media (max-width: 480px) {
  .card {
    padding: 8px !important;
    gap: 6px !important;
    max-width: 360px !important;
    margin: 0 auto !important;
  }

  .card .cover img {
    aspect-ratio: 2/1 !important;
  }

  .card .cover .nocover {
    aspect-ratio: 2/1 !important;
    min-height: 90px !important;
  }

  .meta h2 {
    font-size: 15px !important;
  }

  .meta .year {
    font-size: 12px !important;
  }

  .game-price {
    padding: 4px 8px !important;
    font-size: 12px !important;
  }

  .price-label {
    font-size: 11px !important;
  }

  .game-tags {
    font-size: 11px !important;
  }

  .scores {
    gap: 2px !important;
  }

  .score {
    width: 56px !important;
    height: 56px !important;
  }

  .score .label {
    font-size: 10px !important;
  }

  .score .value {
    font-size: 16px !important;
  }

  .score-featured {
    width: 72px !important;
    height: 72px !important;
  }

  .score-featured .label {
    font-size: 11px !important;
  }

  .score-featured .value {
    font-size: 22px !important;
  }

  .actions .btn {
    padding: 6px 8px !important;
    font-size: 11px !important;
  }
}


