/* Make everything consistent */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
  justify-content: center;
}

:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d6dae1;

  --panel-bg: linear-gradient(120deg, #ffffff, #e0e0ce);
  --tile-bg: radial-gradient(ellipse,#e0e0ce 0%, #f9ffde 100%);
  --tile-select: radial-gradient(ellipse,rgba(150, 150, 206, 1) 0%, rgba(200, 200, 222, 1) 100%);
  --tile-border: #cfd8e3;
  --tile-shadow: 2px 2px rgb(171, 172, 112);
  --tile-border-select: #7838BA;
  --tile-border-shadow: 2px 2px #5E437A ;

  --button-padding: 0.8rem;
  --target-padding: 0.4rem;
  --primary: #7838BA;          /* blue */
  --primary-hover: #5E437A;

  --secondary: #810CFA;        /* teal-green, less clashy than bright green */
  --secondary-hover: #5E437A;

  --disabled-bg: #dbd6d1;
  --disabled-text: #fbfaf9;

  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* Full screen, mobile-first layout */
html, body {
  height: 100%;
  background: var(--bg);
  display:flex;
  flex-direction: column;
  align-items: center;
}

.game-title {
  cursor: pointer;
}

h1 {
  width:100%;
  font-family: sans-serif;
  display: flex;
  justify-content: center;
}

h1 div {
  width:100%;
}

.app-title-accent {
  background: linear-gradient(90deg, #810CFA, #5E437A);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title {
  background: var(--panel);
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: 2px;
}

.section {
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 0.9rem;
}


button {
  cursor: pointer;
  flex: 1;
  color: white;
  margin: 3px;
  padding: var(--button-padding);
  border: 0;
  border-radius: var(--radius);
}

.back-btn {
  max-width:fit-content;
  background: var(--primary);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 8px;
  font-weight: bold;
}

.back-btn:hover {
  background: var(--primary-hover);
}

.control-btn {
  background: var(--primary);
}

.control-btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.free-btn {
  background: var(--secondary);
}

.free-btn:hover:not(:disabled) {
  background: var(--secondary-hover);
}

.control-btn:active {
  transform: scale(0.95);
  background: #3a78bc;
}
button:disabled {
  transform: scale(1.0);
  background-color: lightgray;
}

.start {
  justify-self: start;   /* left */
}
.middle {
  justify-self: center;   /* left */
}

.button-grid {
  display: grid;
  grid-template-columns: auto auto auto;
}

.info {
  display: flex;
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  color: slategray;
}

#target {
  margin: 3px;
  border: 1px solid slategray;
  border-radius: var(--radius);
  padding: var(--target-padding);
  color: black;
  font-weight: bold;

  background: var(--tile-bg);
  box-shadow: var(--tile-shadow);
  font-size: 1.2rem;
}

#game-container {
  flex: 1;
  overflow-y: auto;
  justify-content: center;
  display: block;
  flex-direction: column;
}

#tiles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#tiles div {
  flex-wrap: wrap;
}

.tile {
  border: 1px solid var(--tile-border);
  background: var(--tile-bg);
  margin: 2px;
  padding: 8px;
  box-shadow: var(--tile-shadow);
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease;
  font-size: 1.2rem;
}

.selected {
  padding: 7px;
  border: 2px solid var(--tile-border-select);
  box-shadow: var(--tile-border-shadow);
}

.turn {
  display: flex;
  transition: transform 0.1s ease;
}

.action {
  border-radius: var(--radius);
  user-select: none;
  align-content: space-around;
  margin: 5px 3px;
  padding: 0px 5px;
  background-color: var(--disabled-bg);
  color: var(--disabled-text);
}

.partmatch {
  font-weight: bold;
}

.match {
  color: white;
  background: var(--secondary);
  box-shadow: var(--tile-border-shadow);
}

.score {
  max-width:fit-content;
  font-size: 1.5rem;
  justify-content: center;
  align-items: center;
  display: flex;
  margin: 20px 3px;
  border: 1px solid slategray;
  padding: var(--button-padding);
  border-radius: var(--radius);
}

.score-number {
  font-size: 2rem;
  font-weight: bold;
}

.tip-btn {
  position: absolute;
  
  cursor: pointer;
  flex: 1;
  max-width: 150px;
}

#instructions {
  padding: 20px;
  position: absolute;
  top: 10%;
  bottom: 10%;
  overflow-y: auto;
  
  border: 1px solid var(--primary);
  background: var(--panel-bg);
}

.instruction {
  display: block;
  flex-direction: row;
  align-content: space-around;
  text-align: center;
  align-items: center;
}

.control-help {
  display: inline-block;
  line-height: 1;
  
  cursor: pointer;
  flex: 1;
  color: white;
  margin: 3px;
  padding: calc(var(--button-padding) - 3px);
  border: 0;
  border-radius: var(--radius);
  
  background: var(--primary);
}

.dailyMode .practice {
  display: none;
}

.practiceMode .daily {
  display: none;
}
 
.hidden { display: none; }
