/* KeyboardTest.org - home.css
   Homepage keyboard tester only. Load after global.css. */

:root {
    --def-fs: 62.5%;
    --ff: 'Segoe UI', sans-serif;
    --color-primary: #343a40;
    --color-primary-darker: #333;
    --color-primary-lighter: #555;

    /* -------- DEFAULT KEYBOARD THEME | RETRO -------- */
    /* - INSPIRED BY KBParadise VX80 Olivette Neo TKL - */
    --key-border-radius: 0.6rem;

    --box-shadow-keycaps-value: inset 0 -0.2rem 0 0.3rem;
    --box-shadow-keycaps-hover-value: inset 0 -0.1rem 0 0.2rem;

    --box-shadow-keycaps: var(--box-shadow-keycaps-value) var(--color-keycaps-shadow);
    --box-shadow-keycaps-hover: var(--box-shadow-keycaps-hover-value) var(--color-keycaps-shadow);

    --box-shadow-keycaps-accent: var(--box-shadow-keycaps-value) var(--color-keycaps-shadow-accent);
    --box-shadow-keycaps-accent-hover: var(--box-shadow-keycaps-hover-value) var(--color-keycaps-shadow-accent);

    --box-shadow-keycaps-pressed: var(--box-shadow-keycaps-value) var(--color-keycaps-shadow-pressed);
    --box-shadow-keycaps-pressed-hover: var(--box-shadow-keycaps-hover-value) var(--color-keycaps-shadow-pressed);

    --color-keyboard: #3c3e4a;
    --color-keyboard-border: #303642;

    --color-keycaps-legends: #555;
    --color-keycaps-bg: #f8f9fa;
    --color-keycaps-shadow: #adb5bd;

    --color-keycaps-legends-accent: #555;
    --color-keycaps-bg-accent: #e2e3e6;
    --color-keycaps-shadow-accent: #97a0a8;

    --color-keycaps-legends-pressed: #2f3674;
    --color-keycaps-bg-pressed: #a4a9b0;
    --color-keycaps-shadow-pressed: #7f8489;

    /* styling background of elements */

    --color-bg: linear-gradient(45deg,
            #e9ecef,
            #ced4da,
            #adb5bd,
            #eaebf1,
            #c1c3d5);

    --color-bg-title: linear-gradient(45deg,
            #14181c,
            #506070,
            #2e3235,
            #506070,
            #2e3235,
            #506070,
            #14181c);

    --color-bg-toggle: linear-gradient(45deg, #4dabf7, #228be6, #1c70c0, #3c56da);
}

/*style.css*/
:root {
    /* example of a standard key: "W" Key on the KB */
    --standard-key-size: 5rem;
    /* width & height */
}

/* ------------------ BACKGROUND ------------------ */
/* ------------------ HEADER ------------------ */

.intro {
    max-width: 130rem;
    margin: 0 auto;
    padding: 4.8rem 3.2rem 0rem;
}

.title span {
    background-image: var(--color-bg-title);

    /* Use the text as a mask for the background. */
    /* This will show the gradient as a text color rather than element bg. */
    background-clip: text;
    -webkit-background-clip: text;
    -moz-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
}

.theme-and-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 120rem;
    margin: 0 auto 2.4rem;
    transition: all 0.25s;
}

.toggle-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.toggle-section span {
    font-size: 2.4rem;
    cursor: pointer;
}

/* slider styling */

.slider-container {
    width: 80%;
    margin: 1.6rem auto;
    text-align: center;
}

.slider {
    width: 100%;
    transform: translateY(1.8rem);
}

/* Styling the track */
input[type='range']::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #555555, #f1f3f5);
}

/* Styling the thumb */
input[type='range']::-webkit-slider-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #555;
    /* Thumb color */
    cursor: pointer;
    -webkit-appearance: none;
    transition: all 0.3s ease;
    /* Smooth transition */
    transform: translateY(-0.4rem);
}

/* Highlighting the thumb on hover */
input[type='range']::-webkit-slider-thumb:hover {
    box-shadow: 0 0 10px rgb(84, 84, 84, 0.4);
    /* Add a subtle box-shadow on hover */
    transform: translateY(-0.4rem) scale(1.2);
}

.slider-value {
    font-size: 2.4em;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    color: #000;
    /* Match the thumb color */
    background: rgb(255, 167, 0);
    /* Background color for the value */
    box-shadow: 0 0 10px rgb(84, 84, 84, 0.1);
    /* Add a subtle box-shadow to the value */
}

.theme-section {
    display: flex;
    justify-content: end;
    align-items: center;
    gap: 2rem;
}

.theme-section > div {
    display: flex;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
}

.theme-color {
    width: 25%;
}

/* retro theme */
.retro div:nth-child(1) {
    background-color: #3c3e4a;
}

.retro div:nth-child(2) {
    background-color: #f8f9fa;
}

.retro div:nth-child(3) {
    background-color: #a4a9b0;
}

.retro div:nth-child(4) {
    background-color: #2f3674;
}

/* navy-blue */
.navy-blue div:nth-child(1) {
    background-color: #2a309c;
}

.navy-blue div:nth-child(2) {
    background-color: #3d489b;
}

.navy-blue div:nth-child(3) {
    background-color: #a4a9b0;
}

.navy-blue div:nth-child(4) {
    background-color: #2f3674;
}

/* ------------------ KEYBOARD SECTION ------------------ */
/* =========================================================
   Keyboard overlap fix
   Keep every key inside its CSS Grid cell, including wide
   padded keys such as Shift, Ctrl, Caps, Enter and Backspace.
   ========================================================= */
.keyboard,
.keyboard *,
.keyboard *::before,
.keyboard *::after {
  box-sizing: border-box;
}

.keyboard .region,
.keyboard .first-row,
.keyboard .second-row,
.keyboard .third-row,
.keyboard .fourth-row,
.keyboard .fifth-row,
.keyboard .key {
  min-width: 0;
}

.keyboard .key {
  max-width: 100%;
}


.keyboard {
    display: grid;
    margin: 0 auto;
    padding: 0.8rem;
    border-radius: 0.4rem;
    background-color: var(--color-keyboard);
    box-shadow: 0 0.4rem 0 0.6rem var(--color-keyboard-border),
        0 1.2rem 3.2rem rgba(0, 0, 0, 0.1);

    /* force GPU acceleration to reduce
   potential subrendering issues */
    transform: translateZ(0);

    transition: all 0.2s;
}

.full-size {
    grid-template-columns: 215fr 2fr 45fr 1fr 60fr;
    max-width: 122rem;
}

.tkl {
    /* whitespace in the tkl layout increased 
  to 7fr for better region seperation */
    grid-template-columns: 215fr 7fr 45fr;
    max-width: 100rem;
}

.seventy-five-percent {
    grid-template-columns: 79rem 0 16.5rem;
    max-width: 86rem;
}

.key {
    width: 100%;
    height: var(--standard-key-size);
    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: var(--key-border-radius);
    font-size: 1.2rem;
    font-weight: 700;

    color: var(--color-keycaps-legends);
    background-color: var(--color-keycaps-bg);
    box-shadow: var(--box-shadow-keycaps);
    cursor: pointer;

    transition: all 0.075;
}

.key--accent-color {
    color: var(--color-keycaps-legends-accent);
    background-color: var(--color-keycaps-bg-accent);
    box-shadow: var(--box-shadow-keycaps-accent);
}

/* making specificity higher by adding .key */
.key.key--pressed {
    color: var(--color-keycaps-legends-pressed);
    background-color: var(--color-keycaps-bg-pressed);
    box-shadow: var(--box-shadow-keycaps-pressed);
}

/* key pressing simulation class is for using in js */
.key:hover,
.key--accent-color:hover,
.key--pressed:hover,
.key-pressing-simulation {
    transform: scale(0.98);
    box-shadow: var(--box-shadow-keycaps-hover);
}

.key--accent-color:hover {
    box-shadow: var(--box-shadow-keycaps-accent-hover);
}

.key--pressed:hover,
.key-pressing-simulation {
    box-shadow: var(--box-shadow-keycaps-pressed-hover);
}

.key.key-pressing-simulation {
    color: var(--color-keycaps-legends-pressing);
}

/* __________________________________
   ||||||||||||||||||||||||||||||||||
   |||| GENERAL KB LAYOUT STYLES ||||
   ||||||||||||||||||||||||||||||||||
*/

.region {
    padding: 0.5rem;
    gap: 0.25rem;
}

/* contains "ESC" & Function (F1-F12) */
.function {
    display: grid;
    grid-template-columns: 2fr 2fr repeat(4, 2fr) 1fr repeat(4, 2fr) 1fr repeat(4,
            2fr);
}

/* contains Top-Located Control (Prt Sc|Scr lck|Pause) keys  */
.system-control {
    grid-column: 3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

/* contains Modifiers/Control (Ctrl|Alt|etc.) & Alpha (A-Z) keys */
.typewriter {
    grid-row: 2;
    display: grid;
}

.first-row,
.second-row,
.third-row,
.fourth-row,
.fifth-row {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
}

.first-row {
    grid-template-columns: repeat(13, 1fr) 2fr;
}

.second-row {
    grid-template-columns: 1.5fr repeat(12, 1fr) 1.5fr;
}

.third-row {
    grid-template-columns: 1.79fr repeat(11, 1fr) 2.29fr;
}

.fourth-row {
    grid-template-columns: 2.29fr repeat(10, 1fr) 2.79fr;
}

.fifth-row {
    grid-template-columns: repeat(3, 1.29fr) 6.36fr repeat(4, 1.29fr);
}

/* contains Navigation (PgUp|PgDn|etc.) & Arrow keys */
.navigation {
    grid-column: 3;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
}

/* contains Numpad Keys */
.numpad {
    grid-column: 5;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
}

/* _______________________________
   |||||||||||||||||||||||||||||||
   |||| KEY SPECIFIC STYLES ||||||
   |||||||||||||||||||||||||||||||
*/

/**************************/
/* TYPEWRITER REGION KEYS */
/**************************/

/* styling keys with sublegends */
.key--sublegend {
    display: grid;
    grid-template-rows: 1fr auto auto 1fr;
    padding-top: 0.8rem;
    gap: 0.1rem;
}

.key--sublegend span:nth-child(odd),
.key--sublegend span:nth-child(even) {
    width: 100%;
    text-align: center;
    grid-row: 1;
}

.key--sublegend span:nth-child(even) {
    grid-row: 2;
}

/* styling enter key as return sign  */
.enter span {
    transform: translateY(-0.25rem);
    font-size: 2.8rem;
}

/* windows and context menu icons */
.metaleft svg {
    width: 1.8rem;
    height: 1.8rem;
    fill: var(--color-keycaps-legends);
}

.metaleft .key--accent svg {
    fill: var(--color-keycaps-legends-accent);
}

.metaleft.key--pressed svg {
    fill: var(--color-keycaps-legends-pressed);
}

.metaleft.key-pressing-simulation svg {
    fill: var(--color-keycaps-legends-pressing);
}

.metaright svg {
    width: 1.8rem;
    height: 1.8rem;
    fill: var(--color-keycaps-legends);
}

.metaright .key--accent svg {
    fill: var(--color-keycaps-legends-accent);
}

.metaright.key--pressed svg {
    fill: var(--color-keycaps-legends-pressed);
}

.metalright.key-pressing-simulation svg {
    fill: var(--color-keycaps-legends-pressing);
}

.contextmenu svg {
    width: 2rem;
    height: 2rem;
    stroke: var(--color-keycaps-legends);
    fill: none;
}

.contextmenu .key--accent svg {
    stroke: var(--color-keycaps-legends-accent);
}

.contextmenu.key--pressed svg {
    stroke: var(--color-keycaps-legends-pressed);
}

.contextmenu.key-pressing-simulation svg {
    stroke: var(--color-keycaps-legends-pressing);
}

/* spacebar legend */
.space span {
    transform: translateY(-1.6rem);
    font-size: 1.6rem;
}

/* side keys text aligning */
.backquote,
.tab,
.capslock,
.shiftleft,
.controlleft {
    justify-content: left;
    padding-left: 1.6rem;
}

.backspace,
.enter,
.shiftright,
.controlright {
    justify-content: right;
    padding-right: 1.6rem;
}

/**************************/
/* NAVIGATION REGION KEYS */
/**************************/

.arrowup {
    grid-column: 2;
    grid-row: 4;
}

.arrowleft,
.arrowdown,
.arrowright {
    grid-row: 5;
}

.arrowup svg,
.arrowleft svg,
.arrowdown svg,
.arrowright svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: var(--color-keycaps-legends);
}

.arrowup.key--pressed svg,
.arrowleft.key--pressed svg,
.arrowdown.key--pressed svg,
.arrowright.key--pressed svg {
    fill: var(--color-keycaps-legends-pressed);
}

.arrowup.key-pressing-simulation svg,
.arrowleft.key-pressing-simulation svg,
.arrowdown.key-pressing-simulation svg,
.arrowright.key-pressing-simulation svg {
    fill: var(--color-keycaps-legends-pressing);
}

/**********************/
/* NUMPAD REGION KEYS */
/**********************/

.numpadadd {
    grid-column: 4;
    grid-row: 2 / span 2;
    height: 100%;
}

.numpadenter {
    grid-column: 4;
    grid-row: 4 / span 2;
    height: 100%;
}

.numpad0 {
    grid-column: 1 / span 2;
}

/* _____________________________________
   |||||||||||||||||||||||||||||||||||||
   |||| Changing Layout Animation ||||||
   |||||||||||||||||||||||||||||||||||||
*/

.numpad {
    transition: all 0.15s;
}

/* simply using display:none; doesn't work because 
then we can't use transitions anymore

STEPS FOR REMOVING NUMPAD FROM FULL-SIZE KEYBOARD: */
.hidden--step1 {
    /* 1) Hide it visually */
    opacity: 0;
    /* 2) Make it inaccessible to mouse and keyboard */
    pointer-events: none;
    /* 3) Hide it from screen readers */
    visibility: hidden;

    transition: all 0.15;
}

.hidden--step2 {
    width: 0;
    padding: 0;
}


/*theme.css*/
.theme--retro {
    /* -------- DEFAULT KEYBOARD THEME | RETRO -------- */
    /* - INSPIRED BY KBParadise VX80 Olivette Neo TKL - */

    --key-border-radius: 0.6rem;

    --box-shadow-keycaps: var(--box-shadow-keycaps-value) var(--color-keycaps-shadow);
    --box-shadow-keycaps-hover: var(--box-shadow-keycaps-hover-value) var(--color-keycaps-shadow);

    --box-shadow-keycaps-accent: var(--box-shadow-keycaps-value) var(--color-keycaps-shadow-accent);
    --box-shadow-keycaps-accent-hover: var(--box-shadow-keycaps-hover-value) var(--color-keycaps-shadow-accent);

    --box-shadow-keycaps-pressed: var(--box-shadow-keycaps-value) var(--color-keycaps-shadow-pressed);
    --box-shadow-keycaps-pressed-hover: var(--box-shadow-keycaps-hover-value) var(--color-keycaps-shadow-pressed);

    --color-keyboard: #3c3e4a;
    --color-keyboard-border: #303642;

    --color-keycaps-legends: #555;
    --color-keycaps-bg: #f8f9fa;
    --color-keycaps-shadow: #adb5bd;

    --color-keycaps-legends-accent: #555;
    --color-keycaps-bg-accent: #e2e3e6;
    --color-keycaps-shadow-accent: #97a0a8;

    --color-keycaps-legends-pressing: #f03e3e;

    --color-keycaps-legends-pressed: #080e42;
    --color-keycaps-bg-pressed: #a4a9b0;
    --color-keycaps-shadow-pressed: #7f8489;
}

.theme--navy-blue {
    /* -------- OPTIONAL KEYBOARD THEME | NAVY BLUE -------- */
    /* ------- INSPIRED BY Keychron Q3 QMK NAVY BLUE ------- */

    --key-border-radius: 1.2rem;

    --box-shadow-keycaps-value: inset 0 -0.2rem 0 0.3rem;
    --box-shadow-keycaps-hover-value: inset 0 -0.1rem 0 0.2rem;

    --box-shadow-keycaps: var(--box-shadow-keycaps-value) var(--color-keycaps-shadow);
    --box-shadow-keycaps-hover: var(--box-shadow-keycaps-hover-value) var(--color-keycaps-shadow);

    --box-shadow-keycaps-accent: var(--box-shadow-keycaps-value) var(--color-keycaps-shadow-accent);
    --box-shadow-keycaps-accent-hover: var(--box-shadow-keycaps-hover-value) var(--color-keycaps-shadow-accent);

    --box-shadow-keycaps-pressed: var(--box-shadow-keycaps-value) var(--color-keycaps-shadow-pressed);
    --box-shadow-keycaps-pressed-hover: var(--box-shadow-keycaps-hover-value) var(--color-keycaps-shadow-pressed);

    --color-keyboard: #2a309c;
    --color-keyboard-border: #21267e;

    --color-keycaps-legends: #fff;
    --color-keycaps-bg: #3d489b;
    --color-keycaps-shadow: #1c2880;

    --color-keycaps-legends-accent: #fff;
    --color-keycaps-bg-accent: #4f71e4;
    --color-keycaps-shadow-accent: #2e43ad;

    --color-keycaps-legends-pressing: #f03e3e;

    --color-keycaps-legends-pressed: #555;
    --color-keycaps-bg-pressed: #f8f9fa;
    --color-keycaps-shadow-pressed: #adb5bd;
}

/* *** You can define more themes here... *** */
/* Be sure to also write the essential codes for 
added themes in both index.html & style.css */





/* Homepage tester UI */
.tester-shell {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 16px 22px;
  background: var(--site-card);
  border: 1px solid var(--site-border);
  border-radius: var(--site-radius);
  box-shadow: var(--site-shadow);
  overflow: hidden;
}
.tester-heading-row {
  max-width: 1200px;
  margin: 0 auto 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  font-size: 16px;
  line-height: 1.55;
}
.tester-heading-row h2 {
  margin: 0 0 4px;
  font-size: 25px;
  line-height: 1.25;
  color: #182031;
}
.tester-heading-row p { margin: 0; color: var(--site-muted); }
.privacy-note {
  flex: 0 0 auto;
  padding: 8px 10px;
  background: #eef9f3;
  border: 1px solid #cfe9da;
  border-radius: 10px;
  color: #17633f;
  font-size: 13px;
  font-weight: 700;
}

.test-stats {
  max-width: 1200px;
  margin: 14px auto 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  font-size: 16px;
}
.stat {
  min-width: 0;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--site-border);
  border-radius: 12px;
}
.stat-label {
  display: block;
  margin-bottom: 4px;
  color: var(--site-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.stat strong {
  display: block;
  overflow: hidden;
  color: #172033;
  font-size: 22px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-wrap {
  max-width: 1200px;
  margin: 0 auto 12px;
  font-size: 13px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
  color: var(--site-muted);
  font-weight: 700;
}
.progress-track {
  height: 8px;
  overflow: hidden;
  background: #eef1f5;
  border-radius: 999px;
}
.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #f8b200, #ff8c00);
  border-radius: inherit;
  transition: width .18s ease;
}

.keyboard-stage {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 4px 16px;
  scrollbar-width: thin;
}
.keyboard-stage .keyboard { min-width: 0; }
.keyboard-stage::-webkit-scrollbar { height: 6px; }
.keyboard-stage::-webkit-scrollbar-thumb { background: #c7ced8; border-radius: 99px; }

.tester-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 1200px;
  margin: 14px auto 0;
}
.tool-button {
  min-width: 150px;
  border: 1px solid #d5dae2;
  background: #fff;
  color: #1e2737;
  border-radius: 10px;
  padding: 11px 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
}
.tool-button:hover { background: #f7f8fa; }
.tool-button.primary {
  border-color: #e69600;
  background: linear-gradient(90deg, #f8b200, #ff8c00);
  color: #161616;
}

.tool-button:disabled {
  opacity: .5;
  cursor: not-allowed;
  background: #eef1f5;
  color: #7a8392;
}

#startTest {
  min-width: 190px;
}

#startTest[aria-pressed="true"] {
  border-color: #138a45;
  background: linear-gradient(90deg, #1ea95a, #148944);
  color: #fff;
}

.live-panel {
  max-width: 1200px;
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 15px;
  line-height: 1.45;
}
.live-panel > div {
  min-width: 0;
  padding: 12px 14px;
  background: #fbfcfe;
  border: 1px solid var(--site-border);
  border-radius: 12px;
}
.panel-label {
  display: block;
  margin-bottom: 6px;
  color: var(--site-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
#heldKeys { overflow-wrap: anywhere; }
.key-log {
  margin: 0;
  padding-left: 20px;
  max-height: 118px;
  overflow: auto;
}
.key-log li { padding: 2px 0; }
.browser-note {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 10px 12px;
  background: #fff9ec;
  border: 1px solid #f1dfb4;
  border-radius: 10px;
  color: #66512c;
  font-size: 13px;
  line-height: 1.5;
}


@media (max-width:760px) {
  .tester-shell { width:calc(100% - 12px); padding:15px 6px 18px; border-radius:14px; }
  .tester-heading-row { padding:0 8px; display:block; }
  .privacy-note { display:inline-block; margin-top:9px; }
  .test-stats { padding:0 8px; grid-template-columns:repeat(2,1fr); }
  .progress-wrap { margin-left:8px; margin-right:8px; }
  .stat { padding:9px 10px; }
  .stat strong { font-size:18px; }
  .keyboard-stage { padding-left:0; padding-right:0; }
  .live-panel { grid-template-columns:1fr; padding:0 8px; }
  .browser-note { margin-left:8px; margin-right:8px; }
  .tool-button { min-width:130px; }
}

/* Original responsive keyboard scaling */
html { font-size:62.5%; overflow-x:hidden; }
@media (max-width:87em) { html { font-size:56.25%; } }
@media (max-width:79em) { html { font-size:50%; } }
@media (max-width:66em) { html { font-size:43.75%; } }
@media (max-width:58em) { html { font-size:37.5%; } }
@media (max-width:49em) { html { font-size:31.25%; } }
@media (max-width:40em) { html { font-size:25%; } }
@media (max-width:32em) { html { font-size:18.75%; } }
@media (max-width:24em) { html { font-size:16%; } }
.site-header,.hero,.tester-shell,.ad-slot,.content-card,.site-footer { font-size:16px; }
