/* Reset default margins */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* Background and font setup */
body {
  background-color: tan;
  text-align: center;
  font-family: Andale Mono, monospace;
  font-size: 20px;
  color: #222;
  /* display: flex; */
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.page-header {
  margin-top: 50px;
  margin-bottom: 50px;

  font-size: 76px;
  font-weight: bold;

  /* ✅ Pixelated retro font (optional if you have one imported) */
  font-family: "Press Start 2P", monospace;

  /* ✅ Hard-edged drop shadow for 8-bit style */
  text-shadow: 4px 4px 0px #834f25;

  /* ✅ Make the text crisp (more pixel look) */
  image-rendering: pixelated;

  /* ✅ Optional retro color */
  color: #c78523; /* bright arcade gold */
}


.key-controls {
  text-align: left;              /* text lines up on the left inside the box */
  /* font-family: Arial, sans-serif; */
  margin: 0 auto;                /* centers the whole box horizontally */
  /* margin-top: 10px; */
  margin-bottom: 40px;
  font-size: 20px;
  font-weight: normal;
  color: #585858;
  max-width: 600px;              /* limit width so it doesn’t stretch full screen */
}

.key-controls b {
  color: #333333;       /* darker text */
  font-weight: 700;  /* strong bold */
}

.small-break {
  margin-bottom: -50px;
}

.flagButton {
  margin-bottom: 0px;
}

/* Two-column layout */
.main-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px; /* space between controls and canvas */
}

/* Left-side control panel */
.controls {
  display: flex;
  flex-direction: column;
  gap: 20px; /* space between buttons and inputs */
}

.head-and-text {
  display: flex;
  flex-direction: row;
  gap: 20px;
}

/* Buttons */
button {
  font-family: Andale Mono, monospace;
  padding: 12px 18px;
  font-size: 18px;
  cursor: pointer;
  background-color: #d4a373;
  border: none;
  border-radius: 8px;
  transition: background-color 0.2s;
}


button:hover {
  background-color: #b5835a;
}

/* Inputs and labels */
label {
  font-family: Andale Mono, monospace;
  font-weight: bold;
}

input[type="text"],
input[type="file"] {
  font-family: Andale Mono, monospace;
  font-size: 18px;
  padding: 8px;
  border: 2px solid #b5835a;
  border-radius: 6px;
}

/* Canvas */
canvas {
  background: #dadada;
  display: block;
  border: 4px solid #b5835a;
  border-radius: 10px;
  margin-bottom: 140px;
}


.autocomplete-container {
  position: relative;
  display: inline-block;
}
.suggestion-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 150px;
  overflow-y: auto;
  z-index: 100;
}
.suggestion-box li {
  padding: 5px 10px;
  cursor: pointer;
}
.suggestion-box li:hover,
.suggestion-box li.selected {
  background-color: #eee;
}

#inputGuess:focus {
    background-color: yellow;
    outline: none; /* optional: removes the default blue outline */
}




/* flash code */
.wrapped-text {
  width: 390px;       /* each line will wrap when it hits 40px */
  word-wrap: break-word;
  text-align: left; 
  overflow-wrap: break-word;
  color: #585858;
  margin-left: 30px;
  margin-bottom: 70px;
}

/* Green flash */
.correct-flash {
  animation: flashGreen 0.8s ease;
}

@keyframes flashGreen {
  0%   { color: #00be10; }
  100% { color: rgb(0, 0, 0); }
}

/* Red flash */
.incorrect-flash {
  animation: flashRed 0.8s ease;
}

@keyframes flashRed {
  0%   { color: #ff0000; }
  100% { color: rgb(0, 0, 0); }
}

/* Container matches width of the main flag button */
/* ------------------------------------ */
.difficultyContainer {
  display: flex;
  justify-content: center;     /* center the whole group */
  width: 100%;
  max-width: 300px;            /* same width as your flag button */
  margin: 0 auto 40px auto;    /* centers container on page */
  gap: 40px;  
  margin-bottom: 40px;
}

.difficulty-btn {
  flex: 1;                     /* equal width */
  padding: 10px;
  border: 1px solid #bb9065;
  background-color: #d4a373;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
  margin-right: 0;
  text-align: center;
  align-items: center;
}

.difficulty-btn:not(:last-child) {
  border-right: none;          /* seamless combined look */
}

.difficulty-btn:hover {
  background-color: #b5835a;
}

/* Selected state */
.difficulty-btn.active {
  background-color: #357537;
  color: white;
  font-weight: bold;
}

/* ===== Tooltip Styling ===== */
.difficulty-btn {
  position: relative; /* needed so tooltip is anchored to button */
}

/* hidden by default */
.difficulty-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: -40px;                  /* position above button */
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;        /* no interference with mouse */
  transition: opacity 0.2s ease;
  z-index: 100;
  
  /* Pixel-ish shadow for retro vibe */
  box-shadow: 3px 3px 0 #000;
}

/* little pointer arrow */
.difficulty-btn::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* show tooltip on hover */
.difficulty-btn:hover::after,
.difficulty-btn:hover::before {
  opacity: 1;
}

/* -------------------- */

/* TABLE */
.score-table {
    width: 100%;
    max-width: 450px;
    border-collapse: collapse;
    margin: 20px auto;
    font-family: Andale Mono, monospace;;
    font-size: 16px;
    color: #333;
    border-radius: 8px;
    overflow: hidden; /* allows rounded corners */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Header row */
.score-table th {
    background-color: #b5835a;     /* your darker color */
    color: black;
    padding: 10px 12px;
    font-weight: bold;
    text-align: left;
}

/* Body rows */
.score-table td {
    padding: 10px 12px;
    text-align: left;
}

/* Alternating row colors using your palette */
.score-table tr:nth-child(odd) td {
    background-color: #d4a373;
}

.score-table tr:nth-child(even) td {
    background-color: #d4a37322;   /* soft tint of your lighter color */
}

/* Optional: highlight on hover */
.score-table tbody tr:hover td {
    background-color: #d6c4b355;   /* subtle darker tint */
    cursor: pointer;
}
