@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@600&family=Rubik+Mono+One&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

* {
    font-family: "Rubik";
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
}

:root{
    --bg: #222222;
    --text: #eaeaea;
    --header-bg: #333333;
    --header-text: #f7f7f7;
    --card-bg: #1a1a1a;
    --accent: #61dafb;
    --muted: #bbbbbb;
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-secondary: #1f2937;
    --border: #374151;
    --muted: #666;
}

[data-theme="dark"]{
    --bg: #eaeaea;
    --text: #000;
    --header-bg: #fff;
    --header-text: #000;
    --card-bg: #f5f5f5;
    --accent: #61dafb;
    --muted: #ccc;
    --bg-secondary: var(--card-bg);
}

header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 2.5vh;
    white-space: nowrap;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 96%;
    margin: 0 auto;
    padding: 0 2%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--header-text);
    font-size: 1.8rem;
    cursor: pointer;
}

.nav-left {
    display: flex;
}

.nav-right {
    display: flex;
    justify-content: end;
    align-items: center;
    flex-basis: 30%;
    gap: 1%;
}

.nav-left ul,.nav-right ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6%;
}

.nav-left ul li,.nav-right ul li {
    display: flex;
    background-color: var(--header-bg);
    border-radius: 0.4rem;
    justify-content: center;
    align-items: center;
}

.nav-left ul li a,.nav-right ul li a {
    color: var(--header-text);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    white-space: nowrap;
    width: fit-content;
    padding: 0.4rem;
    padding-right: 0.8rem;
    padding-left: 0.8rem;
    height: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-left ul li a:hover,.nav-right ul li a:hover {
    color: var(--accent);
}

.nav-right ul {
    margin-left: 2vw;
}

.logo-section {
    flex-basis: 50%;
}

.header-controls {
    flex-basis: 10%;
}

.icon {
    width: 1.6rem;
    height: auto;
    aspect-ratio: 1;
    filter: invert(1);
}

#modetoggle {
    filter: brightness(0) saturate(100%) invert(98%) sepia(3%) saturate(215%) hue-rotate(195deg);
    transition: filter 0.3s ease;
}

[data-theme="dark"] #modetoggle {
    filter: brightness(0) saturate(100%);
}

#langToggle .icon {
    filter: brightness(0) saturate(100%) invert(98%) sepia(3%) saturate(215%) hue-rotate(195deg);
    transition: filter 0.3s ease;
}

[data-theme="dark"] #langToggle .icon {
    filter: brightness(0) saturate(100%);
}

.logo-section, .header-controls {
    display: flex;
    column-gap: 3%;
    justify-content: center;
    align-items: center;
}

.logo-img {
    width: 4rem;
    height: auto;
    aspect-ratio: 1;
    border-radius: 0.5rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.brand-name {
    font-size: 2.4rem;
    font-weight: 700;
    padding-bottom: 2%;
}

.project-title {
    font-size: 2.8rem;
    font-weight: 800;
}

.brand-subtitle {
    font-size: 1.4rem;
    color: var(--muted);
}

.header-controls{
    display: flex;
    gap: 2%;
    align-items: center;
    margin-left: calc(1rem + (30vw - 10rem) / 60);
}

.icon-btn{
    background: none;
    border: none;
    color: var(--header-text);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.6%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lang-dropdown{position:relative;}
.lang-menu{
    position:absolute;
    right:0;
    top:calc(100% + 0.5%);
    background:var(--lang-bg);
    color:var(--lang-text);
    list-style:none;
    margin:0;
    padding:0.5% 0;
    min-width:8rem;
    border-radius:0.4rem;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow:0 0.4rem 1rem rgba(0,0,0,0.12);
    display:none !important;
    opacity:0;
    transform:translateY(-4px);
    transition:opacity 120ms ease, transform 120ms ease;
    z-index:200;
}
.lang-dropdown.open .lang-menu{ display:block !important; opacity:1; transform:none }
.lang-menu li{padding:0.6rem 0; cursor:pointer}
.lang-menu li a{display:flex; align-items:center; gap:0.6rem; padding:0.4rem 1rem; color:var(--lang-text); text-decoration:none; border-radius:0.3rem}
.lang-menu li:hover{background:rgba(0,0,0,0.24)}
.lang-flag{ width:1.4rem; height:auto; display:none }
.lang-dropdown.open .lang-flag{ display:inline-block }

:root{ --lang-bg: rgba(255,255,255,0.03); --lang-text: var(--header-text); }
[data-theme="dark"]{ --lang-bg: rgba(0,0,0,0.24); --lang-text: var(--header-text); }

.project.folder{ position:relative }
.project.folder img{ width:100%; height:auto; border-radius:0.5rem; object-fit:cover; aspect-ratio:16/9; display:block }
.project.folder .folder-overlay{ position:absolute; left:0; top:0; right:0; bottom:0; background: rgba(0,0,0,0.35); border-radius:0.5rem }
.project.folder .folder-title{ position:absolute; left:0; right:0; top:50%; transform:translateY(-50%); text-align:center; color:var(--header-text); font-size:1.6rem; z-index:10; margin:0; padding:0.4rem 1rem }
.project.folder p{ display:none }

main {
    padding: 2%;
}

.filter-bar{ display:flex; gap:0.5rem; align-items:center; padding:0.5rem 0 1rem 0; flex-wrap:wrap }
.filter-btn{ background:transparent; border:1px solid rgba(255,255,255,0.06); color:var(--text); padding:0.4rem 0.8rem; border-radius:0.4rem; cursor:pointer }
.filter-btn.active{ background:var(--accent); color:#07131a; border-color:var(--accent) }

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 2%;
    max-width: 98%;
    margin: 0 auto;
}

@media (min-width: 900) {
    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1280px) {
    .project-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 2560px) {
    .project-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .menu-toggle {
        display: block;
    }
    
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        width: 100%;
        padding: 0;
    }
    
    .nav-left {
        position: fixed;
        left: -100%;
        top: 6rem;
        flex-direction: column;
        background-color: var(--header-bg);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        z-index: 100;
        height: auto;
        max-height: calc(100vh - 6rem);
        overflow-y: auto;
    }
    
    .nav-left.active {
        left: 0;
    }
    
    .nav-left ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .nav-left ul li {
        width: 100%;
        border-radius: 0;
    }
    
    .nav-left ul li a {
        display: block;
        padding: 1.2rem;
        font-size: 1rem;
        border-radius: 0;
    }
    
    .logo-section {
        flex: 1;
        gap: 8px;
        justify-content: flex-start;
        order: 1;
    }
    
    .logo-img {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .brand-name {
        font-size: 1.2rem;
        padding-bottom: 0;
    }
    
    .brand-subtitle {
        font-size: 0.75rem;
    }
    
    .project-title {
        font-size: 1.8rem;
    }
    
    .header-controls {
        flex-basis: auto;
        gap: 10px;
        order: 2;
        margin-left: 0;
    }
    
    .project-gallery {
        grid-template-columns: 1fr;
        gap: 1%;
        max-width: 100%;
        padding: 0 2%;
    }
    
    .info {
        flex-direction: column;
        gap: 2%;
        padding: 2%;
    }
    
    .info .left {
        width: 100%;
    }
    
    .info .left .title {
        font-size: 2rem;
    }
    
    .info .left .description {
        width: 100% !important;
        font-size: 0.95rem;
    }
    
    .info .right img {
        height: auto;
        max-width: 100%;
        margin-right: 0;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        gap: 1%;
    }
    
    .gallery iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .info .download {
        width: 100% !important;
        justify-content: center !important;
    }

    .info .download p {
        font-size: 1.3rem !important;
        font-weight: 400;
        width: 30%;
        padding-left: 13% !important;
        padding-right: 13% !important;
    }

    .info .right img {
        height: 10rem !important;
    }

    .gallery {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
}

.project {
    position: relative;
    text-align: left;
    border-radius: 0.5rem;
    padding: 2%;
    background: var(--card-bg);
    transition: transform 0.3s;
}

.project.under-construction {
    filter: grayscale(100%);
    opacity: 0.95;
}
.project.under-construction a {
    pointer-events: none;
    cursor: default;
}
.project.under-construction::after {
    content: "Under Construction";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--header-text);
    font-weight: 700;
    font-size: 1.2rem;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    transition: opacity 0.18s ease;
    border-radius: 0.5rem;
    z-index: 10;
    pointer-events: none;
}
.project.under-construction:hover::after {
    opacity: 1;
}

.project * {
    text-decoration: none;
    color: inherit;
}

.project:hover {
    transform: translateY(-0.3rem);
    box-shadow: 0 0.3rem 0.8rem rgba(0, 0, 0, 0.1);
}

.project img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    object-fit: cover;
    object-position: center;
    aspect-ratio: 16/9;
}

footer {
    text-align: center;
    padding: 2%;
}

.footer * {
    text-align: center;
}

.back-link{ display:inline-block; color:var(--accent); text-decoration:none; padding:0.4rem 0 }
.folder-children{ display:flex; gap:1rem; }
.folder-children .sub-item{ display:block; width:18rem; text-align:center; color:var(--text); text-decoration:none }
.folder-children .sub-item img{ width:100%; height:auto; aspect-ratio:16/9; border-radius:0.5rem; object-fit:cover }
.folder-children .sub-item h2{ margin:0.5rem 0 0 0; font-size:1.1rem; color:var(--header-text) }

.info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5%;
    padding: 1%;
    padding-left: 2%;
    padding-right: 2%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.info * {
    color: var(--text);
}

.info .left {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
}

.info .left .title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.3em;
}

.info .left .description {
    font-size: 1.1rem;
    line-height: 1.4;
    width: 50%;
}

.info .right img {
    height: 25rem;
    margin-right: 2.5rem;
    border-radius: 1rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: center;
    padding: 2%;
    gap: 2%;
    background-color: var(--header-bg);
    color: var(--header-text);
    height: fit-content;
}

.gallery iframe {
    width: 95vw;
    height: 53.4375vw;
    border: none;
    border-radius: 0.5rem;
}

.gallery img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    display: block;
    border-radius: 0.5rem;
}

.img-modal-overlay{
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.75);
    z-index: 9999;
    cursor: zoom-out;
    animation: imgFadeIn 160ms ease;
}
@keyframes imgFadeIn{ from{opacity:0} to{opacity:1} }
.img-modal-content{
    max-width: 80vw;
    max-height: 80vh;
    border-radius: 0.8rem;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}
.img-modal-content img{
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 80vh;
}

.info .download { 
    display: flex;
    align-items: center;
    gap: 2%;
    padding: 1%;
}

.info .download a {
    text-decoration: none;    
    border-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info .download img {
    padding-left: 10%;
    width: 5rem;
    height: auto;
    aspect-ratio: 1;
}

.info .download p {
    font-size: 1.5rem;
    font-weight: 500;
    text-decoration: none;
    width: 40%;
    padding-right: 10%;
}

.full {
    padding-left: 3rem;
}

.login-screen, .lobby-screen, .game-screen {
    display: none;
}

.active-screen {
    display: block;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--border);
}

.input-group {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input[type="text"], input[type="number"] {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 16px;
    width: 90%;
}

input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: white;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #374151;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group button {
    flex: 1;
}

.members-list {
    background: #111827;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.member-item {
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-name {
    font-weight: 600;
}

.member-badge {
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.info-box {
    background: #111827;
    border-left: 4px solid var(--primary);
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.code-box {
    background: var(--bg-secondary);
    border: 2px solid var(--primary);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.code-value {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary);
    font-family: monospace;
    letter-spacing: 4px;
}

.game-area {
    margin-top: 30px;
}

.guess-input {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.guess-input input {
    flex: 1;
}

.guess-input button {
    flex: 0 0 auto;
}

.result-message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 600;
    text-align: center;
    display: none;
}

.result-message.show {
    display: block;
}

.result-message.low {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.result-message.high {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.result-message.correct {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    border: 1px solid #fca5a5;
    display: none;
}

.error.show {
    display: block;
}

.title {
    font-size: 2.4rem;
    font-weight: bold;
    margin: 20px 0;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 20px;
}