  * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
      background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
      color: white;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      overflow-x: hidden;
    }

    #video-container {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1;
    }

    video {
      position: absolute;
      max-width: 90%;
      max-height: 90%;
      object-fit: contain;
      transform: scaleX(-1);
    }

    canvas {
      position: absolute;
      max-width: 90%;
      max-height: 90%;
      object-fit: contain;
    }

    #controls {
      position: fixed;
      top: 20px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 12px;
      z-index: 100;
    }

    #counter {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 100;
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 16px;
      padding: 20px 32px;
      font-size: 2.5em;
      font-weight: 700;
      min-width: 150px;
      text-align: center;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
      letter-spacing: 1px;
    }

    #status {
      position: fixed;
      top: 120px;
      right: 20px;
      z-index: 100;
      padding: 12px 20px;
      border-radius: 12px;
      font-size: 14px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 1px;
      backdrop-filter: blur(10px);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
      transition: all 0.3s ease;
    }

    .status-standing { 
      background: rgba(34, 197, 94, 0.2);
      border: 1px solid rgba(34, 197, 94, 0.4);
      color: #4ade80;
    }

    .status-descending { 
      background: rgba(251, 146, 60, 0.2);
      border: 1px solid rgba(251, 146, 60, 0.4);
      color: #fb923c;
    }

    .status-ascending { 
      background: rgba(59, 130, 246, 0.2);
      border: 1px solid rgba(59, 130, 246, 0.4);
      color: #60a5fa;
    }

    .content-stack {
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 20px;
      max-width: 800px;
      width: calc(100% - 40px);
      z-index: 100;
    }

    #feedback, #msg {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 12px;
      padding: 16px 32px;
      font-size: 1.1em;
      text-align: center;
      width: 100%;
      max-width: 600px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    #debug {
      font-family: 'Courier New', monospace;
      font-size: 12px;
      width: 100%;
      max-width: 600px;
      white-space: pre-line;
      display: none;
      color: #4ade80;
      background: rgba(0, 0, 0, 0.8);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(34, 197, 94, 0.3);
      border-radius: 12px;
      padding: 16px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
      line-height: 1.5;
      text-align: left;
    }

    button {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.2);
      padding: 12px 24px;
      border-radius: 12px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      transition: all 0.3s ease;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }

    button:hover {
      background: rgba(255, 255, 255, 0.2);
      border-color: rgba(255, 255, 255, 0.4);
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }

    button:active {
      transform: translateY(0);
    }

    button:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      transform: none;
    }

    .simulate-btn {
      background: rgba(255, 107, 53, 0.2);
      border-color: rgba(255, 107, 53, 0.4);
    }

    .simulate-btn:hover {
      background: rgba(255, 107, 53, 0.3);
      border-color: rgba(255, 107, 53, 0.6);
    }

    @media (max-width: 768px) {
      video, canvas {
        max-width: 75%;
        max-height: 70%;
      }

      #top-ui {
        flex-direction: row;
        align-items: flex-start;
        padding: 10px;
        gap: 10px;
      }

      #controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        max-width: calc(100% - 120px);
        flex: 1;
      }
      
      button {
        padding: 10px 8px;
        font-size: 10px;
        min-width: 0;
        white-space: nowrap;
      }

      #status {
        font-size: 10px;
        padding: 8px 12px;
        writing-mode: horizontal-tb;
      }
      
      #counter {
        font-size: 1.6em;
        padding: 12px 16px;
        min-width: 90px;
        top: 10px;
        right: 10px;
      }
      
      .content-stack {
        bottom: 10px;
        gap: 8px;
        padding: 0 10px;
      }
      
      #feedback, #msg {
        font-size: 0.85em;
        padding: 10px 14px;
      }
      
      #debug {
        max-width: 90%;
        font-size: 10px;
      }
    }

    @media (max-width: 480px) {
      video, canvas {
        max-width: 70%;
        max-height: 65%;
      }

      #top-ui {
        padding: 8px;
        gap: 8px;
      }

      #controls {
        gap: 6px;
        max-width: calc(100% - 100px);
      }

      button {
        padding: 9px 6px;
        font-size: 9px;
      }

      #status {
        font-size: 9px;
        padding: 6px 10px;
      }

      #counter {
        font-size: 1.4em;
        padding: 10px 14px;
        top: 8px;
        right: 8px;
        min-width: 80px;
      }

      #feedback, #msg {
        font-size: 0.8em;
        padding: 8px 12px;
      }
    }

    @media (max-height: 700px) {
      video, canvas {
        max-width: 80%;
        max-height: 75%;
      }

      #top-ui {
        padding: 6px;
      }

      #counter {
        font-size: 1.3em;
        padding: 8px 12px;
        top: 6px;
        right: 6px;
      }
      
      #status {
        font-size: 9px;
        padding: 6px 10px;
      }

      button {
        padding: 7px 6px;
        font-size: 9px;
      }
    }