@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist/Geist-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist/Geist-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist/Geist-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist/Geist-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist/Geist-MediumItalic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist/Geist-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "GeistMono";
  src: url("../fonts/GeistMono/GeistMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GeistMono";
  src: url("../fonts/GeistMono/GeistMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GeistMono";
  src: url("../fonts/GeistMono/GeistMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  margin: 0;
  font-size: 1.1rem;
}

h2 {
  font-weight: 500;
  margin-bottom: 0;
}

th {
  padding: 8px;
  text-align: left;
  border: 1px solid #ddd;
}

#time {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: min(50vw, 40vh);
  text-align: center;
  margin: 0;
  font-family: "GeistMono", monospace;
  letter-spacing: -0.05em;
}

.slogan {
  font-size: min(20vw, 10vh);
  letter-spacing: -5px;
  white-space: nowrap;
}

.slogan {
  margin-bottom: 0;
}

.title h2 {
  margin-top: 0;
}

.grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.main-content,
.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  margin-bottom: 0px;
  box-sizing: border-box;
  min-height: calc(100vh - 40px);
  max-width: 800px;
}

.header {
  position: fixed;
  bottom: 0;
  left: 20px;
  max-width: 300px;
  border-bottom: 1px solid #eee;
  z-index: 1000;
  text-align: left;
}

.title h2 {
  margin-bottom: 0;
}

.title p {
  margin-top: 5px;
}

a {
  color: #333;
}

.control-link,
.display-link {
  display: inline-block;
  padding: 12px 24px;
  text-decoration: none;
  color: #333;
  background-color: #fff;
  border: 2px solid #ccc;
  border-radius: 6px;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.control-link:hover,
.display-link:hover {
  background-color: #f5f5f5;
  border-color: #999;
  transform: translateY(-1px);
}

.control-link:active,
.display-link:active {
  transform: translateY(0);
  background-color: #eee;
}

#gameIdInput {
  display: inline-block;
  padding: 12px 16px;
  margin: 8px 8px 8px 0;
  border: 2px solid #ccc;
  border-radius: 6px;
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-size: 16px;
  color: #333;
  background-color: #fff;
  transition: all 0.2s ease;
  width: 300px;
  box-sizing: border-box;
}

#gameIdInput:focus {
  outline: none;
  border-color: #999;
  background-color: #f9f9f9;
  transform: translateY(-1px);
}

#gameIdInput::placeholder {
  color: #888;
}

button {
  display: inline-block;
  padding: 12px 24px;
  margin: 0;
  background-color: #fff;
  border: 2px solid #ccc;
  border-radius: 6px;
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background-color: #f5f5f5;
  border-color: #999;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
  background-color: #eee;
}

input[type="number"] {
  display: inline-block;
  padding: 12px 16px;
  margin: 0;
  border: 2px solid #ccc;
  border-radius: 6px;
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-size: 16px;
  color: #333;
  background-color: #fff;
  transition: all 0.2s ease;
  width: 80px;
  box-sizing: border-box;
}

input[type="number"]:focus {
  outline: none;
  border-color: #999;
  background-color: #f9f9f9;
  transform: translateY(-1px);
}

.control-container {
  position: relative;
  min-height: 100vh;
  padding: 20px;
}

.control-header {
  position: absolute;
  top: 20px;
  left: 20px;
  text-align: left;
}

.control-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

.row {
  display: grid;
  gap: 16px;
  margin: 16px 0;
}

.row:first-of-type {
  grid-template-columns: auto auto;
  align-items: center;
}

.row:nth-of-type(3) {
  grid-template-columns: repeat(3, 1fr);
  width: 400px;
}

.row:nth-of-type(4) {
  grid-template-columns: repeat(3, 1fr);
  width: 400px;
}

#start {
  background-color: #fff;
  border-color: #28a745;
  color: #333;
}

#start:hover {
  background-color: #f5f5f5;
  border-color: #1e7e34;
}

#start:active {
  background-color: #eee;
}

#stop {
  background-color: #fff;
  border-color: #ffc107;
  color: #333;
}

#stop:hover {
  background-color: #f5f5f5;
  border-color: #e0a800;
}

#stop:active {
  background-color: #eee;
}

#reset {
  background-color: #fff;
  border-color: #dc3545;
  color: #333;
}

#reset:hover {
  background-color: #f5f5f5;
  border-color: #c82333;
}

#reset:active {
  background-color: #eee;
}

.control-header h1 {
  margin-bottom: 0;
  margin-top: 0;
}

.control-header h1:first-child {
  font-size: 3rem;
}

.control-header h1:last-child {
  font-size: 1.5rem;
  font-weight: 500;
  color: #666;
}

.clock-display {
  margin-bottom: 64px;
}

#clockTime {
  font-size: 15rem;
  font-weight: 500;
  text-align: center;
  margin: 0;
  letter-spacing: -0.05em;
  font-family: "GeistMono", monospace;
}

#clockTime.warn {
  color: #dc3545;
}

#time.warn {
  color: #dc3545;
}

.spacebar-hint {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: small;
  color: grey;
}

@media screen and (max-width: 600px) {
  .spacebar-hint {
    display: none;
  }
}

@media (max-width: 850px) {
  .grid-container {
    display: block;
    gap: 0;
  }

  .sidebar {
    min-height: auto;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
  }

  .header {
    position: static;
    border-bottom: none;
    padding: 0;
    width: auto;
  }

  .header h2 {
    margin-bottom: 0;
  }

  .main-content {
    min-height: auto;
    padding: 20px;
  }

  .slogan {
    font-size: min(20vw, 10vh);
    letter-spacing: -3px;
    margin: 0;
  }

  .title h2 {
    font-size: 1.5rem;
  }

  .title p {
    font-size: 1rem;
  }

  .control-container {
    padding: 10px;
  }

  .control-header {
    position: relative;
    top: auto;
    left: auto;
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
  }

  .control-header h1:first-child {
    font-size: 2rem;
    margin-bottom: 10px;
  }

  .control-header h1:last-child {
    font-size: 1.2rem;
    margin-top: 0;
  }

  .control-content {
    padding-top: 0;
    min-height: calc(100vh - 200px);
  }

  .clock-display {
    margin-bottom: 32px;
  }

  #clockTime {
    font-size: 8rem;
  }

  .row:nth-of-type(3),
  .row:nth-of-type(4) {
    width: 100%;
    max-width: 320px;
  }

  #gameIdInput {
    width: 100%;
    max-width: 320px;
    margin: 8px 0;
    display: flex;
    align-items: flex-start;
  }

  .control-link,
  .display-link {
    display: block;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-sizing: border-box;
  }

  .links {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding-bottom: 12px;
  }

  .game-input-section {
    text-align: center;
  }

  body {
    font-size: 1rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  button {
    padding: 14px 20px;
    font-size: 16px;
    min-height: 48px;
  }

  input[type="number"] {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 48px;
    width: 100px;
  }

  @media (max-width: 480px) {
    .row:nth-of-type(3),
    .row:nth-of-type(4) {
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
    }

    #clockTime {
      font-size: 6rem;
    }

    .slogan {
      font-size: min(20vw, 10vh);
      letter-spacing: -2px;
    }

    .control-header h1:first-child {
      font-size: 1.8rem;
    }

    #gameIdInput {
      max-width: 100%;
    }

    .links {
      display: flex !important;
      flex-direction: row;
      gap: 12px;
      width: 100%;
      padding-bottom: 12px;
    }
  }
}
