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

body { 
    background-color: black; 
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
}

#app-window {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Global Header */
.app-header {
    flex-shrink: 0;
}

.banner {
    width: 100%;
    aspect-ratio: 10/1;
    background-color: #333;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    background-image: url("BMLA3.png");
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
}

.nav {
    display: flex;
    gap: 1.5em;
    align-items: center;
    justify-content: center;
    background-color: #59524ab8;
    padding: 0.75em 1em;
}

/* Page System */
.page-container {
    flex: 1;
    overflow: hidden;
}

.page {
    width: 100%;
    height: 100%;
    display: none;
    padding: 2em;
    overflow-y: auto;
    background-color: black;
}

.page.active {
    display: flex;
}

.nav-item {
    display: flex;
    flex: 1;
    max-width: 20vw;
    align-items: center;
    font-size: 2.8em;
    padding: 0.25em 1em;
    justify-content: center;
    border-radius: 30px;
    background-color: #000000bd;
    color: rgba(203, 203, 203, 0.791);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.nav-item:hover {
    background-color: rgba(152, 156, 156, 0.8);
}

.nav-item.active {
    background-color: #838383;
    color: black;
}

.search-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 5px;
    padding: 1em;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1em;
    margin-bottom: 1.5em;
}

.filter-group {
    background: rgba(161, 155, 150, 0.363);
    border-radius: 5px;
    padding: 1em;
    transition: all 0.3s ease;
}

.filter-group:hover {
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.2);
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75em;
    color: #d3e3e2c7;
    font-size: 3.5em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-input {
    width: 100%;
    padding: 0.875em 1em;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #ffffff;
    font-size: 3em;
    transition: all 0.3s ease;
}

.filter-input:focus {
    outline: none;
    border-color: #dddbd8;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(205, 133, 63, 0.2);
}

.filter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.filter-input option {
    background-color: #333;
    color: white;
}

.filter-input select {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.action-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap:1.2em;
}

.search-btn {
    background: rgba(145, 145, 145, 0.753);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 3em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    min-width: 120px;
}

.search-btn:hover {
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

.clear-btn {
    background: transparent;
    color: #cccccc;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 3em;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Page Specific Rules */

#home-page {flex-direction: column; gap: 5em; justify-content: start; align-items: center;}
#home-page .heading {font-size:6em; color:white; text-align: center; margin-top: 3em;}
#home-page .blurb {font-size:4em; color:white; text-align: center; width: 50%; line-height: 150%;}
#search-page {padding: 0 1em; justify-content: center;}

.sort-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1em 1.5em;
    margin-bottom: 1.5em;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
    position: sticky;
    top: 0.5em;
    z-index: 100;
}

.sort-label {
    font-weight: 600;
    color: #e0e0e0b9;
    font-size: 3em;
}

.sort-select {
    background-color: rgba(99, 97, 94, 0.2);
    border: 1px solid rgba(191, 190, 188, 0.517);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: white;
    font-size: 3em;
    cursor: pointer;
}

.results-count {
    margin-left: auto;
    color: #cccccc;
    font-size: 3em;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-auto-columns: auto;
    grid-auto-rows: 20vmin;
    gap: 1.5rem;
    overflow-y: auto;
    flex: 1;
    padding-right: 0.5rem;
    min-height: 0;
    width: 95vw;
    overscroll-behavior: contain;
}

.game-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(115, 112, 110, 0.3);
}

.game-thumbnail {
    display: flex;
    flex: 1;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* .game-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
} */

.game-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    flex: 1;
    height: 100%;
}

.game-title {
    text-align: center;
    font-size: 4em;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
    line-height: 1.3;
}

.game-meta {
    display: flex;
    gap: 2em;
    margin-bottom: 0.75rem;
    font-size: 3em;
    color: #cccccc;
}

.game-tag {
    background: rgba(139, 69, 19, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 3rem;
    color: #DEB887;
    text-transform: capitalize;
}

#game-page {
    padding: 2em;
    flex-direction: column;
    gap: 2em;
}

.game-content {
    max-width: 90vw;
    margin: 0 auto;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2em;
    flex-wrap: wrap;
    gap: 1em;
}

.game-page-title {
    font-size: 6em;
    color: white;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.back-button {
    background: rgba(145, 145, 145, 0.753);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 2.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.back-button:hover {
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.game-description {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2em;
    margin-bottom: 2em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-notes {
    font-size: 3.5em;
    color: #e0e0e0b9;
    line-height: 1.5;
    margin: 0;
}

.game-meta-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2em;
    margin-bottom: 2em;
}

.meta-item {
    background: rgba(161, 155, 150, 0.363);
    border-radius: 12px;
    padding: 1.5em;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.meta-label {
    font-size: 2.5em;
    color: #d3e3e2c7;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 3em;
    color: white;
    font-weight: 400;
}

.game-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2em;
}

.link-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.link-section h3 {
    font-size: 3em;
    color: #e0e0e0b9;
    margin-bottom: 1em;
    text-align: center;
}

.pdf-frame, .video-frame {
    width: 100%;
    height: 40vmin;
    border: none;
    border-radius: 12px;
    margin-bottom: 1em;
}

.external-link {
    display: block;
    background: rgba(145, 145, 145, 0.753);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 2.5em;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.external-link:hover {
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

#add-game-page {
    padding: 2em;
    flex-direction: column;
}

.add-game-content {
    max-width: 90vw;
    margin: 0 auto;
}

.game-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2em;
    flex-wrap: wrap;
    gap: 1em;
}

.form-title {
    font-size: 6em;
    color: white;
    font-weight: 600;
    margin: 0;
}

.game-form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2em;
    margin-bottom: 2em;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.form-group label {
    font-size: 2.5em;
    color: #d3e3e2c7;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.875em 1em;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #ffffff;
    font-size: 2.5em;
    transition: all 0.3s ease;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #dddbd8;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(205, 133, 63, 0.2);
}

.form-input::placeholder, .form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-textarea {
    min-height: 6em;
    resize: vertical;
}

.tags-group {
    grid-column: 1 / -1;
}

.tags-container {
    display: flex;
    gap: 2em;
    flex-wrap: wrap;
    margin-top: 1em;
}

.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 2.2em;
    color: white;
    cursor: pointer;
    user-select: none;
}

.tag-checkbox input[type="checkbox"] {
    width: 1.5em;
    height: 1.5em;
    cursor: pointer;
}

.notes-group {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 2em;
    justify-content: center;
    margin-top: 2em;
}

.save-btn {
    background: rgba(145, 145, 145, 0.753);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 3em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.save-btn:hover {
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
    transform: translateY(-2px);
}

.cancel-btn {
    background: transparent;
    color: #cccccc;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 1rem 3rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 3em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}


@media (orientation: landscape) {
  .filter-group label {font-size: 1.7em}
  .filter-input, .search-btn, .clear-btn  {font-size: 1.7em;}
  .filters-grid {grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));}
  .nav-item {max-width: 15vw; font-size: 1.8em;}
  #home-page .heading {font-size:4em; margin-top: 1em;}
  #home-page .blurb {font-size:3em; width: 50%; line-height: 150%;}
  .sort-select, .sort-label, .results-count, .game-meta, .game-tag {font-size: 2em;}
  .game-title, .game-page-title {font-size: 3em;}
  .game-notes {font-size: 2.5em;}
  .game-meta-section {grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));}
  .game-links {grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));}
}

@media (width: 1024px) {
  .filters-grid {grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));}
}

@media (width: 912px) {
  .filters-grid {grid-template-columns: repeat(auto-fit, minmax(295px, 1fr));}
}

