.column1,
.square {
  float: left;
}
.column1,
.column2 {
  background-color: #f3efeb;
}

@font-face {
  font-family: Eliot Lord;
  src: url(Fonts/Eliothand2-Regular.otf);
}

@font-face {
  font-family: TimeyMcTimeFace;
  src: url(Fonts/Eliotheadline-Regular.otf);
}

.clues {
  font-family: TimeyMcTimeFace;
}

h1 {
  font-family: TimeyMcTimeFace;
}

h2 {
  font-family: TimeyMcTimeFace;
}

#timer {
  text-align: center;
  font-family: TimeyMcTimeFace;
  font-size: 4vh;
  margin: 2vh auto;
  font-weight: bold;
  color: #333;
}

/* Completion overlay styles */
#completion-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.completion-message {
  background-color: #fff;
  padding: 4vh 6vh;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
  }
  to {
    transform: scale(1);
  }
}

.completion-message h1 {
  font-size: 5vh;
  margin-bottom: 2vh;
  color: #4a7729;
}

.completion-message p {
  font-size: 3vh;
  margin: 1vh 0;
  color: #333;
}

.completion-time {
  font-weight: bold;
  font-size: 4vh !important;
  color: #b50938;
  margin: 2vh 0 !important;
}

.completion-message button {
  margin-top: 3vh;
  padding: 1.5vh 4vh;
  font-size: 2.5vh;
  font-family: TimeyMcTimeFace;
  background-color: #4a7729;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.completion-message button:hover {
  background-color: #3a5f21;
}

.column2 {
  padding-left: 1%;
  float: right;
}

body::-webkit-scrollbar {
  width: 1em round;
  overflow: scroll;
}
body::-webkit-scrollbar-track {
  box-shadow: inset 0 0 6px #000;
}
body::-webkit-scrollbar-thumb {
  background-color: #000;
  outline: #000000 solid 1px;
  border-radius: 10px;
}
body::-webkit-scrollbar-thumb:hover {
  cursor: url("img/background/Pointer.svg"), pointer;
}

/* Add cursor to all interactive elements */
input.squareinput {
  cursor: url("img/background/Pointer.svg"), text;
}

input.squareinput:focus {
  outline: 2px solid #4a7729;
  cursor: url("img/background/Pointer.svg"), text;
}
h1 {
  font-size: 3dvh;
}
h2 {
  font-size: 3dvh;
}

.titletext1 a {
  color: #fff;
}

.square {
  float: left;
}
.square,
.squareempty {
  border: 1px solid #000;
  box-sizing: border-box;
}
.square {
  width: 25px;
  height: 25px;
  margin: 0;
  padding: 0;
  position: relative;
}
.num,
.number,
.smallnum {
  position: absolute;
}
.smallnum {
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  font-size: 15px;
}
.square input,
.squareempty {
  float: left;
  padding: 0;
  margin: 0;
}

.number {
  top: 5px;
  left: 5px;
  font-size: 14px;
  color: #333;
}

.squareempty {
  background-color: #000;
}
.squareempty {
  width: 25px;
  height: 25px;
}

/* Make puzzle container responsive and fit viewport */
#puzzlecontainer {
  width: 100%;
  max-width: 100%;
  height: auto !important;
  margin: 2vh auto;
  padding-bottom: 2vh;
  overflow: visible;
  display: block;
}

#puzzlecontainer::after {
  content: "";
  display: table;
  clear: both;
}

/* Desktop sizing - keep original working design */
@media (min-width: 769px) {
  #puzzlecontainer {
    max-width: min(90vmin, 95vw);
    width: fit-content;
    margin: 2vh auto;
  }

  .square,
  .squareempty {
    width: calc(min(90vmin, 95vw) / 20);
    height: calc(min(90vmin, 95vw) / 20);
  }

  .square input {
    font-size: calc(min(90vmin, 95vw) / 40);
  }

  .smallnum {
    font-size: calc(min(90vmin, 95vw) / 60);
  }
}

.square input {
  width: 100%;
  height: 100%;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
  font-family: Eliot Lord;
  border: 0 round;
  vertical-align: text-top;
  box-sizing: border-box;
}

/* Mobile-specific adjustments - NYT style */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  #puzzlecontainer {
    padding: 0;
    margin: 1vh auto 2vh auto;
    width: 100vw;
    max-width: 100vw;
  }

  /* Scale squares to fit exactly 20 columns across the screen */
  /* 100vw / 20 columns = 5vw per square */
  .square,
  .squareempty {
    width: 5vw;
    height: 5vw;
    border-width: 0.5px;
  }

  .square input {
    font-size: 16px; /* Minimum 16px to prevent iOS zoom */
    padding: 0;
    font-weight: bold;
  }

  .smallnum {
    font-size: 2vw;
    top: 0.5px;
    left: 0.5px;
  }

  #timer {
    font-size: 6vw;
    margin: 2vh auto;
  }

  .wordtitle {
    font-size: 6vw;
    margin: 2vh auto;
  }

  table {
    font-size: 3vw;
    width: 100%;
  }

  table h1 {
    font-size: 4vw;
  }

  table h2 {
    font-size: 3vw;
  }

  table td {
    padding: 1vh;
  }

  .completion-message {
    padding: 3vh 4vh;
    width: 90%;
    max-width: 400px;
  }

  .completion-message h1 {
    font-size: 6vw;
  }

  .completion-message p {
    font-size: 4vw;
  }

  .completion-time {
    font-size: 5vw !important;
  }

  .completion-message button {
    font-size: 4vw;
    padding: 2vh 5vh;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .square,
  .squareempty {
    width: 5vw;
    height: 5vw;
  }

  .square input {
    font-size: 2.8vw;
  }

  .smallnum {
    font-size: 2vw;
  }

  table {
    font-size: 2.8vw;
  }

  table h1 {
    font-size: 3.5vw;
  }

  table h2 {
    font-size: 2.8vw;
  }
}

.num {
  top: 100%;
}
#Down {
  display: inline-block;
  top: 0;
}

/* Make clue tables responsive and compact */
table {
  border: 1px solid #333;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 1.5vh;
}
table td {
  border: 1px solid #333;
  width: 33.33%;
  padding: 1vh;
  vertical-align: top;
}
table h1 {
  border-bottom: 1px solid #333;
  padding-bottom: 0.5vh;
  margin-bottom: 0.5vh;
  font-size: 2vh;
}
table h2 {
  font-size: 1.5vh;
}

/* Keep the main "Across" and "Down" titles at normal size */
.wordtitle {
  font-size: 3dvh;
  margin: 2vh auto;
}

/* Reduce spacing around clue sections */
.Clues {
  width: 90%;
  margin: 2vh auto;
}

/* Mobile clue display - NYT style */
@media (max-width: 768px) {
  /* Hide all the table-based clues on mobile */
  table {
    display: none !important;
  }
  
  .wordtitle {
    display: none !important;
  }
  
  /* Container for keyboard and clue - fixed at bottom, always visible */
  #mobile-interface-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: transparent;
    display: flex !important;
    flex-direction: column;
    visibility: visible !important;
  }
  
  /* Clue display bar - NYT light blue style with navigation arrows */
  #mobile-clue-display {
    background: #8fc2e8;
    border: none;
    padding: 18px 50px;
    min-height: 60px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    position: relative;
  }
  
  /* Navigation arrows for clues */
  .clue-nav-arrow {
    position: absolute;
    background: none;
    border: none;
    font-size: 32px;
    color: #000;
    cursor: pointer;
    padding: 10px 15px;
    -webkit-tap-highlight-color: transparent;
    font-weight: 300;
  }
  
  .clue-nav-arrow.left {
    left: 10px;
  }
  
  .clue-nav-arrow.right {
    right: 10px;
  }
  
  .clue-nav-arrow:active {
    opacity: 0.5;
  }
  
  /* Clue text centered */
  .clue-content {
    text-align: center;
    max-width: calc(100% - 100px);
  }
  
  .clue-text {
    font-size: 20px;
    color: #000;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
  }
  
  /* Mobile keyboard - NYT gray style */
  #mobile-keyboard {
    background: #d3d6da;
    padding: 8px 4px 12px 4px;
    display: block !important;
    visibility: visible !important;
  }
  
  .keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
  }
  
  .keyboard-row:last-child {
    margin-bottom: 0;
  }
  
  .keyboard-key {
    background: #fff;
    border: none;
    border-radius: 4px;
    padding: 20px 0;
    font-size: 20px;
    font-weight: 700;
    min-width: 8vw;
    flex: 1;
    max-width: 43px;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    transition: all 0.1s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
    color: #000;
    text-transform: uppercase;
  }
  
  .keyboard-key:active {
    transform: scale(0.95);
    background: #d8d8d8;
    box-shadow: 0 0 0 rgba(0,0,0,0.2);
  }
  
  .keyboard-key.wide {
    flex: 1.5;
    max-width: 65px;
    font-size: 16px;
    font-weight: 600;
  }
  
  .keyboard-key.more {
    background: #a4adb4;
    color: #000;
  }
  
  .keyboard-key.more:active {
    background: #8a9298;
  }
  
  .keyboard-key.backspace {
    background: #a4adb4;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .keyboard-key.backspace:active {
    background: #8a9298;
  }
  
  /* Adjust puzzle container to account for fixed keyboard and clue bar */
  #puzzlecontainer {
    margin-bottom: 280px !important;
    padding-bottom: 20px;
  }
  
  /* Prevent native keyboard and improve focus styling */
  .squareinput {
    caret-color: transparent;
    font-size: 16px !important; /* Force 16px minimum to prevent iOS zoom */
    touch-action: manipulation; /* Prevent double-tap zoom */
  }
  
  .squareinput:focus {
    outline: 3px solid #5599ff;
    outline-offset: -3px;
  }
  
  /* Prevent text selection on mobile */
  .squareinput {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
}

/* Make clickable buttons have pointer cursor */
.menu-login-btn,
.menu-subscribe-btn,
.utility-btn,
.subscribe-btn {
  cursor: pointer;
}

/* Override about_me.css button font-size for utility and nav buttons */
.utility-btn,
.subscribe-btn,
.edition-btn,
.nav-utility-left button,
.nav-utility-right button {
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 10px 20px !important;
  border-radius: 3px !important;
  transition: all 0.2s ease !important;
}

/* Menu buttons specific styling */
.menu-login-btn,
.menu-subscribe-btn {
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 12px 24px !important;
  border-radius: 3px !important;
  transition: all 0.2s ease !important;
}

/* Clock Off / Log in style - black background with white text, no border */
.utility-btn,
.menu-login-btn {
  background-color: #000 !important;
  color: #fff !important;
  border: none !important;
}

.utility-btn:hover,
.menu-login-btn:hover {
  background-color: #1a1a1a !important;
}

/* Subpar / Start trial style - solid blue background */
.subscribe-btn,
.menu-subscribe-btn {
  background-color: #0077b6 !important;
  color: #fff !important;
  border: none !important;
}

.subscribe-btn:hover,
.menu-subscribe-btn:hover {
  background-color: #005f94 !important;
}
