@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: light;
    font-family: 'DM Sans', Arial, sans-serif;
    color: #20243a;
    background: #f7f8fc;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --ink: #20243a;
    --muted: #777d91;
    --purple: #6e58df;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 15% 3%, rgba(228, 231, 255, .52), transparent 28rem),
        #f7f8fc;
}

button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.topbar {
    height: 76px;
    padding: 0 max(5.6vw, 24px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eceef5;
    background: rgba(255, 255, 255, .76);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    text-decoration: none;
    font-family: Outfit, sans-serif;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -.35px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    object-fit: contain;
}

.account-bar { display: flex; align-items: center; gap: 20px; font-size: 14px; font-weight: 700; }
.text-button { border: 0; background: transparent; color: #6d59d6; font-size: 13px; font-weight: 700; }
.text-button:hover { color: #4834b4; }

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(400px, .92fr);
    max-width: 1320px;
    min-height: calc(100vh - 76px);
    margin: 0 auto;
    padding: 30px 5.5vw 48px;
    gap: clamp(38px, 7vw, 108px);
    align-items: center;
}

.eyebrow { margin: 0; color: #6f61ca; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; }

.library-heading h1 {
    margin: 24px 0 18px;
    font-family: Outfit, sans-serif;
    font-size: clamp(47px, 5.5vw, 72px);
    font-weight: 700;
    line-height: .99;
    letter-spacing: -3.6px;
}

.welcome-panel { width: 100%; }
.class-photo { display: block; width: 100%; max-height: 560px; aspect-ratio: 4 / 3; border: 1px solid #e6e8f0; border-radius: 18px; object-fit: cover; object-position: center; box-shadow: 0 18px 45px #27234f14; }

.login-side { display: flex; align-items: center; flex-direction: column; }
.login-card { width: min(100%, 440px); padding: 42px 42px 29px; border: 1px solid #ececf4; border-radius: 20px; background: #fff; box-shadow: 0 18px 60px #27234f0d; }
.login-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 29px; border-radius: 15px; color: #6b56d3; background: #f0edff; font-size: 22px; font-weight: 700; }
.login-card h2 { margin: 10px 0 6px; font: 700 30px Outfit, sans-serif; letter-spacing: -.8px; }
.form-intro { margin: 0 0 29px; color: var(--muted); font-size: 14px; }
.login-card label { display: block; margin-bottom: 9px; color: #373a4f; font-size: 13px; font-weight: 700; }
.input-wrap { display: flex; align-items: center; height: 53px; padding: 0 15px; gap: 12px; border: 1px solid #e2e4ed; border-radius: 9px; color: #9598a9; background: #fff; }
.input-wrap:focus-within { border-color: #8a79e4; box-shadow: 0 0 0 3px #7562de1c; }
.input-wrap input { width: 100%; height: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.input-wrap input::placeholder { color: #a6a8b4; }
.primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 53px; margin-top: 20px; padding: 0 17px; border: 0; border-radius: 9px; color: #fff; background: #6c58d7; font-size: 14px; font-weight: 700; box-shadow: 0 8px 16px #6c58d72b; transition: background .18s ease, transform .18s ease; }
.primary-button:hover:not(:disabled) { background: #5b47c4; transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .75; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 23px 0 0; color: #9699a8; font-size: 11px; }
.error-message { margin: 13px 0 0; color: #b83245; font-size: 13px; line-height: 1.5; }
.login-help { margin: 22px 0 0; color: #8a8d9c; font-size: 12px; text-align: center; }

.library-view { max-width: 1240px; margin: 0 auto; padding: 66px 34px 32px; }
.library-heading { display: flex; justify-content: space-between; align-items: end; gap: 26px; margin-bottom: 42px; }
.library-heading h1 { margin: 13px 0 9px; font-size: clamp(36px, 4.2vw, 52px); letter-spacing: -2.2px; line-height: 1.1; }
.library-heading h1 span { color: var(--purple); }
.library-subtitle { margin: 0; color: #7d8192; font-size: 15px; }
.student-chip { display: flex; align-items: center; min-width: 192px; padding: 10px 15px 10px 10px; gap: 11px; border: 1px solid #ececf4; border-radius: 13px; background: #fff; }
.avatar { position: relative; display: grid; place-items: center; flex: 0 0 39px; width: 39px; height: 39px; overflow: hidden; border-radius: 12px; color: #6c58d7; background: #eeebff; font-size: 16px; font-weight: 800; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.student-chip small, .student-chip strong { display: block; max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-chip small { margin-bottom: 3px; color: #9699a7; font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.student-chip strong { color: #34364b; font-size: 12px; }
.section-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; color: #55596d; font-size: 11px; font-weight: 800; letter-spacing: 1.3px; }
.game-count { color: #9296a6; font-size: 10px; letter-spacing: .8px; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; }
.game-card { display: flex; min-width: 0; min-height: 347px; flex-direction: column; overflow: hidden; border: 1px solid #e9eaf1; border-radius: 14px; color: inherit; background: #fff; text-decoration: none; box-shadow: 0 4px 12px #25244308; transition: transform .2s ease, box-shadow .2s ease; }
.game-card:hover { transform: translateY(-4px); box-shadow: 0 14px 27px #25244312; }
.card-art { position: relative; display: grid; place-items: center; height: 160px; flex: 0 0 160px; overflow: hidden; }
.card-blue .card-art { background: #e9edff; }
.card-green .card-art { background: #e3f5ee; }
.card-violet .card-art { background: #eee9ff; }
.card-orange .card-art { background: #fff0de; }
.card-pink .card-art { background: #ffebef; }
.card-teal .card-art { background: #dff5f3; }
.card-dark .card-art { background: #e6eafa; }
.card-art::before { content: ''; position: absolute; width: 210px; height: 115px; border: 1px solid #ffffffab; border-radius: 50%; transform: rotate(-16deg); }
.card-art::after { content: ''; position: absolute; width: 174px; height: 83px; border: 1px solid #ffffffa3; border-radius: 50%; transform: rotate(14deg); }
.art-coin { position: absolute; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: #927fe2; font-size: 15px; font-style: normal; box-shadow: 0 5px 9px #3f3a6c26; }
.coin-one { top: 26px; right: 23%; background: #f0b451; }
.coin-two { bottom: 25px; left: 23%; width: 26px; height: 26px; background: #5fbd9b; font-size: 13px; }
.monitor { position: relative; z-index: 2; display: grid; place-items: center; width: 92px; height: 67px; border: 6px solid #fff; border-radius: 10px; color: #fff; background: #7a6bdb; font-size: 27px; box-shadow: 0 9px 17px #5c4eaa35; }
.monitor::after { content: ''; position: absolute; bottom: -17px; left: 37px; width: 10px; height: 13px; background: #fff; }
.monitor i { font-style: normal; }
.mouse-shape { position: relative; z-index: 2; width: 47px; height: 72px; border: 6px solid #fff; border-radius: 26px; background: #59bc94; box-shadow: 0 9px 17px #397b6535; }
.mouse-shape::before { content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 17px; background: #fff; transform: translateX(-50%); }
.mouse-shape i { position: absolute; top: -2px; left: 50%; width: 2px; height: 13px; background: #26936a; transform: translateX(-50%); }
.doc-icon { z-index: 2; display: grid; place-items: center; width: 62px; height: 76px; border: 5px solid #fff; border-radius: 10px; color: #fff; background: #8170dd; font: 700 35px Outfit, sans-serif; box-shadow: 0 9px 17px #5c4eaa35; }
.rescue-badge { z-index: 2; display: grid; place-items: center; width: 76px; height: 76px; border: 7px solid #fff; border-radius: 50%; color: #fff; background: #f19c5b; font: 700 37px Arial, sans-serif; box-shadow: 0 9px 17px #b9653540; }
.shield-icon { z-index: 2; display: grid; place-items: center; width: 72px; height: 82px; clip-path: polygon(50% 0, 94% 17%, 88% 67%, 50% 100%, 12% 67%, 6% 17%); color: #fff; background: #eb7890; font: 800 43px Arial, sans-serif; filter: drop-shadow(0 9px 6px #bd627642); }
.key { position: absolute; z-index: 2; display: grid; place-items: center; width: 50px; height: 50px; border: 5px solid #fff; border-radius: 12px; color: #fff; background: #54b9ad; font: 700 18px Outfit, sans-serif; box-shadow: 0 7px 13px #397b6530; transform: rotate(-8deg); }
.key-one { left: calc(50% - 58px); top: 45px; }
.key-two { left: calc(50% + 7px); top: 53px; background: #8474df; transform: rotate(8deg); }
.key-three { left: calc(50% - 4px); top: 101px; width: 56px; height: 39px; background: #eeaa51; }
.browser-window { z-index: 2; position: relative; display: flex; align-items: center; justify-content: center; width: 105px; height: 76px; border: 6px solid #fff; border-radius: 10px; color: #fff; background: #26334f; box-shadow: 0 9px 17px #3b476635; font: 700 24px Outfit, sans-serif; }
.browser-window i { position: absolute; top: 8px; left: 8px; width: 5px; height: 5px; border-radius: 50%; background: #ef859b; box-shadow: 10px 0 #f1c36c, 20px 0 #72c6a8; }
.browser-window b { padding-top: 9px; letter-spacing: 1px; }
.card-info { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 20px 20px 18px; }
.category { color: #86899b; font-size: 9px; font-weight: 800; letter-spacing: 1.15px; }
.card-info h2 { margin: 8px 0 6px; font: 700 18px Outfit, sans-serif; letter-spacing: -.25px; }
.card-info p { margin: 0 0 16px; color: #85899a; font-size: 12px; line-height: 1.65; }
.play-link { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: auto; padding-top: 12px; border-top: 1px solid #f0f0f4; color: #6552cf; font-size: 12px; font-weight: 700; }
.play-link b { font-size: 17px; transition: transform .18s ease; }
.game-card:hover .play-link b { transform: translateX(3px); }
.library-footer { padding: 30px 0 5px; color: #a0a2af; font-size: 11px; text-align: center; }
.library-footer span { color: #e4af60; }

@media (max-width: 900px) {
    .login-layout { grid-template-columns: 1fr minmax(330px, .9fr); gap: 30px; padding-right: 4vw; padding-left: 4vw; }
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .library-view { padding-top: 48px; }
}

@media (max-width: 680px) {
    .topbar { height: 65px; padding: 0 20px; }
    .brand { font-size: 15px; }
    .account-bar { gap: 10px; font-size: 12px; }
    .login-layout { display: flex; min-height: calc(100vh - 65px); flex-direction: column; align-items: stretch; justify-content: center; gap: 24px; padding: 39px 21px; }
    .class-photo { max-height: 260px; border-radius: 14px; }
    .login-card { padding: 29px 25px 24px; }
    .login-icon { margin-bottom: 21px; }
    .form-intro { margin-bottom: 23px; }
    .login-help { margin-top: 15px; }
    .library-view { padding: 37px 20px 25px; }
    .library-heading { align-items: flex-start; flex-direction: column; gap: 17px; margin-bottom: 31px; }
    .library-heading h1 { font-size: 38px; }
    .library-subtitle { font-size: 13px; }
    .student-chip { min-width: 0; }
    .game-grid { gap: 12px; }
    .game-card { min-height: 319px; }
    .card-art { height: 130px; flex-basis: 130px; }
    .card-info { padding: 16px 14px 14px; }
    .card-info h2 { font-size: 16px; }
    .card-info p { font-size: 11px; }
}

@media (max-width: 420px) {
    .game-grid { grid-template-columns: 1fr; }
    .game-card { min-height: 0; }
    .card-art { height: 140px; flex-basis: 140px; }
    .card-info p { margin-bottom: 12px; }
}
