/* Material Design 3 Components */

/* Buttons - Rectangular with rounded corners */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--md-sys-spacing-2);
  padding: var(--md-sys-spacing-2) var(--md-sys-spacing-4);
  font-family: var(--md-sys-typescale-label-large-font-family-name);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  line-height: var(--md-sys-typescale-label-large-line-height);
  letter-spacing: var(--md-sys-typescale-label-large-letter-spacing);
  border: none;
  border-radius: var(--md-sys-shape-corner-medium);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-fast) var(--md-sys-motion-easing-standard);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-fast);
}

.btn:hover::before {
  opacity: 0.08;
}

.btn:active::before {
  opacity: 0.12;
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-level1);
}

.btn-primary:hover {
  box-shadow: var(--md-sys-elevation-level2);
}

.btn-secondary {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.btn-tertiary {
  background: transparent;
  color: var(--md-sys-color-primary);
  border: var(--border-width) solid var(--md-sys-color-outline);
}

.btn-large {
  padding: var(--md-sys-spacing-3) var(--md-sys-spacing-6);
  font-size: var(--md-sys-typescale-label-large-font-size);
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
}

.btn-icon:hover {
  background: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface);
}

/* Input Fields */
.input-field {
  width: 100%;
  padding: var(--md-sys-spacing-3) var(--md-sys-spacing-4);
  font-family: var(--md-sys-typescale-body-large-font-family-name);
  font-size: var(--md-sys-typescale-body-large-font-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-highest);
  border: var(--border-width) solid transparent;
  border-radius: var(--md-sys-shape-corner-small);
  transition: all var(--md-sys-motion-duration-fast);
  outline: none;
}

.input-field:hover {
  background: var(--md-sys-color-surface-variant);
}

.input-field:focus {
  background: var(--md-sys-color-surface);
  border-color: var(--md-sys-color-primary);
}

.input-label {
  display: flex;
  flex-direction: column;
  gap: var(--md-sys-spacing-1);
  font-size: var(--md-sys-typescale-body-small-font-size);
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--md-sys-spacing-3);
  font-size: var(--md-sys-typescale-body-medium-font-size);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--md-sys-motion-duration-fast);
  flex-shrink: 0;
}

.checkmark::after {
  content: '✓';
  font-size: 0.75rem;
  color: var(--md-sys-color-on-primary);
  opacity: 0;
  transform: scale(0);
  transition: all var(--md-sys-motion-duration-fast);
}

.checkbox-label input:checked + .checkmark {
  background: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}

.checkbox-label input:checked + .checkmark::after {
  opacity: 1;
  transform: scale(1);
}

.checkbox-label input:focus + .checkmark {
  box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);
}

/* Slider */
.slider-label {
  gap: var(--md-sys-spacing-2);
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.25rem;
  background: var(--md-sys-color-surface-variant);
  /* border-radius: var(--md-sys-shape-corner-full); */
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-full);
  cursor: pointer;
  box-shadow: var(--md-sys-elevation-level1);
  transition: all var(--md-sys-motion-duration-fast);
}

.slider::-webkit-slider-thumb:hover {
  box-shadow: var(--md-sys-elevation-level2);
  transform: scale(1.1);
}

.slider::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  background: var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-full);
  cursor: pointer;
  border: none;
  box-shadow: var(--md-sys-elevation-level1);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: var(--md-sys-spacing-6);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  padding: var(--md-sys-spacing-3) var(--md-sys-spacing-5);
  border-radius: var(--md-sys-shape-corner-small);
  box-shadow: var(--md-sys-elevation-level3);
  display: flex;
  align-items: center;
  gap: var(--md-sys-spacing-3);
  z-index: 1000;
  opacity: 0;
  transition: all var(--md-sys-motion-duration-normal) var(--md-sys-motion-easing-decelerate);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.25rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--md-sys-motion-duration-normal);
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-large);
  padding: var(--md-sys-spacing-6);
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: var(--md-sys-elevation-level4);
  transform: scale(0.9);
  transition: transform var(--md-sys-motion-duration-normal) var(--md-sys-motion-easing-emphasized-decelerate);
}

.modal.show .modal-content {
  transform: scale(1);
}

.modal-title {
  font-family: var(--md-sys-typescale-headline-small-font-family-name);
  font-size: var(--md-sys-typescale-headline-small-font-size);
  color: var(--md-sys-color-on-surface);
  margin-bottom: var(--md-sys-spacing-3);
}

.modal-message {
  font-size: var(--md-sys-typescale-body-medium-font-size);
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: var(--md-sys-spacing-5);
}

/* ==================== */
/* Tool-Specific Styles */
/* ==================== */

/* 3D Coin Flip */
.coin-container {
  perspective: 900px;
  width: 180px;
  height: 180px;
  margin: var(--md-sys-spacing-8) auto var(--md-sys-spacing-4);
  position: relative;
}

/* Ground shadow beneath the coin */
.coin-container::after {
  content: '';
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 18px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.25) 0%, transparent 70%);
  border-radius: 50%;
  transition: all 0.3s;
  pointer-events: none;
}

.coin-container.flipping::after {
  animation: coin-shadow 2.5s ease-out;
}

@keyframes coin-shadow {
  0%   { width: 120px; opacity: 1; }
  15%  { width: 60px;  opacity: 0.3; }
  50%  { width: 50px;  opacity: 0.2; }
  80%  { width: 100px; opacity: 0.8; }
  90%  { width: 130px; opacity: 1;   }
  95%  { width: 110px; opacity: 0.9; }
  100% { width: 120px; opacity: 1;   }
}

.coin-container.flipping {
  animation: coin-bounce 2.5s ease-out;
}

@keyframes coin-bounce {
  0%   { transform: translateY(0); }
  10%  { transform: translateY(-120px); }
  25%  { transform: translateY(-180px); }
  50%  { transform: translateY(-60px); }
  75%  { transform: translateY(-20px); }
  85%  { transform: translateY(8px); }
  92%  { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  cursor: pointer;
}

.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
}

/* Heads - Gold metallic */
.coin-heads {
  background: radial-gradient(circle at 38% 35%,
    #fff7cc 0%,
    #FFD700 18%,
    #e6b800 40%,
    #cc9a00 62%,
    #b8860b 80%,
    #996515 100%
  );
  border: 3px solid #b8860b;
  box-shadow:
    inset 0 0 20px rgba(255,215,0,0.5),
    inset 0 -4px 8px rgba(0,0,0,0.2),
    inset 0 4px 8px rgba(255,255,255,0.35),
    0 2px 6px rgba(0,0,0,0.3),
    0 0 0 3px #a07700,
    0 0 0 5px #8b6914,
    0 0 0 6px rgba(0,0,0,0.15);
  transform: rotateY(0deg);
}

/* Tails - Silver metallic */
.coin-tails {
  background: radial-gradient(circle at 38% 35%,
    #f0f0f0 0%,
    #d8d8d8 18%,
    #c0c0c0 40%,
    #a8a8a8 62%,
    #909090 80%,
    #787878 100%
  );
  border: 3px solid #909090;
  box-shadow:
    inset 0 0 20px rgba(255,255,255,0.4),
    inset 0 -4px 8px rgba(0,0,0,0.2),
    inset 0 4px 8px rgba(255,255,255,0.45),
    0 2px 6px rgba(0,0,0,0.3),
    0 0 0 3px #808080,
    0 0 0 5px #6a6a6a,
    0 0 0 6px rgba(0,0,0,0.15);
  transform: rotateY(180deg);
}

/* Embossed text */
.coin-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  user-select: none;
}

.coin-heads .coin-text {
  color: #8b6914;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.4),
    0 -1px 0 rgba(0,0,0,0.2);
}

.coin-tails .coin-text {
  color: #555;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.5),
    0 -1px 0 rgba(0,0,0,0.15);
}

/* Coin edge ring (inner detail) */
.coin-heads::before,
.coin-tails::before {
  content: '';
  position: absolute;
  width: 88%;
  height: 88%;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: inset 0 0 6px rgba(0,0,0,0.1);
  pointer-events: none;
}

.coin-result {
  font-size: var(--md-sys-typescale-headline-small-font-size);
  font-weight: 700;
  color: var(--md-sys-color-primary);
  text-align: center;
  min-height: 2rem;
  margin-top: var(--md-sys-spacing-4);
  letter-spacing: 1px;
}


/* 3D Dice Roller */
.dice-controls {
  display: flex;
  gap: var(--md-sys-spacing-4);
  width: 100%;
  margin-bottom: var(--md-sys-spacing-6);
  justify-content: center;
}

.dice-controls .input-label {
  flex: 1;
  max-width: 150px;
}

.dice-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 48px;
  min-height: 120px;
  perspective: 2000px;
  padding: var(--md-sys-spacing-6) var(--md-sys-spacing-8);
}

.dice {
  width: 76px;
  height: 76px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-15deg) rotateY(25deg);
}

.dice-face {
  position: absolute;
  width: 76px;
  height: 76px;
  background: linear-gradient(145deg, #faf8f0, #e8e4d8);
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 10px;
  backface-visibility: hidden;
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.6),
    inset 0 -1px 2px rgba(0,0,0,0.08);
}

/* Dice dot positioning */
.dice-face[data-face="1"] .dice-dot:nth-child(1) { grid-area: 2 / 2; }

.dice-face[data-face="2"] .dice-dot:nth-child(1) { grid-area: 1 / 3; }
.dice-face[data-face="2"] .dice-dot:nth-child(2) { grid-area: 3 / 1; }

.dice-face[data-face="3"] .dice-dot:nth-child(1) { grid-area: 1 / 3; }
.dice-face[data-face="3"] .dice-dot:nth-child(2) { grid-area: 2 / 2; }
.dice-face[data-face="3"] .dice-dot:nth-child(3) { grid-area: 3 / 1; }

.dice-face[data-face="4"] .dice-dot:nth-child(1) { grid-area: 1 / 1; }
.dice-face[data-face="4"] .dice-dot:nth-child(2) { grid-area: 1 / 3; }
.dice-face[data-face="4"] .dice-dot:nth-child(3) { grid-area: 3 / 1; }
.dice-face[data-face="4"] .dice-dot:nth-child(4) { grid-area: 3 / 3; }

.dice-face[data-face="5"] .dice-dot:nth-child(1) { grid-area: 1 / 1; }
.dice-face[data-face="5"] .dice-dot:nth-child(2) { grid-area: 1 / 3; }
.dice-face[data-face="5"] .dice-dot:nth-child(3) { grid-area: 2 / 2; }
.dice-face[data-face="5"] .dice-dot:nth-child(4) { grid-area: 3 / 1; }
.dice-face[data-face="5"] .dice-dot:nth-child(5) { grid-area: 3 / 3; }

.dice-face[data-face="6"] .dice-dot:nth-child(1) { grid-area: 1 / 1; }
.dice-face[data-face="6"] .dice-dot:nth-child(2) { grid-area: 1 / 3; }
.dice-face[data-face="6"] .dice-dot:nth-child(3) { grid-area: 2 / 1; }
.dice-face[data-face="6"] .dice-dot:nth-child(4) { grid-area: 2 / 3; }
.dice-face[data-face="6"] .dice-dot:nth-child(5) { grid-area: 3 / 1; }
.dice-face[data-face="6"] .dice-dot:nth-child(6) { grid-area: 3 / 3; }

.dice-dot {
  width: 13px;
  height: 13px;
  background: radial-gradient(circle at 40% 35%, #444, #111);
  border-radius: 50%;
  align-self: center;
  justify-self: center;
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.5),
    0 1px 1px rgba(255,255,255,0.3);
}

/* 3D Dice face transforms */
.dice-face[data-face="1"] { transform: translateZ(38px); }
.dice-face[data-face="6"] { transform: rotateY(180deg) translateZ(38px); }
.dice-face[data-face="2"] { transform: rotateY(-90deg) translateZ(38px); }
.dice-face[data-face="5"] { transform: rotateY(90deg) translateZ(38px); }
.dice-face[data-face="3"] { transform: rotateX(90deg) translateZ(38px); }
.dice-face[data-face="4"] { transform: rotateX(-90deg) translateZ(38px); }

.dice-total {
  font-size: var(--md-sys-typescale-headline-small-font-size);
  font-weight: 700;
  color: var(--md-sys-color-primary);
  text-align: center;
  min-height: 2.5rem;
  margin-top: var(--md-sys-spacing-4);
}

/* Random Number Generator */
.number-inputs {
  display: flex;
  gap: var(--md-sys-spacing-4);
  width: 100%;
  justify-content: center;
}

.number-inputs .input-label {
  flex: 1;
  max-width: 150px;
}

.number-display {
  font-size: 5rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  font-family: 'Roboto Mono', monospace;
  min-height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.number-history {
  display: flex;
  gap: var(--md-sys-spacing-2);
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}

.history-number {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--md-sys-color-surface-variant);
  border-radius: var(--md-sys-shape-corner-small);
  font-size: var(--md-sys-typescale-body-small-font-size);
  font-family: 'Roboto Mono', monospace;
}

/* Password Generator */
.password-display-container {
  display: flex;
  gap: var(--md-sys-spacing-2);
  width: 100%;
  align-items: stretch;
}

.password-display {
  flex: 1;
  padding: var(--md-sys-spacing-3) var(--md-sys-spacing-4);
  background: var(--md-sys-color-surface-container-highest);
  border-radius: var(--md-sys-shape-corner-small);
  font-family: 'Roboto Mono', monospace;
  font-size: var(--md-sys-typescale-body-large-font-size);
  word-break: break-all;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
}

.password-strength {
  width: 100%;
  height: 8px;
  background: var(--md-sys-color-surface-variant);
  border-radius: var(--md-sys-shape-corner-small);
  overflow: hidden;
  margin: var(--md-sys-spacing-3) 0;
}

.password-strength-bar {
  height: 100%;
  border-radius: var(--md-sys-shape-corner-small);
  transition: width var(--md-sys-motion-duration-normal), background-color var(--md-sys-motion-duration-normal);
}

.password-strength-bar.weak { background: var(--md-sys-color-error); }
.password-strength-bar.fair { background: #FFA726; }
.password-strength-bar.good { background: #66BB6A; }
.password-strength-bar.strong { background: var(--md-sys-color-primary); }

.password-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--md-sys-spacing-4);
  width: 100%;
  margin: var(--md-sys-spacing-4) 0;
}

/* Spin Wheel */
.wheel-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto var(--md-sys-spacing-4);
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: var(--md-sys-shape-corner-full);
}

.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 24px solid var(--md-sys-color-primary);
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.wheel-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: 4px solid var(--md-sys-color-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--md-sys-elevation-level2);
  transition: all var(--md-sys-motion-duration-fast);
  z-index: 5;
}

.wheel-center-btn:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: var(--md-sys-elevation-level3);
}

.wheel-center-btn:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.wheel-center-btn .material-symbols-rounded {
  font-size: 1.75rem;
}

.wheel-result {
  font-size: var(--md-sys-typescale-title-large-font-size);
  font-weight: 600;
  color: var(--md-sys-color-primary);
  min-height: 2rem;
  text-align: center;
  margin-bottom: var(--md-sys-spacing-4);
}

.wheel-options {
  width: 100%;
}

.wheel-options .input-label {
  text-align: center;
  align-items: center;
}

.wheel-options textarea {
  display: block;
  margin: 0 auto;
  resize: vertical;
  min-height: 200px;
  max-width: 600px;
  font-size: var(--md-sys-typescale-body-medium-font-size);
}

.wheel-result-actions {
  display: flex;
  gap: var(--md-sys-spacing-2);
  justify-content: center;
  margin-top: var(--md-sys-spacing-3);
}

/* Lotto Generator */
.lotto-balls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--md-sys-spacing-3);
  margin-bottom: var(--md-sys-spacing-4);
}

.lotto-ball {
  width: 55px;
  height: 55px;
  border-radius: var(--md-sys-shape-corner-full);
  background: linear-gradient(145deg, var(--md-sys-color-primary-container), var(--md-sys-color-primary));
  color: var(--md-sys-color-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--md-sys-typescale-title-large-font-size);
  font-family: 'Roboto Mono', monospace;
  box-shadow: var(--md-sys-elevation-level1);
  animation: ball-appear 0.3s ease-out;
}

.lotto-ball.bonus {
  background: linear-gradient(145deg, var(--md-sys-color-tertiary-container), var(--md-sys-color-tertiary));
  color: var(--md-sys-color-on-tertiary);
}

@keyframes ball-appear {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.lotto-options {
  width: 100%;
  max-width: 250px;
  margin-bottom: var(--md-sys-spacing-4);
}

/* Yes/No Generator */
.yesno-display {
  width: 180px;
  height: 180px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--md-sys-motion-duration-normal);
  margin-bottom: var(--md-sys-spacing-4);
}

.yesno-display.yes {
  background: linear-gradient(145deg, #4CAF50, #2E7D32);
}

.yesno-display.no {
  background: linear-gradient(145deg, #EF5350, #C62828);
}

.yesno-text {
  font-size: 3rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  transition: color var(--md-sys-motion-duration-normal);
}

.yesno-display.yes .yesno-text,
.yesno-display.no .yesno-text {
  color: white;
}

/* Name Generator */
.name-display {
  font-size: var(--md-sys-typescale-headline-medium-font-size);
  font-weight: 600;
  color: var(--md-sys-color-primary);
  text-align: center;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--md-sys-spacing-4);
}

.name-options {
  display: flex;
  gap: var(--md-sys-spacing-4);
  width: 100%;
  justify-content: center;
  margin-bottom: var(--md-sys-spacing-4);
}

.name-options .input-label {
  flex: 1;
  max-width: 150px;
}

/* Letter Generator */
.letter-display {
  font-size: 4rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  font-family: 'Roboto Mono', monospace;
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--md-sys-spacing-3);
  flex-wrap: wrap;
  margin-bottom: var(--md-sys-spacing-4);
}

.letter-options {
  display: flex;
  flex-direction: column;
  gap: var(--md-sys-spacing-4);
  width: 100%;
  max-width: 300px;
  margin-bottom: var(--md-sys-spacing-4);
}

/* Country Generator */
.country-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--md-sys-spacing-6);
  text-align: center;
  margin-bottom: var(--md-sys-spacing-4);
}

.country-flag {
  font-size: 5rem;
}

.country-name {
  font-size: var(--md-sys-typescale-headline-small-font-size);
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.country-name a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
}

.country-name a:hover {
  text-decoration: underline;
}

.country-info {
  font-size: var(--md-sys-typescale-body-medium-font-size);
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
  margin-bottom: var(--md-sys-spacing-4);
}

/* Timer & Stopwatch */
.timer-tabs {
  display: flex;
  gap: var(--md-sys-spacing-1);
  background: var(--md-sys-color-surface-container-highest);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: var(--md-sys-spacing-1);
  margin-bottom: var(--md-sys-spacing-6);
  width: 100%;
  max-width: 350px;
}

.timer-tab {
  flex: 1;
  padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: 500;
  border-radius: var(--md-sys-shape-corner-small);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-fast);
}

.timer-tab:hover {
  color: var(--md-sys-color-on-surface);
}

.timer-tab.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.timer-panel {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: var(--md-sys-spacing-5);
}

.timer-panel.active {
  display: flex;
}

.timer-display {
  font-size: 3.5rem;
  font-weight: 300;
  color: var(--md-sys-color-on-surface);
  font-family: 'Roboto Mono', monospace;
  letter-spacing: 0.05em;
  text-align: center;
}

.timer-controls {
  display: flex;
  gap: var(--md-sys-spacing-2);
  flex-wrap: wrap;
  justify-content: center;
}

.timer-inputs {
  display: flex;
  gap: var(--md-sys-spacing-3);
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.timer-inputs .input-label {
  width: 80px;
}

.laps-list {
  width: 100%;
  max-width: 300px;
  max-height: 150px;
  overflow-y: auto;
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-small);
  padding: var(--md-sys-spacing-2);
  margin-top: var(--md-sys-spacing-3);
}

.lap-item {
  display: flex;
  justify-content: space-between;
  padding: var(--md-sys-spacing-2);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  font-family: 'Roboto Mono', monospace;
  font-size: var(--md-sys-typescale-body-medium-font-size);
}

.lap-item:last-child {
  border-bottom: none;
}

.alarm-inputs {
  width: 100%;
  max-width: 200px;
}

.alarm-status {
  font-size: var(--md-sys-typescale-body-medium-font-size);
  color: var(--md-sys-color-on-surface-variant);
  padding: var(--md-sys-spacing-2) var(--md-sys-spacing-4);
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-small);
  margin-bottom: var(--md-sys-spacing-3);
}

.alarm-status.active {
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
}

/* Name Draw Tool */
.name-draw-container {
  width: 100%;
  max-width: 500px;
}

.name-draw-textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  margin-bottom: var(--md-sys-spacing-4);
}

.name-draw-options {
  display: flex;
  gap: var(--md-sys-spacing-4);
  align-items: center;
  justify-content: center;
  margin-bottom: var(--md-sys-spacing-4);
  flex-wrap: wrap;
}

.name-draw-options .input-label {
  width: 120px;
}

.winners-display {
  margin-top: var(--md-sys-spacing-4);
  width: 100%;
}

.winner-item {
  display: flex;
  align-items: center;
  gap: var(--md-sys-spacing-3);
  padding: var(--md-sys-spacing-3);
  background: var(--md-sys-color-primary-container);
  border-radius: var(--md-sys-shape-corner-medium);
  margin-bottom: var(--md-sys-spacing-2);
  font-size: var(--md-sys-typescale-body-large-font-size);
}

.winner-rank {
  width: 32px;
  height: 32px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-radius: var(--md-sys-shape-corner-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* World Clocks */
.clocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--md-sys-spacing-4);
  width: 100%;
}

.clock-card {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-large);
  padding: var(--md-sys-spacing-4);
  text-align: center;
}

.clock-city {
  font-size: var(--md-sys-typescale-title-medium-font-size);
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-bottom: var(--md-sys-spacing-1);
}

.clock-country {
  font-size: var(--md-sys-typescale-body-small-font-size);
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: var(--md-sys-spacing-3);
}

.clock-time {
  font-size: 2.5rem;
  font-weight: 300;
  font-family: 'Roboto Mono', monospace;
  color: var(--md-sys-color-primary);
}

.clock-date {
  font-size: var(--md-sys-typescale-body-small-font-size);
  color: var(--md-sys-color-on-surface-variant);
  margin-top: var(--md-sys-spacing-1);
}

.add-clock-section {
  margin-top: var(--md-sys-spacing-6);
  width: 100%;
  max-width: 300px;
}

/* Random Colors */
.colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--md-sys-spacing-4);
  width: 100%;
}

.color-card {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-large);
  overflow: hidden;
  box-shadow: var(--md-sys-elevation-level1);
}

.color-preview {
  width: 100%;
  height: 120px;
}

.color-info {
  padding: var(--md-sys-spacing-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--md-sys-spacing-2);
}

.color-code {
  font-family: 'Roboto Mono', monospace;
  font-size: var(--md-sys-typescale-body-medium-font-size);
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.color-copy-btn {
  background: transparent;
  border: none;
  color: var(--md-sys-color-primary);
  cursor: pointer;
  padding: var(--md-sys-spacing-1);
  border-radius: var(--md-sys-shape-corner-small);
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-copy-btn:hover {
  background: var(--md-sys-color-surface-variant);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .dice-container {
    gap: var(--md-sys-spacing-4);
  }
  
  .dice {
    width: 55px;
    height: 55px;
  }
  
  .dice-face {
    width: 55px;
    height: 55px;
  }
  
  .dice-dot {
    width: 10px;
    height: 10px;
  }
  
  .timer-display {
    font-size: 2.5rem;
  }
  
  .timer-inputs .input-label {
    width: 70px;
  }
  
  .number-display {
    font-size: 3.5rem;
  }
  
  .lotto-ball {
    width: 45px;
    height: 45px;
    font-size: var(--md-sys-typescale-title-medium-font-size);
  }
  
  .wheel-container {
    width: 240px;
    height: 240px;
  }
  
  .clocks-grid {
    grid-template-columns: 1fr;
  }
  
  .clock-time {
    font-size: 2rem;
  }
}

/* Cookie Notice */
.cookie-notice {
  position: fixed;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--md-sys-spacing-6));
  max-width: 800px;
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border-radius: 16px;
  padding: var(--md-sys-spacing-4) var(--md-sys-spacing-5);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: var(--md-sys-spacing-4);
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.cookie-notice.show {
  bottom: var(--md-sys-spacing-5);
  opacity: 1;
}

@media (min-width: 768px) {
  .cookie-notice {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cookie-content {
  display: flex;
  gap: var(--md-sys-spacing-4);
  align-items: center;
}

.cookie-icon {
  font-size: 32px;
  color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-surface-container);
  padding: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cookie-text h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--md-sys-spacing-1);
  color: var(--md-sys-color-on-surface);
}

.cookie-text p {
  font-size: 0.9rem;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.4;
  margin: 0;
}

.cookie-link {
  color: var(--md-sys-color-primary);
  font-weight: 500;
  text-decoration: underline;
}

.cookie-link:hover {
  text-decoration: none;
}

.cookie-actions {
  display: flex;
  gap: var(--md-sys-spacing-2);
  flex-shrink: 0;
  justify-content: flex-end;
}

@media (max-width: 767px) {
  .cookie-actions {
    width: 100%;
    justify-content: stretch;
  }
  .cookie-actions .btn {
    flex: 1;
  }
}
