body,
html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #111;
    color: aliceblue;
}

.page_header {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0 1.5rem;
    box-sizing: border-box;
    background: hsla(0, 0%, 22%, 1);
    background: linear-gradient(0deg, hsla(0, 0%, 22%, 1) 0%, rgb(99, 99, 99) 50%, hsla(0, 0%, 22%, 1) 100%);
}

.logo-link {
    display: inline-flex;
    align-items: center;
}

.logo {
    width: 325px;
    max-width: 100%;
    margin-left: 0;
    display: block;
}

.toolbar-left {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    min-width: 0;
}

.toolbar-center {
    flex: 1.2 1 0;
    display: flex;
    justify-content: center;
    min-width: 0;
    text-align: center;
    font-size: 2rem;
    color: turquoise;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.toolbar-center p {
    margin: 0;
    line-height: 1;
}

.toolbar-right {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: wrap;
    min-width: 0;
}

.toolbar-right > button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: linear-gradient(0deg, hsla(0, 0%, 22%, 1) 0%, rgb(99, 99, 99) 50%, hsla(0, 0%, 22%, 1) 100%);
    color: aliceblue;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toolbar-right > button:hover {
    background: linear-gradient(0deg, rgb(99, 99, 99) 0%, hsla(0, 0%, 22%, 1) 50%, rgb(99, 99, 99) 100%);
    color: turquoise;
    box-shadow: 0 0 15px rgba(64, 224, 208, 0.5);
    transform: translateY(-2px);
}

.nav-bar {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    box-sizing: border-box;
    background: hsla(0, 0%, 8%, 1);
    background: linear-gradient(0deg, hsla(0, 0%, 8%, 1) 0%, hsla(0, 0%, 0%, 1) 50%, hsla(0, 0%, 8%, 1) 100%);
}

.nav-bar__inner {
    width: min(100%, 1200px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(64, 224, 208, 0.65);
    border-radius: 12px;
    background: rgba(18, 18, 18, 0.96);
    color: turquoise;
    font: inherit;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.nav-toggle__icon {
    display: grid;
    gap: 4px;
}

.nav-toggle__line {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    margin: 0;
}

.nav-links a,
.nav-links button {
    text-decoration: none;
    color: turquoise;
    padding: 10px 20px;
    border: 2px solid turquoise;
    border-radius: 5px;
    transition: all 0.3s ease;
    background-color: transparent;
    font: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    white-space: nowrap;
    cursor: pointer;
}

.nav-links a:hover,
.nav-links button:hover {
    background-color: turquoise;
    color: #111;
    box-shadow: 0 0 15px rgba(64, 224, 208, 0.5);
    transform: translateY(-2px);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background-color: #111;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 5px;
    padding: 6px 0;
}

.dropdown-content a {
    color: turquoise;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    border: none;
    transition: all 0.3s ease;
}

.dropdown-content a:hover {
    background-color: turquoise;
    color: #111;
    transform: translateX(5px);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown.is-open .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn,
.dropdown.is-open .dropbtn {
    background-color: turquoise;
    color: #111;
}



.game-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 2rem;
    margin-bottom: 100px;
}

.game-tile {
    background-color: #222;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    padding: 1rem;
    text-align: center;
    width: 240px;
    cursor: pointer;
}

.game-tile img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.game-tile h3 {
    color: turquoise;
    font-size: 1.5rem;
    margin: 0.5rem 0;
}

.game-tile p {
    font-size: 1rem;
    color: whitesmoke;
}

.footer-bar {
    background: hsla(0, 0%, 8%, 1);
    background: linear-gradient(0deg, hsla(0, 0%, 8%, 1) 0%, hsla(0, 0%, 0%, 1) 50%, hsla(0, 0%, 8%, 1) 100%);
    color: aliceblue;
    text-align: center;
    padding: 1.5%;
    position: fixed;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    bottom: 0vh;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 20% 20%, rgba(64,224,208,0.1), rgba(0,0,0,0.85)),
                linear-gradient(135deg, #161616 0%, #1f1f1f 100%);
    border: 1px solid #2f2f2f;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.6), 0 0 0 1px rgba(64,224,208,0.15);
    padding: 1.25rem;
    z-index: 1000;
    width: 80%;
    max-width: 500px;
    color: aliceblue;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.98;
}

.modal-header {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    color: turquoise;
    letter-spacing: 0.02em;
}

.modal-body {
    margin-bottom: 1rem;
    color: #dfe5e8;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-image {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(0,0,0,0.35);
    border: 1px solid #2a2a2a;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-footer button {
    background: linear-gradient(135deg, turquoise, #24c0a8);
    color: #0e1114;
    border: none;
    padding: 0.6rem 1.1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(64,224,208,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.modal-footer button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(64,224,208,0.45);
}

.modal-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #222;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    width: 300px;
    margin: 20px auto;
}

.modal-form label {
    margin-bottom: 10px;
    color: turquoise;
    align-self: flex-start;
}

.modal-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid turquoise;
    border-radius: 4px;
    background-color: #333;
    color: white;
}

.modal-form button {
    padding: 10px 20px;
    border: 2px solid turquoise;
    border-radius: 5px;
    background-color: transparent;
    color: turquoise;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-form button:hover {
    background-color: turquoise;
    color: #111;
    box-shadow: 0 0 15px rgba(64, 224, 208, 0.5);
    transform: translateY(-2px);
}

.modal-link {
    color: turquoise;
    text-decoration: none;
    display: block;
    text-align: center;
    margin-top: 10px;
}

.modal-link:hover {
    text-decoration: underline;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
}




.user-menu { position: relative; display: inline-block; }
.profile-toggle {
  border: none;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.user-dropdown-menu {
  display: none;
  position: absolute;
  color: aliceblue;
  font-size: 14px;
  right: 0;
  background: rgb(50, 50, 50);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  padding: 8px;
  z-index: 10;
}
.user-menu:hover .user-dropdown-menu,
.user-menu:focus-within .user-dropdown-menu,
.user-menu.is-open .user-dropdown-menu {
  display: block;
}

.profile-pic { 
  width:48px; 
  height:48px; 
  border-radius:50%; 
  margin-right:20px;
  cursor: pointer;
  display: block;
}
.user-dropdown-menu a,
.user-dropdown-menu button {
    color: aliceblue;
  display: block;
  text-decoration: none;
  padding: 4px 8px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 5px;
  box-sizing: border-box;
}
.user-dropdown-menu a{
    width: 100%;
}
.user-dropdown-menu a:hover,
.user-dropdown-menu button:hover { 
  background: #f0f0f0; 
    color: #868686
}

a{
    text-decoration: none;
}

/* --- Rails layout --- */
.home-rows{
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.game-row{
    position: relative;
}
.row-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.row-header h2{
    margin: 0;
    font-size: 1.4rem;
    color: turquoise;
}
.row-arrows{
    display: flex;
    gap: 0.5rem;
}
.row-arrow{
    background: #222;
    color: aliceblue;
    border: 1px solid #333;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.2s ease;
}
.row-arrow:hover{
    border-color: turquoise;
    color: turquoise;
    box-shadow: 0 0 10px rgba(64,224,208,0.4);
}
.row-scroller{
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 260px);
    gap: 1rem;
    overflow-x: auto;
    padding: 0.25rem 0.5rem;
    scrollbar-width: none; /* hide Firefox scrollbar */
}
.row-scroller::-webkit-scrollbar{
    height: 0;
    width: 0;
}
.game-card{
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.game-card:hover{
    transform: translateY(-4px);
    border-color: turquoise;
    box-shadow: 0 8px 18px rgba(64,224,208,0.15);
}
.game-card .thumb{
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.game-card img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-meta{
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.card-meta h3{
    margin: 0;
    font-size: 1.05rem;
    color: aliceblue;
}
.card-meta p{
    margin: 0;
    font-size: 0.9rem;
    color: #cfd2d5;
    line-height: 1.35;
}
.empty-state{
    text-align: center;
    color: #cfd2d5;
}

@media (max-width: 768px) {
    .page_header {
        min-height: unset;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.85rem 1rem 1rem;
    }

    .toolbar-left,
    .toolbar-right {
        flex: 0 0 auto;
    }

    .logo {
        width: min(180px, 48vw);
    }

    .toolbar-center {
        order: 3;
        flex: 1 1 100%;
        font-size: clamp(1.3rem, 6.8vw, 1.95rem);
    }

    .toolbar-center p {
        max-width: 16ch;
        margin: 0 auto;
    }

    .toolbar-right {
        gap: 0.5rem;
    }

    .toolbar-right > button {
        padding: 0.65rem 0.9rem;
        font-size: 0.92rem;
    }

    .profile-pic {
        width: 42px;
        height: 42px;
        margin-right: 0;
    }

    .nav-bar {
        min-height: unset;
        padding: 0.75rem 1rem 1rem;
        align-items: flex-start;
    }

    .nav-bar__inner {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        width: 100%;
        padding-top: 0.75rem;
    }

    .nav-bar.is-open .nav-links {
        display: flex;
    }

    .nav-links li,
    .dropdown {
        width: 100%;
    }

    .nav-links a,
    .nav-links button {
        width: 100%;
        justify-content: space-between;
        box-sizing: border-box;
    }

    .dropdown:hover .dropdown-content {
        display: none;
    }

    .dropdown-content {
        position: static;
        min-width: 0;
        margin-top: 0.55rem;
        padding: 0.35rem;
        border: 1px solid rgba(64, 224, 208, 0.22);
        box-shadow: none;
        background: rgba(10, 10, 10, 0.96);
    }

    .dropdown.is-open .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        justify-content: flex-start;
    }

    .dropdown-content a:hover {
        transform: none;
    }

    .home-rows {
        padding: 1rem;
        gap: 1.25rem;
    }

    .row-header {
        gap: 0.75rem;
    }

    .row-header h2 {
        font-size: 1.25rem;
    }

    .row-scroller {
        grid-auto-columns: minmax(180px, 72vw);
        gap: 0.75rem;
        padding: 0.25rem 0;
    }

    .modal {
        width: min(92vw, 500px);
        padding: 1rem;
    }

    .footer-bar {
        position: static;
        padding: 1rem;
        margin-top: 1rem;
    }
}
