.c64-keyboard {
    color: #f7f2e9;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-style: normal;
    text-align: left;
    margin: 12px auto;
    max-width: 1180px;
}
.c64-keyboard-scroll { overflow-x: auto; padding: 2px 2px 8px; }
.c64-keyboard-case {
    min-width: 900px;
    padding: 20px 20px 22px;
    border: 1px solid #9d957f;
    border-radius: 14px;
    background: linear-gradient(165deg, #d8cfb8, #b7ad95 75%, #a99f89);
    box-shadow: inset 0 2px 2px #f4efdd, inset 0 -4px 4px #958b77, 0 2px 3px #0002;
}
.c64-keyboard-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 9px 20px;
    margin: 4px -12px 32px;
    background: repeating-linear-gradient(to bottom, #afa58e 0 2px, #d5cbb3 2px 4px, #b5ab95 4px 6px);
    border-radius: 7px;
}
.c64-brand-badge, .c64-power {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #8f8a7d;
    border: 2px solid #dfd7c2;
    border-radius: 24px;
    padding: 2px 12px;
    font-weight: 600;
    letter-spacing: .03em;
}
.c64-brand-badge { font-size: 21px; }
.c64-brand-mark { font-weight: 750; }
.c64-brand-rainbow {
    display: inline-block;
    width: 76px;
    height: 21px;
    background: linear-gradient(to bottom, #b34737 0 20%, #d58a38 20% 40%, #d7b84d 40% 60%, #529b79 60% 80%, #548caa 80%);
}
.c64-power { font-size: 11px; }
.c64-power > span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #5f5042;
    background: #5e2925;
}
.c64-power > .is-on { background: radial-gradient(at 35% 25%, #ffd1bd, #ec4638 35%, #9b211f 75%); }
.c64-keyboard-bed { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 24px; }
.c64-keyboard-main { display: flex; flex-direction: column; gap: 4px; }
.c64-keyboard-row { display: grid; grid-template-columns: repeat(32, minmax(0, 1fr)); gap: 4px; }
.c64-keyboard-functions { display: grid; grid-template-rows: repeat(4, 52px); gap: 4px; }
.c64-keyboard .c64-key {
    position: relative;
    appearance: none;
    box-sizing: border-box;
    min-width: 0;
    min-height: 52px;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    margin: 0;
    padding: 3px 2px 6px;
    border: 1px solid #26251f;
    border-top-color: #7b786c;
    border-radius: 7px;
    background: linear-gradient(150deg, #625f55, #44423b 75%);
    color: #fffaf1;
    box-shadow: inset 0 1px 1px #aaa18a70, inset 0 -4px 2px #2d2b27, 0 2px 1px #49443b;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.12;
    white-space: pre-line;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}
.c64-key-primary { font-size: 20px; }
.c64-key-secondary { font-size: 12px; opacity: .9; }
.c64-key-word .c64-key-primary { font-size: 11px; }
.c64-keyboard .c64-key:hover:not(:disabled) { border-color: #b1a68c; }
.c64-keyboard .c64-key:active:not(:disabled), .c64-keyboard .c64-key.is-held {
    background: #38362f;
    box-shadow: inset 0 2px 4px #14130f, 0 1px 0 #e5d9bf;
}
.c64-keyboard .c64-key.is-latched {
    background: linear-gradient(145deg, #328b97, #146170);
    border-color: #76c2cc;
    color: #fff;
    box-shadow: inset 0 1px 1px #a6dee0, inset 0 -3px 2px #124e59;
}
.c64-keyboard .c64-key:focus-visible, .c64-release-all:focus-visible { outline: 3px solid #13788b; outline-offset: 2px; }
.c64-key-lock { position: absolute; left: 3px; top: 3px; width: 11px; height: 11px; }
.c64-keyboard .c64-key:disabled { cursor: default; opacity: .7; }
.c64-keyboard-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 2px;
    padding: 9px 12px;
    border: 1px solid #b6b7b8;
    border-radius: 8px;
    background: #e4e5e5;
    color: #292d2d;
    font-size: 14px;
}
.c64-keyboard-status > span { flex: 1 1 180px; overflow-wrap: anywhere; }
.c64-release-all {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 5px 16px;
    border: 1px solid #999f9f;
    border-radius: 6px;
    background: linear-gradient(#fafbfb, #d2d7d7);
    color: #292d2d;
    font: inherit;
    cursor: pointer;
}
.c64-release-all:disabled { opacity: .55; cursor: default; }
.c64-keyboard-help { margin: 6px 4px 0; color: #5a5a55; font-size: 12px; }
