@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Press+Start+2P&family=Silkscreen:wght@400;700&family=Varela+Round&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap');
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Inter', system-ui, Segoe UI, Roboto, Arial, sans-serif;
    background: #071123;
    color: #e6eef8;
}
h1 {
    font-family: 'Press Start 2P', sans-serif;
    font-size: 3em; 
    color: #FFD700;
    text-shadow: 2px 2px 0 #000;
}
:root {
    --accent: #3ee3b3;
    --muted: #98a3b8;
}
.app {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #071026, #04101e);
}
.frame {
    width: min(980px, 96vw);
    height: min(820px, 94vh);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 14px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.75);
}
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .28s, transform .28s;
}
.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(.995);
}
.card {
    width: 86%;
    max-width: 760px;
    background: transparent;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
h1 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
}
p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 16px;
}
input[type="text"], textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.01);
    color: inherit;
    box-sizing: border-box;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
input[type="text"]:focus, textarea:focus {
    border-color: var(--accent);
}
.btn {
   font-family: 'Press Start 2P', sans-serif;
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    border: 0;
    cursor: pointer;
    background: linear-gradient(90deg, var(--accent), #2ad2a0);
    color: #021017;
    font-weight: 700;
    margin: 6px;
    border: solid #ad00007e;
    transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(62, 227, 179, 0.2);
}
.btn.secondary {
    background: transparent;
    color: var(--accent);
}
.btn.secondary:hover {
    background: rgba(62, 227, 179, 0.1);
    box-shadow: none;
}
.contact-card {
  text-align: center;
}
.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}
.social-icons a {
  color: var(--primary-color, #007bff);
  transition: transform 0.2s, color 0.2s;
}
.social-icons a:hover {
  transform: translateY(-3px);
  color: var(--hover-color, #0056b3);
}
.about-card {
    text-align: left;
}
.history-section {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.history-section h2 {
    color: #333;
    border-bottom: 2px solid #ccc;
    padding-bottom: 5px;
    margin-top: 10px;
}
.game-detail {
    margin-top: 15px;
    padding-left: 15px;
    border-left: 3px solid var(--primary-color, #007bff);
}
.game-detail h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.1em;
    color: #555;
}
.game-detail ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-top: 5px;
    font-size: 0.95em;
}
.game-detail li {
    margin-bottom: 3px;
}
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}
.menu-btn {
    padding: 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    font-weight: 800;
    color: var(--accent);
    cursor: pointer;
    transition: background 0.2s;
}
.menu-btn:hover {
    background: rgba(255, 255, 255, 0.04);
}
.key-highlight {
    background-color: #333;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    border: 1px solid #555;
}
.level-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: stretch;
    margin-top: 12px;
}
.level-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    min-width: 120px;
    flex-grow: 1;
    flex-basis: 120px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}
.level-card:hover {
    background: rgba(62, 227, 179, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}
.game-area {
    width: 760px;
    max-width: 80%;
    height: clamp(520px, 80vh, 740px);
    background: repeating-linear-gradient(180deg, #2b2f36 0 40px, #23262a 40px 80px);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(244, 243, 243, 0.03);
    box-shadow: inset 0 -20px 60px rgba(0, 0, 0, 0.45);
}
.road {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.road::before, .road::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(#0b1220, #06101b);
    left: 10px;
    border-radius: 4px;
}
.road::after {
    right: 10px;
    left: auto;
}
.center-lines {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    pointer-events: none;
}
.center-lines div {
    width: 100%;
    height: 40px;
    background: #ffffff;
    border-radius: 3px;
}
.player {
    position: absolute;
    width: auto;
    height: 100px;
    bottom: 18px;
    z-index: 50;
    image-rendering: pixelated;
    transition: left 0.20s ease-out;
}
.opponent {
    position: absolute;
    width: auto;
    height: 100px;
    top: -160px;
    z-index: 40;
    image-rendering: pixelated;
}
.hud {
    position: absolute;
    inset: 18px 18px auto 18px; 
    display: flex;
    justify-content: space-between;
    z-index: 60;
    font-size: 14px;
    pointer-events: none;
    color: #cfeee1;
}
.hud .left {
    padding: 8px 12px;
    border-radius: 8px;
    pointer-events: auto;
    color: #dff7ec;
    font-weight: 600;
}
 .hud .right {
    background: rgba(0, 0, 0, 0.18);
    padding: 8px 12px;
    border-radius: 8px;
    pointer-events: auto;
    color: #dff7ec;
    font-weight: 600;
}
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 7, 12, 0.6);
    z-index: 200;
}
.popup {
    background: #07101a;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    min-width: 260px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}
@media (max-width: 520px) {
    .frame {
        padding: 12px;
        border-radius: 10px;
    }
    .player, .opponent {
        width: auto;
        height: 78px;
    }
    .game-area {
        max-width: 90%;
        height: clamp(440px, 80vh, 620px);
    }
    h1 {
        font-size: 20px;
    }
    p {
        font-size: 14px;
    }
    .card {
        padding: 10px;
        width: 100%;
    }
    .level-card {
        flex-basis: 45%;
        min-width: unset;
    }
}
.mobile-controls {
  position: absolute;
  bottom: 1px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 1000;
}

.ctrl-btn {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  font-size: 20px;
  padding: 15px 35px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  transition: 0.2s;
}

.ctrl-btn:active {
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(0.95);
}

/* Hide on desktop */
@media (min-width: 768px) {
  .mobile-controls {
    display: none;
  }
}
