
  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    background: #555;
    background-image: url('img.jpg');
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
  }

  #welcome {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-family: monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #ff00ff;
    text-shadow:
      0 0 5px rgba(255, 0, 255, 0.7),
      0 0 15px rgba(255, 0, 255, 0.35),
      0 0 30px rgba(255, 0, 255, 0.1);
    letter-spacing: 6px;
    white-space: nowrap;
    text-transform: uppercase;
    user-select: none;
    pointer-events: none;
  }

  #box-frame {
    position: relative;
    z-index: 5;
    border-radius: 25px;
    padding: 28px;
    box-shadow:
      0 0 0 2px #333,
      0 10px 40px rgba(0,0,0,0.8),
      inset 0 1px 0 rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #box-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 25px;
    padding: 28px;
    background: #1a1a1a;
    box-shadow: inset 0 3px 12px rgba(0,0,0,0.9);
    z-index: 0;
  }

  #box-frame iframe,
  #box-frame video,
  #player {
    display: block;
    position: relative;
    z-index: 1;
    border: none;
    border-radius: 8px;
    width: min(70vw, calc(70vh * 16 / 9), 956px);
    aspect-ratio: 16 / 9;
    height: auto;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    background: #000;
  }

  .legacy-switch {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 1px 14px;
    background: #14141b;
    border: 1px solid rgba(150, 120, 255, 0.6);
    border-radius: 4px;
    min-width: 150px;
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,0.7),
      0 0 8px rgba(120, 90, 255, 0.22),
      0 0 0 1px #000;
    font-family: monospace;
    font-size: 0.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-weight: 700;
    transition: border-color 0.25s, box-shadow 0.25s;
  }

  .legacy-switch.right {
    border-color: rgba(150, 120, 255, 0.65);
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,0.7),
      0 0 8px rgba(120, 90, 255, 0.25),
      0 0 0 1px #000;
  }
  .legacy-switch:hover {
    border-color: rgba(180, 160, 255, 0.95);
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,0.7),
      0 0 14px rgba(120, 90, 255, 0.5),
      0 0 0 1px #000;
  }

  .legacy-switch::before,
  .legacy-switch::after {
    content: "";
    position: absolute;
    top: -2px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #555;
    box-shadow: 0 0 3px #999;
    transition: background 0.25s, box-shadow 0.25s;
  }
  .legacy-switch::before { left: 4px; }
  .legacy-switch::after  { right: 4px; }
  .legacy-switch.right::before,
  .legacy-switch.right::after {
    background: #888;
    box-shadow: 0 0 4px #bbb;
  }

  .legacy-switch-label { color: #6a6a6a; }

  .legacy-switch:not(.right) .ls-video {
    color: #d0d0d3;
    text-shadow: 0 0 5px rgba(200,200,205,0.5);
  }

  .legacy-switch.right .ls-game {
    color: #e6e6ea;
    text-shadow: 0 0 5px rgba(210,210,215,0.55);
  }

  .legacy-switch-track {
    position: relative;
    width: 40px;
    height: 18px;
    border-radius: 3px;
    background: #14141f;
    border: 1px solid #3a3a4a;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
  }

  .legacy-switch-knob {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 17px;
    height: 14px;
    border-radius: 2px;
    background: linear-gradient(#c6c6cc, #76767e);
    box-shadow: 0 0 5px rgba(150,150,155,0.6), inset 0 1px 0 rgba(255,255,255,0.4);
    transition: left 0.22s ease, background 0.22s, box-shadow 0.22s;
  }

  .legacy-switch-knob::after {
    content: "";
    position: absolute;
    left: 3px;
    right: 3px;
    top: 3px;
    height: 2px;
    border-radius: 2px;
    background: rgba(255,255,255,0.35);
  }
  .legacy-switch.right .legacy-switch-knob {
    left: 20px;
    background: linear-gradient(#dcdce2, #8a8a92);
    box-shadow: 0 0 5px rgba(165,165,170,0.65), inset 0 1px 0 rgba(255,255,255,0.45);
  }

  .fs-btn {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 7;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    background: rgba(20,20,20,0.6);
    border: 2px solid rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.9);
    font-family: monospace;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  #box-frame.game-mode .fs-btn { display: flex; }
  .fs-btn:hover { color: #fff; }
  .fs-btn.is-fs {
    background: rgba(60,60,60,0.85);
    box-shadow: 0 0 10px rgba(255,255,255,0.45);
  }

  .hof-fs-btn {
    position: absolute;
    right: 16px;
    bottom: 6px;
    z-index: 7;
    display: none;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    padding: 0;
    border-radius: 10px;
    background: rgba(20,20,20,0.6);
    border: 2px solid rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.9);
    font-family: monospace;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  #box-frame.halloffame-mode .hof-fs-btn { display: flex; }
  .hof-fs-btn:hover { color: #fff; }
  .hof-fs-btn.is-fs {
    background: rgba(60,60,60,0.85);
    box-shadow: 0 0 10px rgba(255,255,255,0.45);
  }

  #box-frame:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    padding: 0;
    border-radius: 0;
    justify-content: center;
    background: #000;
  }
  #box-frame:fullscreen::before { border-radius: 0; padding: 0; }
  #box-frame:fullscreen .halloffame-switch { display: none; }
  #box-frame:fullscreen.halloffame-mode .legacy-switch { display: none; }
  #box-frame:fullscreen.game-mode .legacy-switch { display: none; }
  #box-frame:fullscreen #gameCanvas {
    width: 100vw;
    height: 100vh;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0;
    object-fit: contain;
  }
  #box-frame:fullscreen .halloffame {
    width: 100vw;
    height: 100vh;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0;
  }

  #gameCanvas {
    display: none;
    position: relative;
    z-index: 2;
    width: min(70vw, calc(70vh * 16 / 9), 956px);
    aspect-ratio: 16 / 9;
    height: auto;
    max-height: calc(100vh - 120px);
    border-radius: 8px;
    background: #000;
    touch-action: none;
    cursor: pointer;
  }

  #box-frame.game-mode #player,
  #box-frame.game-mode #local-video { display: none !important; }
  #box-frame.game-mode #gameCanvas { display: block; }

  .halloffame-switch {
    position: absolute;
    top: 4px;
    left: 10px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 14px;
    font-family: monospace;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffd7df;
    background: linear-gradient(180deg, #462036, #24102c);
    border: 1px solid rgba(255,120,140,0.65);
    border-radius: 999px;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.08),
      0 0 0 1px #000,
      0 0 10px rgba(255,90,110,0.28);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    opacity: 0.82;
    transition: box-shadow 0.25s, border-color 0.25s, background 0.25s, color 0.25s, opacity 0.25s;
  }
  .halloffame-switch:hover {
    border-color: rgba(255,150,165,0.92);
    opacity: 1;
  }
  .halloffame-switch.on {
    background: linear-gradient(180deg, #ff3c6a, #c4144a);
    color: #fff;
    border-color: rgba(255,180,195,0.95);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.35),
      0 0 0 1px #000,
      0 0 18px rgba(255,80,115,0.75);
    opacity: 1;
  }
  .halloffame-switch .gs-name-long { display: inline; }
  .halloffame-switch .gs-name-short { display: none; text-transform: none; }

  @keyframes hof-btn-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.4; }
  }
  .halloffame-switch:not(.on) {
    animation: hof-btn-blink 1.2s ease-in-out infinite;
  }
  .halloffame-switch .gs-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid rgba(255,120,140,0.5);
    box-shadow: none;
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
  }
  .halloffame-switch.on .gs-dot {
    background: #ff5a7a;
    border-color: #ffd7e0;
    box-shadow: 0 0 8px rgba(255,90,120,0.9);
  }

  #box-frame .halloffame {
    display: none;
    position: relative;
    z-index: 1;
    width: min(70vw, calc(70vh * 16 / 9), 956px);
    aspect-ratio: 16 / 9;
    height: auto;
    max-height: calc(100vh - 120px);
    border-radius: 8px;
    background: #000;
    overflow: hidden;
    touch-action: none;
  }
  #box-frame.halloffame-mode .halloffame { display: block; }
  #box-frame.halloffame-mode #player,
  #box-frame.halloffame-mode #local-video,
  #box-frame.halloffame-mode #gameCanvas,
  #box-frame.halloffame-mode .movement-control,
  #box-frame.halloffame-mode .fs-btn { display: none !important; }

  #box-frame.halloffame-mode .legacy-switch {
    cursor: default;
    pointer-events: none;
    opacity: 0.45;
    filter: grayscale(1);
    border-color: rgba(185, 185, 190, 0.4);
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,0.7),
      0 0 0 1px #000;
  }
  #box-frame.halloffame-mode .legacy-switch::before,
  #box-frame.halloffame-mode .legacy-switch::after {
    background: #444;
    box-shadow: none;
  }

  .halloffame-viewport {
    position: absolute;
    inset: 0;
    cursor: grab;
  }
  .halloffame-viewport:active { cursor: grabbing; }
  #halloffame-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    transition: transform 0.32s ease, opacity 0.32s ease;
    background: #000;
  }
  #halloffame-img.to-left  { transform: translateX(-26%); opacity: 0; }
  #halloffame-img.to-right { transform: translateX(26%);  opacity: 0; }
  #halloffame-img.from-left  { animation: g-in-right 0.32s ease; }
  #halloffame-img.from-right { animation: g-in-left  0.32s ease; }
  @keyframes g-in-right { from { transform: translateX(26%); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes g-in-left  { from { transform: translateX(-26%); opacity: 0; } to { transform: none; opacity: 1; } }

  .halloffame-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #0a0a10;
    color: #b9a8ff;
    font-family: monospace;
    font-size: 0.68rem;
    letter-spacing: 3px;
    text-transform: uppercase;
  }
  .halloffame-loading .spinner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid rgba(150,120,255,0.25);
    border-top-color: #a78bff;
    animation: halloffame-spin 0.8s linear infinite;
  }
  @keyframes halloffame-spin { to { transform: rotate(360deg); } }

  .halloffame-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(20,20,30,0.55);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  #box-frame.halloffame-mode .halloffame:hover .halloffame-nav,
  #box-frame.halloffame-mode .halloffame:focus-within .halloffame-nav { opacity: 1; }
  .halloffame-nav:hover { background: rgba(100,70,255,0.6); }
  .halloffame-nav.prev { left: 10px; }
  .halloffame-nav.next { right: 10px; }

  .halloffame-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    z-index: 3;
    font-family: monospace;
    font-size: 0.6rem;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 3px #000;
    background: rgba(0,0,0,0.4);
    padding: 2px 8px;
    border-radius: 4px;
    user-select: none;
  }

  .halloffame-volume {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 2px 12px;
    background: rgba(10,10,16,0.65);
    border: 1px solid rgba(110,60,190,0.7);
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  }
  #box-frame.halloffame-mode .halloffame-volume { display: flex; }
  #box-frame:fullscreen.halloffame-mode .halloffame-volume { display: none; }
  .halloffame-volume .vol-btn {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .halloffame-volume .vol-slider {
    width: 84px;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: #4a4a52;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
  }
  .halloffame-volume .vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #9a9aa2;
    border: 1px solid #000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    cursor: pointer;
  }
  .halloffame-volume .vol-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #9a9aa2;
    border: 1px solid #000;
    cursor: pointer;
  }

  .halloffame-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: none;
    font-family: monospace;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
    white-space: nowrap;
    color: #ffd7df;
    text-shadow:
      0 0 8px rgba(255,60,106,0.9),
      0 0 22px rgba(255,60,106,0.5);
    pointer-events: none;
    user-select: none;
  }
  @keyframes hof-fade {
    0% { opacity: 0; }
    10% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
  }

  .movement-control {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 6;
  }
  #box-frame.game-mode .movement-control { display: flex; }

  .mobile-btn {
    --s: 52px;
    width: var(--s);
    height: calc(var(--s) - 6px);
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    background: rgba(20,20,20,0.55);
    color: rgba(255,255,255,0.9);
    font-family: monospace;
    font-size: calc(var(--s) * 0.5);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(2px);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  }
  .mobile-btn:active { background: rgba(255,80,120,0.6); }

  #footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9997;
    text-align: center;
    color: #eee;
    font-family: monospace;
    font-size: 0.5rem;
    padding: 8px 0;
  }

  #footer :hover {
    color: #fff;
  }

  #footer .at::after {
    color: #fff;
    content: "@";
  }

  #matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.65;
  }

  #dino {
    position: fixed;
    bottom: 28px;
    left: -80px;
    z-index: 9998;
    pointer-events: none;
    transition: none;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.55));
  }

  #dino .dino-inner {
    position: relative;
    width: 80px;
    height: 84px;
  }

  @keyframes far-leg-walk {
    0%   { transform: rotate(0deg);  transform-origin: 36px 54px; }
    35%  { transform: rotate(-16deg); transform-origin: 36px 54px; }
    48%  { transform: rotate(-16deg); transform-origin: 36px 54px; }
    55%  { transform: rotate(0deg);  transform-origin: 36px 54px; }
    100% { transform: rotate(0deg);  transform-origin: 36px 54px; }
  }
  @keyframes near-leg-walk {
    0%   { transform: rotate(0deg);  transform-origin: 42px 54px; }
    55%  { transform: rotate(0deg);  transform-origin: 42px 54px; }
    80%  { transform: rotate(-16deg); transform-origin: 42px 54px; }
    90%  { transform: rotate(-16deg); transform-origin: 42px 54px; }
    95%  { transform: rotate(0deg);  transform-origin: 42px 54px; }
    100% { transform: rotate(0deg);  transform-origin: 42px 54px; }
  }
  @keyframes far-arm-swing {
    0%   { transform: rotate(0deg);  transform-origin: 45px 42px; }
    35%  { transform: rotate(8deg);  transform-origin: 45px 42px; }
    48%  { transform: rotate(8deg);  transform-origin: 45px 42px; }
    55%  { transform: rotate(0deg);  transform-origin: 45px 42px; }
    100% { transform: rotate(0deg);  transform-origin: 45px 42px; }
  }
  @keyframes near-arm-swing {
    0%   { transform: rotate(0deg);  transform-origin: 48px 40px; }
    55%  { transform: rotate(0deg);  transform-origin: 48px 40px; }
    80%  { transform: rotate(10deg); transform-origin: 48px 40px; }
    90%  { transform: rotate(10deg); transform-origin: 48px 40px; }
    95%  { transform: rotate(0deg);  transform-origin: 48px 40px; }
    100% { transform: rotate(0deg);  transform-origin: 48px 40px; }
  }

  @keyframes blink {
    0%, 92%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
  }

  @keyframes look-left {
    0%   { transform: rotate(0deg); }
    20%  { transform: rotate(20deg); }
    65%  { transform: rotate(20deg); }
    100% { transform: rotate(0deg); }
  }
  @keyframes look-right {
    0%   { transform: rotate(0deg); }
    20%  { transform: rotate(-18deg); }
    65%  { transform: rotate(-18deg); }
    100% { transform: rotate(0deg); }
  }

  @keyframes h1-blink {
    0%, 49% { color: #ff00ff; text-shadow: 0 0 5px rgba(255,0,255,0.7), 0 0 15px rgba(255,0,255,0.35), 0 0 30px rgba(255,0,255,0.1); }
    50%, 100% { color: #00ffff; text-shadow: 0 0 5px rgba(0,255,255,0.5), 0 0 12px rgba(0,255,255,0.25); }
  }

  @keyframes h1-glow-pulse {
    0%, 100% { text-shadow: 0 0 5px rgba(255,0,255,0.7), 0 0 15px rgba(255,0,255,0.35), 0 0 30px rgba(255,0,255,0.1); }
    50% { text-shadow: 0 0 8px rgba(255,0,255,0.9), 0 0 25px rgba(255,0,255,0.5), 0 0 45px rgba(255,0,255,0.2); }
  }

  @media (max-width: 768px) {
    #box-frame iframe,
    #box-frame video,
    #player,
    #gameCanvas,
    #box-frame .halloffame {
      width: min(92vw, calc(55vh * 16 / 9), 500px);
      aspect-ratio: 16 / 9;
      height: auto;
      max-height: calc(100vh - 120px);
    }
    #welcome {
      font-size: 75%;
    }
    #box-frame {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }

    #box-frame,
    #box-frame::before {
      padding-left: 4px;
      padding-right: 4px;
    }

    .mobile-btn { --s: 47px; }
    .movement-control { gap: 12px; bottom: 7px; }
    .fs-btn { width: 41px; height: 41px; font-size: 17px; }

    .halloffame-switch .gs-dot { display: none; }
    .halloffame-switch { padding: 4px 12.5px; }
    .halloffame-switch .gs-name-long { display: none; }
    .halloffame-switch .gs-name-short { display: inline; }

    .halloffame-volume { padding: 0px 5px; bottom: 7px; }
    .halloffame-volume .vol-slider { width: 54px; }

    #box-frame.halloffame-mode .halloffame-title {
      display: block;
      animation: hof-fade 3.2s ease forwards;
      color: #8f4a58;
      text-shadow:
        0 0 8px rgba(255,60,106,0.55),
        0 0 22px rgba(255,60,106,0.28);
      transform: translate(-50%, calc(-50% - 24px));
    }
  }

  @media (min-width: 360px) and (max-width: 768px) {
    .legacy-switch {
      left: auto;
      right: 14px;
      transform: none;
    }
    .halloffame-switch .gs-name-long { display: inline; }
    .halloffame-switch .gs-name-short { display: none; }
  }
