@font-face {
            font-family: 'Apple2';
            src: url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
        }

        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            padding: 0;
            background: #000000;
            color: #33ff33;
            font-family: 'Courier New', monospace;
            font-size: 14px;
            line-height: 1.2;
            overflow-x: hidden;
            text-transform: uppercase;
            letter-spacing: 1px;
            image-rendering: pixelated;
            -webkit-font-smoothing: none;
            -moz-osx-font-smoothing: grayscale;
        }

        /* CRT monitor effect */
        body::before {
            content: "";
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: repeating-linear-gradient(
                0deg,
                rgba(0, 0, 0, 0.15),
                rgba(0, 0, 0, 0.15) 1px,
                transparent 1px,
                transparent 2px
            );
            pointer-events: none;
            z-index: 1000;
        }

        /* Phosphor glow effect */
        body::after {
            content: "";
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
            pointer-events: none;
            z-index: 999;
        }

        .container {
            width: 100%;
            max-width: 100%;
            padding: 20px;
            position: relative;
        }

        h1 {
            text-align: center;
            margin: 0 0 20px 0;
            font-size: 3rem;
            font-weight: normal;
            text-shadow: 0 0 10px #33ff33;
        }

        .header-bar {
            text-align: center;
            margin-bottom: 20px;
            padding: 10px;
            border: 2px solid #33ff33;
            background: #000000;
        }

        .controls {
            margin-bottom: 20px;
            padding: 15px;
            border: 2px solid #33ff33;
            display: flex;
            gap: 20px;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            background: #000000;
        }

        button {
            padding: 8px 16px;
            border: 2px solid #33ff33;
            background: #000000;
            color: #33ff33;
            font-family: 'Courier New', monospace;
            font-size: 12px;
            cursor: pointer;
            text-transform: uppercase;
            letter-spacing: 1px;
            transition: all 0.1s;
            text-shadow: 0 0 5px #33ff33;
        }

        button:hover {
            background: #33ff33;
            color: #000000;
            box-shadow: 0 0 10px #33ff33;
        }

        button:active {
            transform: translate(1px, 1px);
        }

        button:disabled {
            border-color: #1a7f1a;
            color: #1a7f1a;
            cursor: not-allowed;
            text-shadow: none;
        }

        button:disabled:hover {
            background: #000000;
            color: #1a7f1a;
            box-shadow: none;
        }

        #recordBtn.recording {
            animation: blink 0.5s infinite;
        }

        @keyframes blink {
            0%, 50% { 
                background: #33ff33;
                color: #000000;
            }
            51%, 100% { 
                background: #000000;
                color: #33ff33;
            }
        }

        .status {
            text-align: center;
            margin: 10px 0;
            font-size: 12px;
            text-shadow: 0 0 5px #33ff33;
        }

        .oscilloscope {
            border: 2px solid #33ff33;
            margin-bottom: 20px;
            position: relative;
            background: #000000;
            padding: 10px;
        }

        .oscilloscope canvas {
            display: block;
            width: 100%;
            height: 150px;
            image-rendering: pixelated;
        }

        .oscilloscope-label {
            position: absolute;
            top: 5px;
            left: 10px;
            font-size: 10px;
            text-shadow: 0 0 5px #33ff33;
        }

        /* Speed Controls */
        .speed-controls {
            border: 2px solid #33ff33;
            padding: 15px;
            margin-bottom: 20px;
            background: #000000;
        }

        .speed-controls h3 {
            margin: 0 0 15px 0;
            text-align: center;
            font-size: 14px;
            text-shadow: 0 0 5px #33ff33;
        }

        .speed-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .speed-btn {
            width: 60px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: bold;
        }

        .speed-btn:hover {
            background: #33ff33;
            color: #000000;
            box-shadow: 0 0 10px #33ff33;
        }

        .speed-btn:disabled {
            border-color: #1a7f1a;
            color: #1a7f1a;
        }

        .speed-btn.selected {
            background: #33ff33;
            color: #000000;
            box-shadow: 0 0 10px #33ff33;
        }

        .speed-btn.selected:disabled {
            background: #33ff33;
            color: #000000;
            border-color: #33ff33;
        }

        /* Piano Controls */
        .piano-container {
            overflow-x: auto;
            padding: 15px;
            border: 2px solid #33ff33;
            background: #000000;
            margin-bottom: 20px;
        }

        .piano-container h3 {
            margin: 0 0 15px 0;
            text-align: center;
            font-size: 14px;
            text-shadow: 0 0 5px #33ff33;
        }

        .piano {
            position: relative;
            margin: 0 auto;
            display: inline-block;
            padding-bottom: 10px;
        }

        .keys {
            display: flex;
            position: relative;
            height: 120px;
        }

        .key {
            position: relative;
            cursor: pointer;
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
        }

        .white-key {
            width: 20px;
            height: 120px;
            border: 1px solid #33ff33;
            background: #000000;
            position: relative;
            z-index: 1;
            margin-right: 1px;
        }

        .white-key:hover,
        .white-key:active,
        .white-key.active {
            background: #33ff33;
            box-shadow: 0 0 10px #33ff33;
        }

        .white-key.middle-c {
            border-width: 2px;
            box-shadow: 0 0 5px #33ff33;
        }

        .black-key {
            width: 14px;
            height: 70px;
            background: #33ff33;
            border: 1px solid #33ff33;
            position: absolute;
            top: 0;
            z-index: 2;
            margin-left: -7px;
        }

        .black-key:hover,
        .black-key:active,
        .black-key.active {
            background: #000000;
            box-shadow: inset 0 0 10px #33ff33;
        }

        .key-label {
            position: absolute;
            bottom: 5px;
            width: 100%;
            text-align: center;
            font-size: 8px;
            pointer-events: none;
        }

        .white-key .key-label {
            color: #33ff33;
        }

        .white-key:hover .key-label,
        .white-key.active .key-label {
            color: #000000;
        }

        .black-key .key-label {
            color: #000000;
            bottom: 10px;
            font-size: 7px;
        }

        .black-key:hover .key-label,
        .black-key.active .key-label {
            color: #33ff33;
        }

        .octave-label {
            position: absolute;
            bottom: 15px;
            left: 5px;
            font-size: 7px;
            pointer-events: none;
        }

        .instructions {
            border: 2px solid #33ff33;
            padding: 15px;
            margin-top: 20px;
            background: #000000;
            font-size: 12px;
            line-height: 1.6;
        }

        .instructions p {
            margin: 5px 0;
        }

        .scroll-hint {
            text-align: center;
            font-size: 10px;
            margin-bottom: 10px;
            animation: blink-text 2s infinite;
        }

        @keyframes blink-text {
            0%, 50% { opacity: 1; }
            51%, 100% { opacity: 0.5; }
        }

        /* ASCII art border effect */
        .ascii-border {
            white-space: pre;
            font-size: 10px;
            line-height: 1;
            text-align: center;
            margin: 10px 0;
        }

        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }

        ::-webkit-scrollbar-track {
            background: #000000;
            border: 1px solid #33ff33;
        }

        ::-webkit-scrollbar-thumb {
            background: #33ff33;
            border: 1px solid #000000;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #33ff33;
            box-shadow: 0 0 5px #33ff33;
        }