@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');

* {
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Raleway", Arial, Helvetica, sans-serif;
  color-scheme: dark;
  background-color: darkgoldenrod;
  min-height: 100vh;
  margin: 0;
  padding: 2ch 0 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  user-select: none;

  .skip-link {
    position: fixed;
    left: 1rem;
    top: 1rem;
    transform: translateY(-200%);
    background: #000;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    text-decoration: none;
    font-weight: 600;
    outline: 2px solid transparent;
    outline-offset: 3px;
  }

  .skip-link:focus,
  .skip-link:focus-visible {
    transform: none;
    z-index: 10;
    outline-color: #fff;
  }

  main {
    /* width: min(90vw, 960px); */
    width: 70vw;
    height: 50vh;
    min-height: 360px;
    align-self: center;
    margin-block: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    padding: 0.75rem;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 0.75rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);

    >div:last-of-type {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
    }

    #toolbar {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      background-color: rgba(0, 0, 0, 0.65);
      padding: 0.75rem 1rem;
      border-radius: .5em;
    }

    #instructions {
      margin: 0;
      flex: 1 1 auto;
      text-align: left;
      color: aliceblue;
    }

    .btn {
      font-family: "Raleway", Arial, Helvetica, sans-serif;
      background: linear-gradient(135deg, rgba(0, 128, 0, 0.55), rgba(0, 160, 0, 0.75));
      color: aliceblue;
      font-size: large;
      border-radius: 0.5rem;
      height: 2.75em;
      padding: 0 1.75rem;
      white-space: nowrap;
      align-self: center;
      flex: 0 0 auto;
      border: 1px solid rgba(255, 255, 255, 0.35);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      position: relative;
      isolation: isolate;
      overflow: hidden;
      cursor: pointer;
      transition: transform 120ms ease, box-shadow 120ms ease, background 160ms ease !important;

      &::before {
        content: "";
        position: absolute;
        inset: 1px;
        border-radius: inherit;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.08));
        opacity: 0.75;
        pointer-events: none;
        transition: opacity 160ms ease !important;
        z-index: -1;
      }
    }

    .btn:hover {
      background: linear-gradient(135deg, rgba(0, 170, 0, 0.7), rgba(0, 200, 0, 0.85));
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);

      &::before {
        opacity: 0.95;
      }
    }

    .btn:active {
      transform: translateY(1px);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }

    #container {
      min-width: min(50ch, 100%);
      min-height: 10ch;
      flex: 1 1 auto;
      width: 100%;
      border-radius: 0.5rem;
      overflow: hidden;
      background-color: #090909;
      user-select: text;
    }

    .kbd-panel {
      background: rgba(0, 0, 0, 0.65);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 0.5rem;
      padding: 0.75rem 1rem;
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 0.25rem 0.75rem;
      color: aliceblue;
      font-family: "Segoe UI", Arial, sans-serif;
      font-size: 0.95rem;
    }

    .kbd-title {
      margin: 0;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-transform: uppercase;
      grid-column: 1 / -1;
      color: aliceblue;
    }

    .kbd-row {
      margin: 0;
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }

    kbd {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0.2rem 0.55rem;
      min-width: 2.2ch;
      border-radius: 0.35rem;
      border: 1px solid rgba(255, 255, 255, 0.35);
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.25));
      color: #fefefe;
      font-size: 0.85rem;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.35);
      text-transform: uppercase;
      letter-spacing: 0.04em;
      line-height: 1.2;
    }

  }

  footer {
    width: 100%;
    display: flex;
    justify-content: center;
    align-self: stretch;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem clamp(1rem, 2vw, 2.25rem);
    /* background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 40%, rgba(0, 0, 0, 0.35) 100%); */
    background-color: darkgoldenrod;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);

    #github a {
      color: #f7f7f7;
      background-color: rgba(0, 0, 0, 0.2);
      padding: 0.35rem 0.9rem;
      border-radius: 999px;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-decoration: none;
      position: relative;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.25);
    }
  }
}
