  :root {
      --header-height: 55px;
      --footer-height: 25px;
    }

    
    html {
      scroll-behavior: smooth;
      
    }

    html,
    body {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
      font-family: 'Segoe UI', sans-serif;
      background: linear-gradient(#87CEEB, #4CAF50);
      color: white;
      -webkit-tap-highlight-color: transparent;
      overflow-x: hidden;
      overflow-y: auto;
      
    }

    .page-container {
      display: flex;
      flex-direction: column;
      min-height: 100%;
      
    }
    
    .page-title {
        font-size: 1.8em;
    }

    main {
      flex-grow: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      
      gap: 5px;
      padding: 10px 5px;
      box-sizing: border-box;
    }

    
    header {
      height: var(--header-height);
      background: rgba(0, 0, 0, 0.3);
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
      display: flex;
      align-items: center;
      flex-shrink: 0;
      z-index: 20;
      padding: 0 10px;
    }

    .menu-container {
      width: 100%;
      max-width: 1280px;
      margin: 0 auto;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .site-title {
      font-size: 1.5em;
      font-weight: bold;
      color: #fff;
      text-decoration: none;
      text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }

    header nav a {
      color: #f0f0f0;
      text-decoration: none;
      margin-left: 20px;
      font-size: 1em;
      transition: color 0.2s ease;
    }

    header nav a:hover {
      color: #fff;
      text-decoration: underline;
    }

    footer {
      height: var(--footer-height);
      flex-shrink: 0;
      text-align: center;
      background: rgba(0, 0, 0, 0.2);
      box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 20;
      margin-top: auto;
      
    }

    footer p {
      margin: 0;
      font-size: 0.75em;
      opacity: 0.8;
    }

    
    .game-block,
    .info-block {
      width: 100%;
      max-width: 800px;
      
      display: flex;
      flex-direction: column;
    }

    .game-block {
      gap: 10px;
    }

    .all-controls {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
    }

    .main-buttons,
    .game-modes {
      display: flex;
      gap: 10px;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
    }

    .modes-title {
      margin: 5px 0 0;
      font-size: 0.8em;
      font-weight: 600;
      text-shadow: 1px 1px 2px #000;
    }

    .game-btn,
    .mode-btn {
      padding: 6px 11px;
      font-size: 1em;
      font-weight: bold;
      color: white;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      outline: none;
      transition: all 0.05s linear;
    }

    .game-btn {
      background: #3498DB;
      border-bottom: 2px solid #2980B9;
    }

    .game-btn:active {
      transform: translateY(1px);
      border-bottom-width: 1px;
    }

    #stop-btn {
      background: #E74C3C;
      border-bottom-color: #C0392B;
    }

    #mute-btn {
      background: #F39C12;
      border-bottom-color: #D35400;
      font-size: 1em;
    }

    #mute-btn.muted {
      background: #95A5A6;
      border-bottom-color: #7F8C8D;
    }

    .mode-btn {
      background: #5D6D7E;
      border-bottom: 2px solid #34495E;
    }

    .mode-btn:active {
      transform: translateY(1px);
    }

    .mode-btn.active {
      background: #3498DB;
      border-bottom-color: #2980B9;
      transform: translateY(1px);
      border-bottom-width: 1px;
    }

    .game-container {
      position: relative;
      width: 100%;
      max-width: 600px;
      margin: 0 auto;
      aspect-ratio: 1 / 1;
    }

    canvas {
      display: block;
      box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
      border-radius: 10px;
      width: 100%;
      height: 100%;
    }

    #scoreboard {
      position: absolute;
      top: 10px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(255, 255, 255, 0.9);
      padding: 5px 15px;
      border-radius: 8px;
      font-weight: bold;
      color: #333;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
      z-index: 10;
      font-size: 1em;
    }

    .controls-wrapper {
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .d-pad {
      position: relative;
      width: 120px;
      height: 120px;
      user-select: none;
    }

    .d-pad-btn {
      position: absolute;
      width: 40px;
      height: 40px;
      background-color: #5D6D7E;
      border-bottom: 3px solid #34495E;
      border-radius: 8px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 1.6em;
      color: white;
      font-weight: bold;
      cursor: pointer;
      transition: all 0.05s linear;
    }

    .d-pad-btn:active {
      transform: translateY(2px);
      border-bottom-width: 1px;
    }

    .d-pad-up {
      top: 0;
      left: 40px;
    }

    .d-pad-down {
      bottom: 0;
      left: 40px;
    }

    .d-pad-left {
      top: 40px;
      left: 0;
    }

    .d-pad-right {
      top: 40px;
      right: 0;
    }

    .d-pad-up,
    .d-pad-down {
      background-color: #465564;
      border-bottom-color: #2C3E50;
      cursor: default;
    }

    .d-pad-up:active,
    .d-pad-down:active {
      transform: none;
      border-bottom-width: 3px;
    }

    .info-box {
      background: rgba(255, 255, 255, 0.85);
      padding: 7px 15px;
      border-radius: 5px;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
      color: #333;
      
      
    }

    .info-box h2 {
      font-size: 1.4em;
      text-align: center;
      margin: 10px 0;
    }

    .info-box h3 {
      text-align: center;
      margin: 8px 0;
      font-size: 1.1em;
    }

    .info-box p {
      font-size: 0.95em;
      line-height: 1.5;
    }

    .info-box ul {
      margin: 0;
      padding-left: 20px;
      font-size: 0.9em;
      line-height: 1.6;
    }

    .info-box ul li {
      margin-bottom: 6px;
    }

    .info-box ul ul {
      margin-top: 6px;
      margin-bottom: 10px;
    }

    .links-container {
      display: flex;
      justify-content: space-around;
      flex-wrap: wrap;
      margin-top: 15px;
      padding-top: 10px;
      border-top: 1px solid #ddd;
    }

    .links-container a {
      color: #2980B9;
      text-decoration: none;
      font-weight: 600;
      font-size: 0.9em;
      padding: 2px 5px;
    }
    

    @media (max-width: 600px) {
      .site-title {
        float: none;
        display: block;
        text-align: center;
        margin-bottom: 10px;
      }
      
       .page-title {
        font-size: 1.5em;
    }

      nav {
        float: none;
        display: flex;
        justify-content: center;
        gap: 20px;
      }

      nav a {
        margin: 0;
      }
    }