* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #f0f4f8;
  font-family: "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.toolbar {
  height: 60px;
  background: linear-gradient(to right, #1168c2, #0d5aa6, #1168c2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  flex-shrink: 0;
  z-index: 100;
}

.toolbar-left {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.toolbar-right {
  display: flex;
  align-items: center;
}

.toolbar img {
  height: 40px;
  width: 40px;
  margin-right: 12px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.title {
  font-size: 1.4em;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

.icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.icon-circle img {
  width: 16px;
  height: 16px;
  margin: 0;
}

.icon-circle:hover {
  background: #e3f0ff;
  transform: scale(1.1);
}

#newsIcon {
  font-size: 16px;
}

.centered {
  flex: 1;
  display: flex;
  position: relative;
  padding: 20px;
}

.content-box {
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 12px;
  overflow: hidden;
}

.main-menu {
  padding: 30px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.profile-summary {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-right: 15px;
  background-size: cover;
  background-position: center;
}

.username {
  font-size: 1.2em;
  font-weight: bold;
  color: #333;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ripple-button {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  color: #1168c2;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(17,104,194,0.3);
  transition: background 0.3s, box-shadow 0.2s;
  text-align: left;
  max-width: 300px;
}

.ripple-button:hover {
  background: #e3f0ff;
}

.ripple-button.active {
  box-shadow: 0 0 0 3px rgba(17,104,194,0.4);
}

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background-color: rgba(17, 104, 194, 0.4);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.profile-page {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 30px;
  width: 100%;
}

.back-button {
  align-self: flex-start;
  background: none;
  border: none;
  font-size: 18px;
  color: #1168c2;
  cursor: pointer;
  padding: 10px;
  margin-bottom: 20px;
}

.avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  margin-bottom: 25px;
  background-size: cover;
  background-position: center;
}

.profile-username {
  font-size: 1.4em;
  margin-bottom: 30px;
  font-weight: bold;
  color: #333;
}

.profile-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 300px;
}

#usernameInput {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 10px;
}

.repair-section {
  margin-top: 30px;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1168c2;
}

.repair-section a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.repair-section a:hover {
  text-decoration: underline;
}

iframe {
  border: none;
  width: 100%;
  height: 100%;
  display: none;
  background: white;
}

.bottom-bar {
  height: 60px;
  background: linear-gradient(to right, #1168c2, #0d5aa6, #1168c2);
  flex-shrink: 0;
  z-index: 100;
}

.frame-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 1000;
}

.frame-container.tools {
  top: 0;
  height: 100%;
}

.frame-container.games {
  top: 0;
  height: 100%;
}

.frame-container.news {
  top: 60px;
  height: calc(100% - 120px);
  background: white;
}

.frame-container.news iframe {
  display: block;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 300px;
  width: 100%;
  text-align: center;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.modal-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.modal-buttons button:first-child {
  background: #1168c2;
  color: white;
}

.modal-buttons button:last-child {
  background: #e0e0e0;
  color: #333;
}

@media (max-width: 768px) {
  .centered { padding: 10px; }
  .main-menu { padding: 20px; }
  .avatar { width: 50px; height: 50px; font-size: 24px; }
  .ripple-button { padding: 10px 20px; }
}